carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [carbondata] 23/41: [CARBONDATA-3311] support presto 0.217 #3142
Date Tue, 02 Apr 2019 02:41:43 GMT
This is an automated email from the ASF dual-hosted git repository.

ravipesala pushed a commit to branch branch-1.5
in repository https://gitbox.apache.org/repos/asf/carbondata.git

commit bfc912a1b3548de3be6d43dac733ba5c9221cdb8
Author: ajantha-bhat <ajanthabhat@gmail.com>
AuthorDate: Fri Mar 8 14:47:36 2019 +0800

    [CARBONDATA-3311] support presto 0.217 #3142
    
    supporting the latest version of the presto. please refer the release doc of presto for
more details,
    there is a change in presto-hive interfaces and hive analyser is added.
    
    This closes #3142
---
 integration/presto/pom.xml                                        | 2 +-
 .../org/apache/carbondata/presto/CarbondataConnectorFactory.java  | 7 +++++--
 .../main/java/org/apache/carbondata/presto/CarbondataModule.java  | 8 +++++---
 .../java/org/apache/carbondata/presto/CarbondataSplitManager.java | 2 +-
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/integration/presto/pom.xml b/integration/presto/pom.xml
index 91221d6..5253677 100644
--- a/integration/presto/pom.xml
+++ b/integration/presto/pom.xml
@@ -31,7 +31,7 @@
   <packaging>presto-plugin</packaging>
 
   <properties>
-    <presto.version>0.210</presto.version>
+    <presto.version>0.217</presto.version>
     <httpcore.version>4.4.9</httpcore.version>
     <dev.path>${basedir}/../../dev</dev.path>
     <jacoco.append>true</jacoco.append>
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataConnectorFactory.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataConnectorFactory.java
index 1dd5176..eefcc5c 100755
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataConnectorFactory.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataConnectorFactory.java
@@ -29,6 +29,7 @@ import org.apache.carbondata.hadoop.api.CarbonTableInputFormat;
 import org.apache.carbondata.hadoop.api.CarbonTableOutputFormat;
 import org.apache.carbondata.presto.impl.CarbonTableConfig;
 
+import com.facebook.presto.hive.HiveAnalyzeProperties;
 import com.facebook.presto.hive.HiveConnector;
 import com.facebook.presto.hive.HiveConnectorFactory;
 import com.facebook.presto.hive.HiveMetadataFactory;
