Search in sources :

Example 1 with GenericHiveRecordCursorProvider

use of io.trino.plugin.hive.GenericHiveRecordCursorProvider in project trino by trinodb.

the class AbstractFileFormat method createGenericReader.

@Override
public ConnectorPageSource createGenericReader(ConnectorSession session, HdfsEnvironment hdfsEnvironment, File targetFile, List<ColumnHandle> readColumns, List<String> schemaColumnNames, List<Type> schemaColumnTypes) {
    HivePageSourceProvider factory = new HivePageSourceProvider(TESTING_TYPE_MANAGER, hdfsEnvironment, new HiveConfig(), getHivePageSourceFactory(hdfsEnvironment).map(ImmutableSet::of).orElse(ImmutableSet.of()), getHiveRecordCursorProvider(hdfsEnvironment).map(ImmutableSet::of).orElse(ImmutableSet.of()), new GenericHiveRecordCursorProvider(hdfsEnvironment, new HiveConfig()), Optional.empty());
    Properties schema = createSchema(getFormat(), schemaColumnNames, schemaColumnTypes);
    HiveSplit split = new HiveSplit("schema_name", "table_name", "", targetFile.getPath(), 0, targetFile.length(), targetFile.length(), targetFile.lastModified(), schema, ImmutableList.of(), ImmutableList.of(), OptionalInt.empty(), 0, false, TableToPartitionMapping.empty(), Optional.empty(), Optional.empty(), false, Optional.empty(), 0, SplitWeight.standard());
    return factory.createPageSource(TestingConnectorTransactionHandle.INSTANCE, session, split, new HiveTableHandle("schema_name", "table_name", ImmutableMap.of(), ImmutableList.of(), ImmutableList.of(), Optional.empty()), readColumns, DynamicFilter.EMPTY);
}
Also used : HiveSplit(io.trino.plugin.hive.HiveSplit) HiveTableHandle(io.trino.plugin.hive.HiveTableHandle) ImmutableSet(com.google.common.collect.ImmutableSet) GenericHiveRecordCursorProvider(io.trino.plugin.hive.GenericHiveRecordCursorProvider) Properties(java.util.Properties) HivePageSourceProvider(io.trino.plugin.hive.HivePageSourceProvider) HiveConfig(io.trino.plugin.hive.HiveConfig)

Aggregations

ImmutableSet (com.google.common.collect.ImmutableSet)1 GenericHiveRecordCursorProvider (io.trino.plugin.hive.GenericHiveRecordCursorProvider)1 HiveConfig (io.trino.plugin.hive.HiveConfig)1 HivePageSourceProvider (io.trino.plugin.hive.HivePageSourceProvider)1 HiveSplit (io.trino.plugin.hive.HiveSplit)1 HiveTableHandle (io.trino.plugin.hive.HiveTableHandle)1 Properties (java.util.Properties)1