Search in sources :

Example 1 with HivePageSinkMetadataProvider

use of io.trino.plugin.hive.metastore.HivePageSinkMetadataProvider in project trino by trinodb.

the class HivePageSinkProvider method createPageSink.

private ConnectorPageSink createPageSink(HiveWritableTableHandle handle, boolean isCreateTable, ConnectorSession session, Map<String, String> additionalTableParameters) {
    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();
    }
    HiveWriterFactory writerFactory = new HiveWriterFactory(fileWriterFactories, handle.getSchemaName(), handle.getTableName(), isCreateTable, handle.getTransaction(), handle.getInputColumns(), handle.getTableStorageFormat(), handle.getPartitionStorageFormat(), additionalTableParameters, bucketCount, sortedBy, handle.getLocationHandle(), locationService, session.getQueryId(), new HivePageSinkMetadataProvider(handle.getPageSinkMetadata(), new HiveMetastoreClosure(memoizeMetastore(metastoreFactory.createMetastore(Optional.of(session.getIdentity())), perTransactionMetastoreCacheMaximumSize))), typeManager, hdfsEnvironment, pageSorter, writerSortBufferSize, maxOpenSortFiles, parquetTimeZone, session, nodeManager, eventClient, hiveSessionProperties, hiveWriterStats);
    return new HivePageSink(writerFactory, handle.getInputColumns(), handle.isTransactional(), handle.getBucketProperty(), pageIndexerFactory, hdfsEnvironment, maxOpenPartitions, writeVerificationExecutor, partitionUpdateCodec, session);
}
Also used : HivePageSinkMetadataProvider(io.trino.plugin.hive.metastore.HivePageSinkMetadataProvider) SortingColumn(io.trino.plugin.hive.metastore.SortingColumn) OptionalInt(java.util.OptionalInt)

Aggregations

HivePageSinkMetadataProvider (io.trino.plugin.hive.metastore.HivePageSinkMetadataProvider)1 SortingColumn (io.trino.plugin.hive.metastore.SortingColumn)1 OptionalInt (java.util.OptionalInt)1