@@ -86,7 +87,7 @@ public class CarbondataConnectorFactory extends HiveConnectorFactory {
   private final ClassLoader classLoader;
 
   public CarbondataConnectorFactory(String connectorName, ClassLoader classLoader) {
-    super(connectorName, classLoader, null);
+    super(connectorName, classLoader, Optional.empty());
     this.classLoader = requireNonNull(classLoader, "classLoader is null");
   }
 
@@ -132,6 +133,8 @@ public class CarbondataConnectorFactory extends HiveConnectorFactory {
       HiveSessionProperties hiveSessionProperties =
           injector.getInstance(HiveSessionProperties.class);
       HiveTableProperties hiveTableProperties = injector.getInstance(HiveTableProperties.class);
+      HiveAnalyzeProperties hiveAnalyzeProperties =
+          injector.getInstance(HiveAnalyzeProperties.class);
       ConnectorAccessControl accessControl =
           new PartitionsAwareAccessControl(injector.getInstance(ConnectorAccessControl.class));
       Set<Procedure> procedures = injector.getInstance(Key.get(new TypeLiteral<Set<Procedure>>()
{
@@ -144,7 +147,7 @@ public class CarbondataConnectorFactory extends HiveConnectorFactory {
           new ClassLoaderSafeNodePartitioningProvider(connectorDistributionProvider, classLoader),
           ImmutableSet.of(), procedures, hiveSessionProperties.getSessionProperties(),
           HiveSchemaProperties.SCHEMA_PROPERTIES, hiveTableProperties.getTableProperties(),
-          accessControl, classLoader);
+          hiveAnalyzeProperties.getAnalyzeProperties(), accessControl, classLoader);
     } catch (Exception e) {
       throwIfUnchecked(e);
       throw new RuntimeException(e);
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataModule.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataModule.java
index 1f63b98..98bacf0 100755
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataModule.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataModule.java
@@ -31,6 +31,7 @@ import com.facebook.presto.hive.HadoopDirectoryLister;
 import com.facebook.presto.hive.HdfsConfiguration;
 import com.facebook.presto.hive.HdfsConfigurationUpdater;
 import com.facebook.presto.hive.HdfsEnvironment;
+import com.facebook.presto.hive.HiveAnalyzeProperties;
 import com.facebook.presto.hive.HiveClientConfig;
 import com.facebook.presto.hive.HiveClientModule;
 import com.facebook.presto.hive.HiveCoercionPolicy;
@@ -55,6 +56,7 @@ import com.facebook.presto.hive.LocationService;
 import com.facebook.presto.hive.NamenodeStats;
 import com.facebook.presto.hive.OrcFileWriterConfig;
 import com.facebook.presto.hive.OrcFileWriterFactory;
+import com.facebook.presto.hive.ParquetFileWriterConfig;
 import com.facebook.presto.hive.PartitionUpdate;
 import com.facebook.presto.hive.RcFileFileWriterFactory;
 import com.facebook.presto.hive.TableParameterCodec;
@@ -63,7 +65,6 @@ import com.facebook.presto.hive.TypeTranslator;
 import com.facebook.presto.hive.orc.DwrfPageSourceFactory;
 import com.facebook.presto.hive.orc.OrcPageSourceFactory;
 import com.facebook.presto.hive.parquet.ParquetPageSourceFactory;
-import com.facebook.presto.hive.parquet.ParquetRecordCursorProvider;
 import com.facebook.presto.hive.rcfile.RcFilePageSourceFactory;
 import com.facebook.presto.spi.connector.ConnectorNodePartitioningProvider;
 import com.facebook.presto.spi.connector.ConnectorPageSinkProvider;
@@ -107,6 +108,7 @@ public class CarbondataModule extends HiveClientModule {
 
     binder.bind(HiveSessionProperties.class).in(Scopes.SINGLETON);
     binder.bind(HiveTableProperties.class).in(Scopes.SINGLETON);
+    binder.bind(HiveAnalyzeProperties.class).in(Scopes.SINGLETON);
 
     binder.bind(NamenodeStats.class).in(Scopes.SINGLETON);
     newExporter(binder).export(NamenodeStats.class)
@@ -114,8 +116,6 @@ public class CarbondataModule extends HiveClientModule {
 
     Multibinder<HiveRecordCursorProvider> recordCursorProviderBinder =
         newSetBinder(binder, HiveRecordCursorProvider.class);
-    recordCursorProviderBinder.addBinding().to(ParquetRecordCursorProvider.class)
-        .in(Scopes.SINGLETON);
     recordCursorProviderBinder.addBinding().to(GenericHiveRecordCursorProvider.class)
         .in(Scopes.SINGLETON);
 
@@ -164,6 +164,8 @@ public class CarbondataModule extends HiveClientModule {
     fileWriterFactoryBinder.addBinding().to(OrcFileWriterFactory.class).in(Scopes.SINGLETON);
     fileWriterFactoryBinder.addBinding().to(RcFileFileWriterFactory.class).in(Scopes.SINGLETON);
     binder.bind(CarbonTableReader.class).in(Scopes.SINGLETON);
+
+    configBinder(binder).bindConfig(ParquetFileWriterConfig.class);
   }
 
 }
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataSplitManager.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataSplitManager.java
index 0902058..50dcdc8 100755
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataSplitManager.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataSplitManager.java
@@ -143,7 +143,7 @@ public class CarbondataSplitManager extends HiveSplitManager {
         cSplits.add(new HiveSplit(schemaTableName.getSchemaName(), schemaTableName.getTableName(),
             schemaTableName.getTableName(), "", 0, 0, 0, properties, new ArrayList(),
             getHostAddresses(split.getLocations()), OptionalInt.empty(), false, predicate,
-            new HashMap<>(), Optional.empty()));
+            new HashMap<>(), Optional.empty(), false));
       }
 
       statisticRecorder.logStatisticsAsTableDriver();


Mime
View raw message