You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by vi...@apache.org on 2018/03/20 20:58:10 UTC

[5/5] drill git commit: DRILL-6145: Implement Hive MapR-DB JSON handler

DRILL-6145: Implement Hive MapR-DB JSON handler

closes #1158


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/b4c599e3
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/b4c599e3
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/b4c599e3

Branch: refs/heads/master
Commit: b4c599e33606f3e2fef132dbd38ee69b516e681e
Parents: ddb73a5
Author: Vitalii Diravka <vi...@gmail.com>
Authored: Fri Mar 9 18:02:42 2018 +0200
Committer: Vitalii Diravka <vi...@gmail.com>
Committed: Tue Mar 20 22:40:32 2018 +0200

----------------------------------------------------------------------
 contrib/storage-hive/core/pom.xml               | 10 ++++++
 .../drill/exec/store/hive/HiveUtilities.java    |  4 +++
 distribution/pom.xml                            |  8 +++++
 pom.xml                                         | 38 +++++++++++++++++---
 4 files changed, 56 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/b4c599e3/contrib/storage-hive/core/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/pom.xml b/contrib/storage-hive/core/pom.xml
index 24c3cf3..351ed88 100644
--- a/contrib/storage-hive/core/pom.xml
+++ b/contrib/storage-hive/core/pom.xml
@@ -172,6 +172,16 @@
           <groupId>com.tdunning</groupId>
           <artifactId>json</artifactId>
         </dependency>
+        <dependency>
+          <groupId>org.apache.hive</groupId>
+          <artifactId>hive-maprdb-json-handler</artifactId>
+          <scope>runtime</scope>
+        </dependency>
+        <dependency>
+          <groupId>com.mapr.db</groupId>
+          <artifactId>maprdb-mapreduce</artifactId>
+          <scope>runtime</scope>
+        </dependency>
       </dependencies>
     </profile>
   </profiles>

http://git-wip-us.apache.org/repos/asf/drill/blob/b4c599e3/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveUtilities.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveUtilities.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveUtilities.java
index 05b7e89..5ff5506 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveUtilities.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveUtilities.java
@@ -64,6 +64,7 @@ import org.apache.hadoop.hive.ql.io.AcidUtils;
 import org.apache.hadoop.hive.ql.io.IOConstants;
 import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler;
 import org.apache.hadoop.hive.ql.metadata.HiveUtils;
+import org.apache.hadoop.hive.ql.plan.TableDesc;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
 import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory;
@@ -393,6 +394,9 @@ public class HiveUtilities {
             "InputFormat class explicitly specified nor StorageHandler class");
       }
       final HiveStorageHandler storageHandler = HiveUtils.getStorageHandler(job, storageHandlerClass);
+      TableDesc tableDesc = new TableDesc();
+      tableDesc.setProperties(MetaStoreUtils.getTableMetadata(table));
+      storageHandler.configureInputJobProperties(tableDesc, table.getParameters());
       return (Class<? extends InputFormat<?, ?>>) storageHandler.getInputFormatClass();
     } else {
       return (Class<? extends InputFormat<?, ?>>) Class.forName(inputFormatName) ;

http://git-wip-us.apache.org/repos/asf/drill/blob/b4c599e3/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/pom.xml b/distribution/pom.xml
index 7416b9c..7f481b3 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -324,6 +324,14 @@
           <groupId>org.apache.hbase</groupId>
           <artifactId>hbase-protocol</artifactId>
         </dependency>
+        <dependency>
+          <groupId>org.apache.hive</groupId>
+          <artifactId>hive-maprdb-json-handler</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>com.mapr.db</groupId>
+          <artifactId>maprdb-mapreduce</artifactId>
+        </dependency>
       </dependencies>
       <build>
       </build>

http://git-wip-us.apache.org/repos/asf/drill/blob/b4c599e3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 504d4f3..d2a2262 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2265,6 +2265,40 @@
             <version>4.5</version>
           </dependency>
           <dependency>
+            <groupId>org.apache.hive</groupId>
+            <artifactId>hive-maprdb-json-handler</artifactId>
+            <version>${hive.version}</version>
+            <exclusions>
+              <exclusion>
+                <groupId>org.apache.hive</groupId>
+                <artifactId>hive-exec</artifactId>
+              </exclusion>
+            </exclusions>
+          </dependency>
+          <dependency>
+            <groupId>com.mapr.db</groupId>
+            <artifactId>maprdb-mapreduce</artifactId>
+            <version>${mapr.release.version}</version>
+            <exclusions>
+              <exclusion>
+                <groupId>log4j</groupId>
+                <artifactId>log4j</artifactId>
+              </exclusion>
+              <exclusion>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-log4j12</artifactId>
+              </exclusion>
+              <exclusion>
+                <groupId>commons-logging</groupId>
+                <artifactId>commons-logging</artifactId>
+              </exclusion>
+              <exclusion>
+                <groupId>javax.servlet</groupId>
+                <artifactId>servlet-api</artifactId>
+              </exclusion>
+            </exclusions>
+          </dependency>
+          <dependency>
             <groupId>xerces</groupId>
             <artifactId>xercesImpl</artifactId>
             <version>2.11.0</version>
@@ -2369,10 +2403,6 @@
                 <groupId>org.slf4j</groupId>
               </exclusion>
               <exclusion>
-                <artifactId>slf4j-log4j12</artifactId>
-                <groupId>org.slf4j</groupId>
-              </exclusion>
-              <exclusion>
                 <artifactId>log4j</artifactId>
                 <groupId>log4j</groupId>
               </exclusion>