You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ra...@apache.org on 2019/01/30 10:39:28 UTC

[carbondata] 24/27: [CARBONDATA-3282] set hadoop conf to thread local for file factory usage in presto carbon

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 00b1891647a1b59c722d61d9b53d1929ec2e0ca8
Author: ajantha-bhat <aj...@gmail.com>
AuthorDate: Tue Jan 29 18:39:49 2019 +0530

    [CARBONDATA-3282] set hadoop conf to thread local for file factory usage in presto carbon
    
    [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                                                 | 5 +++++
 integration/presto/pom.xml                                           | 5 +++++
 .../java/org/apache/carbondata/presto/CarbondataSplitManager.java    | 3 +++
 3 files changed, 13 insertions(+)

diff --git a/docs/presto-guide.md b/docs/presto-guide.md
index 7389bc6..6bb8196 100644
--- a/docs/presto-guide.md
+++ b/docs/presto-guide.md
@@ -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.
diff --git a/integration/presto/pom.xml b/integration/presto/pom.xml
index 8de9671..75631c2 100644
--- a/integration/presto/pom.xml
+++ b/integration/presto/pom.xml
@@ -551,6 +551,11 @@
       <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>
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 6efef93..0902058 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
@@ -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);