Search in sources :

Example 1 with HiveHdfsModule

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

the class CarbondataModule method configure.

@Override
public void configure(Binder binder) {
    binder.install(new HiveHdfsModule());
    binder.bind(TypeTranslator.class).toInstance(new HiveTypeTranslator());
    binder.bind(CoercionPolicy.class).to(HiveCoercionPolicy.class).in(Scopes.SINGLETON);
    binder.bind(DirectoryLister.class).to(CachingDirectoryLister.class).in(Scopes.SINGLETON);
    configBinder(binder).bindConfig(HiveConfig.class);
    binder.bind(HiveSessionProperties.class).in(Scopes.SINGLETON);
    binder.bind(HiveTableProperties.class).in(Scopes.SINGLETON);
    binder.bind(HiveAnalyzeProperties.class).in(Scopes.SINGLETON);
    binder.bind(PrestoS3ClientFactory.class).in(Scopes.SINGLETON);
    binder.bind(CachingDirectoryLister.class).in(Scopes.SINGLETON);
    newExporter(binder).export(CachingDirectoryLister.class).withGeneratedName();
    binder.bind(HiveWriterStats.class).in(Scopes.SINGLETON);
    newExporter(binder).export(HiveWriterStats.class).withGeneratedName();
    newSetBinder(binder, EventClient.class).addBinding().to(HiveEventClient.class).in(Scopes.SINGLETON);
    binder.bind(HivePartitionManager.class).in(Scopes.SINGLETON);
    binder.bind(LocationService.class).to(HiveLocationService.class).in(Scopes.SINGLETON);
    binder.bind(HiveLocationService.class).to(CarbonDataLocationService.class).in(Scopes.SINGLETON);
    binder.bind(HiveMetadataFactory.class).to(CarbonMetadataFactory.class).in(Scopes.SINGLETON);
    binder.bind(TransactionalMetadataFactory.class).to(HiveMetadataFactory.class).in(Scopes.SINGLETON);
    binder.bind(HiveTransactionManager.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorSplitManager.class).to(CarbondataSplitManager.class).in(Scopes.SINGLETON);
    newExporter(binder).export(ConnectorSplitManager.class).as(generator -> generator.generatedNameOf(CarbondataSplitManager.class));
    binder.bind(ConnectorPageSourceProvider.class).to(CarbondataPageSourceProvider.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorPageSinkProvider.class).to(CarbonDataPageSinkProvider.class).in(Scopes.SINGLETON);
    binder.bind(ConnectorNodePartitioningProvider.class).to(HiveNodePartitioningProvider.class).in(Scopes.SINGLETON);
    jsonCodecBinder(binder).bindJsonCodec(PartitionUpdate.class);
    binder.bind(FileFormatDataSourceStats.class).in(Scopes.SINGLETON);
    newExporter(binder).export(FileFormatDataSourceStats.class).withGeneratedName();
    Multibinder<HivePageSourceFactory> pageSourceFactoryBinder = newSetBinder(binder, HivePageSourceFactory.class);
    pageSourceFactoryBinder.addBinding().to(OrcPageSourceFactory.class).in(Scopes.SINGLETON);
    pageSourceFactoryBinder.addBinding().to(ParquetPageSourceFactory.class).in(Scopes.SINGLETON);
    pageSourceFactoryBinder.addBinding().to(RcFilePageSourceFactory.class).in(Scopes.SINGLETON);
    Multibinder<HiveRecordCursorProvider> recordCursorProviderBinder = newSetBinder(binder, HiveRecordCursorProvider.class);
    recordCursorProviderBinder.addBinding().to(S3SelectRecordCursorProvider.class).in(Scopes.SINGLETON);
    binder.bind(GenericHiveRecordCursorProvider.class).in(Scopes.SINGLETON);
    Multibinder<HiveFileWriterFactory> fileWriterFactoryBinder = newSetBinder(binder, HiveFileWriterFactory.class);
    binder.bind(OrcFileWriterFactory.class).in(Scopes.SINGLETON);
    newExporter(binder).export(OrcFileWriterFactory.class).withGeneratedName();
    configBinder(binder).bindConfig(OrcReaderConfig.class);
    configBinder(binder).bindConfig(OrcWriterConfig.class);
    fileWriterFactoryBinder.addBinding().to(OrcFileWriterFactory.class).in(Scopes.SINGLETON);
    fileWriterFactoryBinder.addBinding().to(RcFileFileWriterFactory.class).in(Scopes.SINGLETON);
    configBinder(binder).bindConfig(ParquetReaderConfig.class);
    configBinder(binder).bindConfig(ParquetWriterConfig.class);
    fileWriterFactoryBinder.addBinding().to(CarbonDataFileWriterFactory.class).in(Scopes.SINGLETON);
    binder.bind(CarbonTableReader.class).in(Scopes.SINGLETON);
    jsonBinder(binder).addDeserializerBinding(Type.class).to(TypeDeserializer.class);
    newSetBinder(binder, SystemTable.class);
    // configure carbon properties
    CarbonProperties.getInstance().addProperty(CarbonCommonConstants.IS_QUERY_FROM_PRESTO, "true");
}
Also used : TypeTranslator(io.prestosql.plugin.hive.TypeTranslator) HiveTypeTranslator(io.prestosql.plugin.hive.HiveTypeTranslator) HiveMetadataFactory(io.prestosql.plugin.hive.HiveMetadataFactory) HivePartitionManager(io.prestosql.plugin.hive.HivePartitionManager) HiveCoercionPolicy(io.prestosql.plugin.hive.HiveCoercionPolicy) S3SelectRecordCursorProvider(io.prestosql.plugin.hive.s3select.S3SelectRecordCursorProvider) OrcPageSourceFactory(io.prestosql.plugin.hive.orc.OrcPageSourceFactory) HiveSessionProperties(io.prestosql.plugin.hive.HiveSessionProperties) HiveLocationService(io.prestosql.plugin.hive.HiveLocationService) HiveAnalyzeProperties(io.prestosql.plugin.hive.HiveAnalyzeProperties) ParquetPageSourceFactory(io.prestosql.plugin.hive.parquet.ParquetPageSourceFactory) CachingDirectoryLister(io.prestosql.plugin.hive.CachingDirectoryLister) HiveTableProperties(io.prestosql.plugin.hive.HiveTableProperties) HiveEventClient(io.prestosql.plugin.hive.HiveEventClient) HiveWriterStats(io.prestosql.plugin.hive.HiveWriterStats) FileFormatDataSourceStats(io.prestosql.plugin.hive.FileFormatDataSourceStats) GenericHiveRecordCursorProvider(io.prestosql.plugin.hive.GenericHiveRecordCursorProvider) HiveRecordCursorProvider(io.prestosql.plugin.hive.HiveRecordCursorProvider) EventClient(io.airlift.event.client.EventClient) HiveEventClient(io.prestosql.plugin.hive.HiveEventClient) OrcFileWriterFactory(io.prestosql.plugin.hive.orc.OrcFileWriterFactory) CarbonTableReader(org.apache.carbondata.presto.impl.CarbonTableReader) Type(io.prestosql.spi.type.Type) HiveTypeTranslator(io.prestosql.plugin.hive.HiveTypeTranslator) PrestoS3ClientFactory(io.prestosql.plugin.hive.s3select.PrestoS3ClientFactory) ConnectorSplitManager(io.prestosql.spi.connector.ConnectorSplitManager) GenericHiveRecordCursorProvider(io.prestosql.plugin.hive.GenericHiveRecordCursorProvider) HiveHdfsModule(io.prestosql.plugin.hive.HiveHdfsModule) RcFileFileWriterFactory(io.prestosql.plugin.hive.RcFileFileWriterFactory) HiveTransactionManager(io.prestosql.plugin.hive.HiveTransactionManager) HiveNodePartitioningProvider(io.prestosql.plugin.hive.HiveNodePartitioningProvider) HivePageSourceFactory(io.prestosql.plugin.hive.HivePageSourceFactory) HiveFileWriterFactory(io.prestosql.plugin.hive.HiveFileWriterFactory) RcFilePageSourceFactory(io.prestosql.plugin.hive.rcfile.RcFilePageSourceFactory)

