[CARBONDATA-3282] set hadoop conf to thread local for file factory usage in presto...
authorajantha-bhat <ajanthabhat@gmail.com>
Tue, 29 Jan 2019 13:09:49 +0000 (18:39 +0530)
committerravipesala <ravi.pesala@gmail.com>
Wed, 30 Jan 2019 09:18:56 +0000 (14:48 +0530)
[HOTFIX] set hadoop conf to thread local for file factory usage in presto carbon.
and Added bloom dependency in presto.

This closes #3114

docs/presto-guide.md
integration/presto/pom.xml
integration/presto/src/main/java/org/apache/carbondata/presto/CarbondataSplitManager.java

index 7389bc6..6bb8196 100644 (file)
@@ -280,3 +280,8 @@ carbondata files.
   ```
   Replace the hostname, port and schema name with your own.
 
+### Supported features of presto carbon
+Presto carbon only supports reading the carbon table which is written by spark carbon or carbon SDK. 
+During reading, it supports the non-distributed datamaps like block datamap and bloom datamap.
+It doesn't support MV datamap and Pre-aggregate datamap as it needs query plan to be changed and presto does not allow it.
+Also Presto carbon supports streaming segment read from streaming table created by spark.
index 8a9c06d..4ddaae0 100644 (file)
       <artifactId>httpclient</artifactId>
       <version>4.5.5</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.carbondata</groupId>
+      <artifactId>carbondata-bloom</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
 
   <build>
index 6efef93..0902058 100755 (executable)
@@ -30,6 +30,7 @@ import org.apache.carbondata.core.stats.QueryStatistic;
 import org.apache.carbondata.core.stats.QueryStatisticsConstants;
 import org.apache.carbondata.core.stats.QueryStatisticsRecorder;
 import org.apache.carbondata.core.util.CarbonTimeStatisticsFactory;
+import org.apache.carbondata.core.util.ThreadLocalSessionInfo;
 import org.apache.carbondata.presto.impl.CarbonLocalMultiBlockSplit;
 import org.apache.carbondata.presto.impl.CarbonTableCacheModel;
 import org.apache.carbondata.presto.impl.CarbonTableReader;
@@ -117,6 +118,8 @@ public class CarbondataSplitManager extends HiveSplitManager {
         new HdfsEnvironment.HdfsContext(session, schemaTableName.getSchemaName(),
             schemaTableName.getTableName()), new Path(location));
     configuration = carbonTableReader.updateS3Properties(configuration);
+    // set the hadoop configuration to thread local, so that FileFactory can use it.
+    ThreadLocalSessionInfo.setConfigurationToCurrentThread(configuration);
     CarbonTableCacheModel cache =
         carbonTableReader.getCarbonCache(schemaTableName, location, configuration);
     Expression filters = PrestoFilterUtil.parseFilterExpression(predicate);