Search in sources :

Example 1 with LocationProvider

use of org.apache.iceberg.io.LocationProvider in project presto by prestodb.

the class IcebergPageSinkProvider method createPageSink.

private ConnectorPageSink createPageSink(ConnectorSession session, IcebergWritableTableHandle tableHandle) {
    HdfsContext hdfsContext = new HdfsContext(session, tableHandle.getSchemaName(), tableHandle.getTableName());
    Schema schema = SchemaParser.fromJson(tableHandle.getSchemaAsJson());
    PartitionSpec partitionSpec = PartitionSpecParser.fromJson(schema, tableHandle.getPartitionSpecAsJson());
    LocationProvider locationProvider = getLocationProvider(new SchemaTableName(tableHandle.getSchemaName(), tableHandle.getTableName()), tableHandle.getOutputPath(), tableHandle.getStorageProperties());
    return new IcebergPageSink(schema, partitionSpec, locationProvider, fileWriterFactory, pageIndexerFactory, hdfsEnvironment, hdfsContext, tableHandle.getInputColumns(), jsonCodec, session, tableHandle.getFileFormat());
}
Also used : IcebergUtil.getLocationProvider(com.facebook.presto.iceberg.IcebergUtil.getLocationProvider) LocationProvider(org.apache.iceberg.io.LocationProvider) Schema(org.apache.iceberg.Schema) HdfsContext(com.facebook.presto.hive.HdfsContext) PartitionSpec(org.apache.iceberg.PartitionSpec) SchemaTableName(com.facebook.presto.spi.SchemaTableName)

Aggregations

HdfsContext (com.facebook.presto.hive.HdfsContext)1 IcebergUtil.getLocationProvider (com.facebook.presto.iceberg.IcebergUtil.getLocationProvider)1 SchemaTableName (com.facebook.presto.spi.SchemaTableName)1 PartitionSpec (org.apache.iceberg.PartitionSpec)1 Schema (org.apache.iceberg.Schema)1 LocationProvider (org.apache.iceberg.io.LocationProvider)1