Aggregations

EventClient (io.airlift.event.client.EventClient)1 CachingDirectoryLister (io.prestosql.plugin.hive.CachingDirectoryLister)1 FileFormatDataSourceStats (io.prestosql.plugin.hive.FileFormatDataSourceStats)1 GenericHiveRecordCursorProvider (io.prestosql.plugin.hive.GenericHiveRecordCursorProvider)1 HiveAnalyzeProperties (io.prestosql.plugin.hive.HiveAnalyzeProperties)1 HiveCoercionPolicy (io.prestosql.plugin.hive.HiveCoercionPolicy)1 HiveEventClient (io.prestosql.plugin.hive.HiveEventClient)1 HiveFileWriterFactory (io.prestosql.plugin.hive.HiveFileWriterFactory)1 HiveHdfsModule (io.prestosql.plugin.hive.HiveHdfsModule)1 HiveLocationService (io.prestosql.plugin.hive.HiveLocationService)1 HiveMetadataFactory (io.prestosql.plugin.hive.HiveMetadataFactory)1 HiveNodePartitioningProvider (io.prestosql.plugin.hive.HiveNodePartitioningProvider)1 HivePageSourceFactory (io.prestosql.plugin.hive.HivePageSourceFactory)1 HivePartitionManager (io.prestosql.plugin.hive.HivePartitionManager)1 HiveRecordCursorProvider (io.prestosql.plugin.hive.HiveRecordCursorProvider)1 HiveSessionProperties (io.prestosql.plugin.hive.HiveSessionProperties)1 HiveTableProperties (io.prestosql.plugin.hive.HiveTableProperties)1 HiveTransactionManager (io.prestosql.plugin.hive.HiveTransactionManager)1 HiveTypeTranslator (io.prestosql.plugin.hive.HiveTypeTranslator)1 HiveWriterStats (io.prestosql.plugin.hive.HiveWriterStats)1