Repository: hive Updated Branches: refs/heads/master 45a1ec87e -> 7580de9a4
HIVE-15144: JSON.org license is now CatX (Owen O'Malley, reviewed by Alan Gates) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/7580de9a Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/7580de9a Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/7580de9a Branch: refs/heads/master Commit: 7580de9a49df1107ae9e709c4e2615a0982f5ed4 Parents: 45a1ec8 Author: Pengcheng Xiong <pxi...@apache.org> Authored: Mon Jul 10 15:54:23 2017 -0700 Committer: Pengcheng Xiong <pxi...@apache.org> Committed: Mon Jul 10 15:54:23 2017 -0700 ---------------------------------------------------------------------- binary-package-licenses/org.json-LICENSE | 22 ---------------- common/pom.xml | 3 +-- jdbc/pom.xml | 2 +- llap-server/pom.xml | 7 +++-- .../hadoop/hive/llap/cli/LlapServiceDriver.java | 6 ++--- pom.xml | 16 ++++++++++-- ql/pom.xml | 5 ++-- .../apache/hadoop/hive/ql/exec/ExplainTask.java | 27 ++++++++++---------- 8 files changed, 40 insertions(+), 48 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/7580de9a/binary-package-licenses/org.json-LICENSE ---------------------------------------------------------------------- diff --git a/binary-package-licenses/org.json-LICENSE b/binary-package-licenses/org.json-LICENSE deleted file mode 100644 index a8c1705..0000000 --- a/binary-package-licenses/org.json-LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2002 JSON.org - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -The Software shall be used for Good, not Evil. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. http://git-wip-us.apache.org/repos/asf/hive/blob/7580de9a/common/pom.xml ---------------------------------------------------------------------- diff --git a/common/pom.xml b/common/pom.xml index e6722ba..023f084 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -198,9 +198,8 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.json</groupId> + <groupId>com.tdunning</groupId> <artifactId>json</artifactId> - <version>${json.version}</version> </dependency> <dependency> <groupId>io.dropwizard.metrics</groupId> http://git-wip-us.apache.org/repos/asf/hive/blob/7580de9a/jdbc/pom.xml ---------------------------------------------------------------------- diff --git a/jdbc/pom.xml b/jdbc/pom.xml index 1294a61..fef1923 100644 --- a/jdbc/pom.xml +++ b/jdbc/pom.xml @@ -264,7 +264,7 @@ <exclude>org.htrace:*</exclude> <exclude>org.mortbay.jetty:*</exclude> <exclude>org.xerial.snappy:*</exclude> - <exclude>org.json:*</exclude> + <exclude>com.tdunning:*</exclude> <exclude>tomcat:*</exclude> <exclude>xmlenc:*</exclude> <exclude>xerces:*</exclude> http://git-wip-us.apache.org/repos/asf/hive/blob/7580de9a/llap-server/pom.xml ---------------------------------------------------------------------- diff --git a/llap-server/pom.xml b/llap-server/pom.xml index b10f05f..ff62dc3 100644 --- a/llap-server/pom.xml +++ b/llap-server/pom.xml @@ -96,9 +96,8 @@ <version>${libthrift.version}</version> </dependency> <dependency> - <groupId>org.json</groupId> + <groupId>com.tdunning</groupId> <artifactId>json</artifactId> - <version>${json.version}</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> @@ -231,6 +230,10 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.codehaus.jettison</groupId> + <artifactId>jettison</artifactId> + </dependency> <!-- test inter-project --> <dependency> http://git-wip-us.apache.org/repos/asf/hive/blob/7580de9a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java ---------------------------------------------------------------------- diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java b/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java index 4d30296..5090be2 100644 --- a/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java +++ b/llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java @@ -52,6 +52,8 @@ import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos; import org.apache.hadoop.hive.llap.tezplugins.LlapTezUtils; import org.apache.hadoop.registry.client.binding.RegistryUtils; import org.apache.tez.dag.api.TezConfiguration; +import org.codehaus.jettison.json.JSONException; +import org.codehaus.jettison.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.hadoop.conf.Configuration; @@ -79,8 +81,6 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.eclipse.jetty.rewrite.handler.Rule; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.joda.time.DateTime; -import org.json.JSONException; -import org.json.JSONObject; import com.google.common.base.Preconditions; import com.google.common.util.concurrent.ThreadFactoryBuilder; @@ -642,7 +642,7 @@ public class LlapServiceDriver { } private JSONObject createConfigJson(long containerSize, long cache, long xmx, - String java_home) throws JSONException { + String java_home) throws JSONException { // extract configs for processing by the python fragments in Slider JSONObject configs = new JSONObject(); http://git-wip-us.apache.org/repos/asf/hive/blob/7580de9a/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 04cbf11..1b89632 100644 --- a/pom.xml +++ b/pom.xml @@ -162,6 +162,7 @@ <javax-servlet.version>3.1.0</javax-servlet.version> <javolution.version>5.5.1</javolution.version> <jdo-api.version>3.0.1</jdo-api.version> + <jettison.version>1.1</jettison.version> <jetty.version>9.3.8.v20160314</jetty.version> <jersey.version>1.14</jersey.version> <!-- Glassfish jersey is included for Spark client test only --> @@ -170,7 +171,7 @@ <jms.version>1.1</jms.version> <joda.version>2.8.1</joda.version> <jodd.version>3.5.2</jodd.version> - <json.version>20090211</json.version> + <json.version>1.8</json.version> <junit.version>4.11</junit.version> <kryo.version>3.0.3</kryo.version> <libfb303.version>0.9.3</libfb303.version> @@ -610,6 +611,17 @@ <version>${jackson.version}</version> </dependency> <dependency> + <groupId>org.codehaus.jettison</groupId> + <artifactId>jettison</artifactId> + <version>${jettison.version}</version> + <exclusions> + <exclusion> + <groupId>stax</groupId> + <artifactId>stax-api</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-rewrite</artifactId> <version>${jetty.version}</version> @@ -655,7 +667,7 @@ <version>${datanucleus-jdo.version}</version> </dependency> <dependency> - <groupId>org.json</groupId> + <groupId>com.tdunning</groupId> <artifactId>json</artifactId> <version>${json.version}</version> </dependency> http://git-wip-us.apache.org/repos/asf/hive/blob/7580de9a/ql/pom.xml ---------------------------------------------------------------------- diff --git a/ql/pom.xml b/ql/pom.xml index 9c17695..5732965 100644 --- a/ql/pom.xml +++ b/ql/pom.xml @@ -446,9 +446,8 @@ <version>${gson.version}</version> </dependency> <dependency> - <groupId>org.json</groupId> + <groupId>com.tdunning</groupId> <artifactId>json</artifactId> - <version>${json.version}</version> </dependency> <dependency> <groupId>stax</groupId> @@ -883,7 +882,7 @@ <include>commons-lang:commons-lang</include> <include>org.apache.commons:commons-lang3</include> <include>org.jodd:jodd-core</include> - <include>org.json:json</include> + <include>com.tdunning:json</include> <include>org.apache.avro:avro</include> <include>org.apache.avro:avro-mapred</include> <include>org.apache.hive.shims:hive-shims-0.23</include> http://git-wip-us.apache.org/repos/asf/hive/blob/7580de9a/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java index 902664d..2dc681e 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java @@ -139,27 +139,27 @@ public class ExplainTask extends Task<ExplainWork> implements Serializable { assert(work.getDependency()); JSONObject outJSONObject = new JSONObject(new LinkedHashMap<>()); - List<Map<String, String>> inputTableInfo = new ArrayList<Map<String, String>>(); - List<Map<String, String>> inputPartitionInfo = new ArrayList<Map<String, String>>(); + JSONArray inputTableInfo = new JSONArray(); + JSONArray inputPartitionInfo = new JSONArray(); for (ReadEntity input: work.getInputs()) { switch (input.getType()) { case TABLE: Table table = input.getTable(); - Map<String, String> tableInfo = new LinkedHashMap<String, String>(); + JSONObject tableInfo = new JSONObject(); tableInfo.put("tablename", table.getCompleteName()); tableInfo.put("tabletype", table.getTableType().toString()); if ((input.getParents() != null) && (!input.getParents().isEmpty())) { tableInfo.put("tableParents", input.getParents().toString()); } - inputTableInfo.add(tableInfo); + inputTableInfo.put(tableInfo); break; case PARTITION: - Map<String, String> partitionInfo = new HashMap<String, String>(); + JSONObject partitionInfo = new JSONObject(); partitionInfo.put("partitionName", input.getPartition().getCompleteName()); if ((input.getParents() != null) && (!input.getParents().isEmpty())) { partitionInfo.put("partitionParents", input.getParents().toString()); } - inputPartitionInfo.add(partitionInfo); + inputPartitionInfo.put(partitionInfo); break; default: break; @@ -238,10 +238,11 @@ public class ExplainTask extends Task<ExplainWork> implements Serializable { } if (jsonOutput) { json.put("enabled", isVectorizationEnabled); + JSONArray jsonArray = new JSONArray(Arrays.asList(isVectorizationEnabledCondName)); if (!isVectorizationEnabled) { - json.put("enabledConditionsNotMet", isVectorizationEnabledCondList); + json.put("enabledConditionsNotMet", jsonArray); } else { - json.put("enabledConditionsMet", isVectorizationEnabledCondList); + json.put("enabledConditionsMet", jsonArray); } } @@ -278,7 +279,7 @@ public class ExplainTask extends Task<ExplainWork> implements Serializable { boolean suppressOthersForVectorization = false; if (this.work != null && this.work.isVectorization()) { ImmutablePair<Boolean, JSONObject> planVecPair = outputPlanVectorization(out, jsonOutput); - + if (this.work.isVectorizationOnly()) { // Suppress the STAGES if vectorization is off. suppressOthersForVectorization = !planVecPair.left; @@ -287,7 +288,7 @@ public class ExplainTask extends Task<ExplainWork> implements Serializable { if (out != null) { out.println(); } - + if (jsonOutput) { outJSONObject.put("PLAN VECTORIZATION", planVecPair.right); } @@ -405,7 +406,7 @@ public class ExplainTask extends Task<ExplainWork> implements Serializable { if (jsonParser != null) { jsonParser.print(jsonPlan, null); LOG.info("JsonPlan is augmented to " + jsonPlan.toString()); - } + } out.print(jsonPlan); } } @@ -617,9 +618,9 @@ public class ExplainTask extends Task<ExplainWork> implements Serializable { /** * Retruns a map which have either primitive or string keys. - * + * * This is neccessary to discard object level comparators which may sort the objects based on some non-trivial logic. - * + * * @param mp * @return */