You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by el...@apache.org on 2018/04/19 03:49:59 UTC

[3/3] phoenix git commit: PHOENIX-4423 Hive 2.3.0 support

PHOENIX-4423 Hive 2.3.0 support

Signed-off-by: Josh Elser <el...@apache.org>


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 83825dec5229458bb5aa585908661fb9c087e61f
Parents: 0a2ff12
Author: Ankit Singhal <an...@gmail.com>
Authored: Wed Apr 18 16:14:14 2018 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Wed Apr 18 23:41:41 2018 -0400

----------------------------------------------------------------------
 phoenix-hive/pom.xml                            |   79 +-
 .../hadoop/hive/ql/QTestProcessExecResult.java  |   66 +
 .../org/apache/hadoop/hive/ql/QTestUtil.java    | 2489 ++++++++++++++++++
 .../hive/ql/security/DummyAuthenticator.java    |   70 +
 .../phoenix/hive/BaseHivePhoenixStoreIT.java    |   62 +-
 .../apache/phoenix/hive/HiveMapReduceIT.java    |   24 +-
 .../apache/phoenix/hive/HivePhoenixStoreIT.java |   42 +-
 .../org/apache/phoenix/hive/HiveTestUtil.java   | 1256 +--------
 .../java/org/apache/phoenix/hive/HiveTezIT.java |    2 -
 .../phoenix/hive/PhoenixStorageHandler.java     |    4 +-
 .../hive/mapreduce/PhoenixInputFormat.java      |    4 +-
 .../hive/ql/index/IndexPredicateAnalyzer.java   |   34 +-
 .../hive/util/PhoenixConnectionUtil.java        |   19 +-
 .../hive/util/PhoenixStorageHandlerUtil.java    |   43 +-
 phoenix-hive/src/test/resources/hive-site.xml   |  123 +
 phoenix-hive/src/test/resources/tez-site.xml    |   69 +
 pom.xml                                         |   10 +-
 17 files changed, 3051 insertions(+), 1345 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/83825dec/phoenix-hive/pom.xml
----------------------------------------------------------------------
diff --git a/phoenix-hive/pom.xml b/phoenix-hive/pom.xml
index 2e3fdac..8b9b4c1 100644
--- a/phoenix-hive/pom.xml
+++ b/phoenix-hive/pom.xml
@@ -31,11 +31,19 @@
   </parent>
   <artifactId>phoenix-hive</artifactId>
   <name>Phoenix - Hive</name>
-
+<properties>
+    <test.tmp.dir>${project.build.directory}/tmp</test.tmp.dir>
+</properties>
   <dependencies>
     <dependency>
       <groupId>org.apache.phoenix</groupId>
       <artifactId>phoenix-core</artifactId>
+      <exclusions>
+	  <exclusion>
+          <groupId>com.google.guava</groupId>
+          <artifactId>guava</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.hive</groupId>
@@ -45,6 +53,19 @@
     </dependency>
     <dependency>
       <groupId>org.apache.hive</groupId>
