Search in sources :

Example 1 with HivePageSinkMetadataProvider

use of io.prestosql.plugin.hive.metastore.HivePageSinkMetadataProvider in project carbondata by apache.

the class CarbonDataPageSinkProvider method createPageSink.

private ConnectorPageSink createPageSink(HiveWritableTableHandle handle, ConnectorSession session, Map<String, String> additionalTableParameters, Map<String, String> additionalConf, boolean isCreateTable) {
    OptionalInt bucketCount = OptionalInt.empty();
    List<SortingColumn> sortedBy = ImmutableList.of();
    if (handle.getBucketProperty().isPresent()) {
        bucketCount = OptionalInt.of(handle.getBucketProperty().get().getBucketCount());
        sortedBy = handle.getBucketProperty().get().getSortedBy();
    }
    CarbonDataWriterFactory carbonDataWriterFactory = new CarbonDataWriterFactory(fileWriterFactories, handle.getSchemaName(), handle.getTableName(), isCreateTable, handle.getInputColumns(), handle.getTableStorageFormat(), handle.getPartitionStorageFormat(), additionalTableParameters, bucketCount, sortedBy, handle.getLocationHandle(), locationService, session.getQueryId(), new HivePageSinkMetadataProvider(handle.getPageSinkMetadata(), new HiveMetastoreClosure(memoizeMetastore(metastore, perTransactionMetastoreCacheMaximumSize)), new HiveIdentity(session)), typeManager, hdfsEnvironment, pageSorter, writerSortBufferSize, maxOpenSortFiles, immutablePartitions, session, nodeManager, eventClient, hiveSessionProperties, hiveWriterStats, additionalConf);
    return new HivePageSink(carbonDataWriterFactory, handle.getInputColumns(), handle.getBucketProperty(), pageIndexerFactory, hdfsEnvironment, maxOpenPartitions, writeVerificationExecutor, partitionUpdateCodec, session);
}
Also used : HivePageSinkMetadataProvider(io.prestosql.plugin.hive.metastore.HivePageSinkMetadataProvider) SortingColumn(io.prestosql.plugin.hive.metastore.SortingColumn) HivePageSink(io.prestosql.plugin.hive.HivePageSink) OptionalInt(java.util.OptionalInt) HiveMetastoreClosure(io.prestosql.plugin.hive.HiveMetastoreClosure) HiveIdentity(io.prestosql.plugin.hive.authentication.HiveIdentity)

Aggregations

HiveMetastoreClosure (io.prestosql.plugin.hive.HiveMetastoreClosure)1 HivePageSink (io.prestosql.plugin.hive.HivePageSink)1 HiveIdentity (io.prestosql.plugin.hive.authentication.HiveIdentity)1 HivePageSinkMetadataProvider (io.prestosql.plugin.hive.metastore.HivePageSinkMetadataProvider)1 SortingColumn (io.prestosql.plugin.hive.metastore.SortingColumn)1 OptionalInt (java.util.OptionalInt)1