use of io.prestosql.plugin.hive.HivePageSink 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);
}
Aggregations