+      <artifactId>hive-metastore</artifactId>
+      <version>${hive.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hive</groupId>
+      <artifactId>hive-standalone-metastore</artifactId>
+      <type>test-jar</type>
+      <version>${hive.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hive</groupId>
       <artifactId>hive-exec</artifactId>
       <version>${hive.version}</version>
       <scope>provided</scope>
@@ -114,7 +135,7 @@
       <groupId>org.apache.tez</groupId>
       <artifactId>tez-tests</artifactId>
       <scope>test</scope>
-      <version>0.8.4</version>
+      <version>0.9.1</version>
       <type>test-jar</type>
       <exclusions>
         <exclusion>
@@ -127,7 +148,7 @@
       <groupId>org.apache.tez</groupId>
       <artifactId>tez-dag</artifactId>
       <scope>test</scope>
-      <version>0.8.4</version>
+      <version>0.9.1</version>
       <exclusions>
         <exclusion>
           <groupId>org.apache.hadoop</groupId>
@@ -141,6 +162,38 @@
       <version>${mockito-all.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>19.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.calcite.avatica</groupId>
+      <artifactId>avatica</artifactId>
+      <!-- Overriding the version of Avatica that PQS uses so that Hive will work -->
+      <version>${avatica.version}</version>
+      <scope>test</scope>
+      <!-- And removing a bunch of dependencies that haven't been shaded in this older
+           Avatica version which conflict with HDFS -->
+      <exclusions>
+        <exclusion>
+          <groupId>org.hsqldb</groupId>
+          <artifactId>hsqldb</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-databind</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-annotations</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>com.fasterxml.jackson.core</groupId>
+          <artifactId>jackson-core</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
   </dependencies>
 
   <build>
@@ -152,6 +205,26 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-failsafe-plugin</artifactId>
+        <executions>
+	    <execution>
+              <id>NeedTheirOwnClusterTests</id>
+              <configuration>
+                 <encoding>UTF-8</encoding>
+                 <forkCount>1</forkCount>
+                 <runOrder>alphabetical</runOrder>
+                 <reuseForks>false</reuseForks>
+                 <argLine>-enableassertions -Xmx2000m -XX:MaxPermSize=256m -Djava.security.egd=file:/dev/./urandom "-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}" -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./target/ -Dorg.apache.hadoop.hbase.shaded.io.netty.packagePrefix=org.apache.hadoop.hbase.shaded.</argLine>
+                 <redirectTestOutputToFile>${test.output.tofile}</redirectTestOutputToFile>
+                 <testSourceDirectory>${basedir}/src/it/java</testSourceDirectory>
+                 <groups>org.apache.phoenix.end2end.NeedsOwnMiniClusterTest</groups>
+                 <shutdown>kill</shutdown>
+              </configuration>
+              <goals>
+                 <goal>integration-test</goal>
+                 <goal>verify</goal>
+              </goals>
+            </execution>
+          </executions>
       </plugin>
       <plugin>
         <artifactId>maven-dependency-plugin</artifactId>

http://git-wip-us.apache.org/repos/asf/phoenix/blob/83825dec/phoenix-hive/src/it/java/org/apache/hadoop/hive/ql/QTestProcessExecResult.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/it/java/org/apache/hadoop/hive/ql/QTestProcessExecResult.java b/phoenix-hive/src/it/java/org/apache/hadoop/hive/ql/QTestProcessExecResult.java
new file mode 100644
index 0000000..f9f7057
--- /dev/null
+++ b/phoenix-hive/src/it/java/org/apache/hadoop/hive/ql/QTestProcessExecResult.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql;
+
+/**
+ * Standard output and return code of a process executed during the qtests.
+ */
+public class QTestProcessExecResult {
+
+  private static final String TRUNCATED_OUTPUT = "Output was too long and had to be truncated...";
+  private static final short MAX_OUTPUT_CHAR_LENGTH = 2000;
+
+  private final int returnCode;
+  private final String standardOut;
+
+  QTestProcessExecResult(int code, String output) {
+    this.returnCode = code;
+    this.standardOut = truncatefNeeded(output);
+  }
+
+  /**
+   * @return executed process return code
+   */
+  public int getReturnCode() {
+    return this.returnCode;
+  }
+
+  /**
+   * @return output captured from stdout while process was executing
+   */
+  public String getCapturedOutput() {
+    return this.standardOut;
+  }
+
+  public static QTestProcessExecResult create(int code, String output) {
+    return new QTestProcessExecResult(code, output);
+  }
+
+  public static  QTestProcessExecResult createWithoutOutput(int code) {
+    return new QTestProcessExecResult(code, "");
+  }
+
+  private String truncatefNeeded(String orig) {
+    if (orig.length() > MAX_OUTPUT_CHAR_LENGTH) {
+      return orig.substring(0, MAX_OUTPUT_CHAR_LENGTH) + "\r\n" + TRUNCATED_OUTPUT;
+    } else {
+      return orig;
+    }
+  }
+}