From e5e11be9b79cd2e2870d606965f3458d7a387134 Mon Sep 17 00:00:00 2001 From: Owen O'Malley Date: Tue, 23 May 2017 15:07:04 -0700 Subject: [PATCH] HIVE-15144. Remove dependence on json.org artifacts. --- 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 | 14 +++++++------- 8 files changed, 33 insertions(+), 42 deletions(-) delete mode 100644 binary-package-licenses/org.json-LICENSE diff --git binary-package-licenses/org.json-LICENSE binary-package-licenses/org.json-LICENSE deleted file mode 100644 index a8c1705ceb..0000000000 --- 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. diff --git common/pom.xml common/pom.xml index e6722babd8..023f084511 100644 --- common/pom.xml +++ common/pom.xml @@ -198,9 +198,8 @@ test - org.json + com.tdunning json - ${json.version} io.dropwizard.metrics diff --git jdbc/pom.xml jdbc/pom.xml index 1294a617e8..fef1923336 100644 --- jdbc/pom.xml +++ jdbc/pom.xml @@ -264,7 +264,7 @@ org.htrace:* org.mortbay.jetty:* org.xerial.snappy:* - org.json:* + com.tdunning:* tomcat:* xmlenc:* xerces:* diff --git llap-server/pom.xml llap-server/pom.xml index b10f05f82b..ff62dc31cd 100644 --- llap-server/pom.xml +++ llap-server/pom.xml @@ -96,9 +96,8 @@ ${libthrift.version} - org.json + com.tdunning json - ${json.version} org.apache.hadoop @@ -231,6 +230,10 @@ + + org.codehaus.jettison + jettison + diff --git llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java index 4d30296c84..5090be2197 100644 --- llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java +++ llap-server/src/java/org/apache/hadoop/hive/llap/cli/LlapServiceDriver.java @@ -52,6 +52,8 @@ 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.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 @@ private void writeConfigJson(Path tmpDir, final FileSystem lfs, } 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(); diff --git pom.xml pom.xml index 70518d12c0..c6fe9fa3eb 100644 --- pom.xml +++ pom.xml @@ -162,6 +162,7 @@ 3.1.0 5.5.1 3.0.1 + 1.1 9.3.8.v20160314 1.14 @@ -170,7 +171,7 @@ 1.1 2.8.1 3.5.2 - 20090211 + 1.8 4.11 3.0.3 0.9.3 @@ -610,6 +611,17 @@ ${jackson.version} + org.codehaus.jettison + jettison + ${jettison.version} + + + stax + stax-api + + + + org.eclipse.jetty jetty-rewrite ${jetty.version} @@ -655,7 +667,7 @@ ${datanucleus-jdo.version} - org.json + com.tdunning json ${json.version} diff --git ql/pom.xml ql/pom.xml index 9c176958a2..5732965e47 100644 --- ql/pom.xml +++ ql/pom.xml @@ -446,9 +446,8 @@ ${gson.version} - org.json + com.tdunning json - ${json.version} stax @@ -883,7 +882,7 @@ commons-lang:commons-lang org.apache.commons:commons-lang3 org.jodd:jodd-core - org.json:json + com.tdunning:json org.apache.avro:avro org.apache.avro:avro-mapred org.apache.hive.shims:hive-shims-0.23 diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java index 902664d61c..177992f0d3 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java @@ -139,27 +139,27 @@ static JSONObject getJSONDependencies(ExplainWork work) assert(work.getDependency()); JSONObject outJSONObject = new JSONObject(new LinkedHashMap<>()); - List> inputTableInfo = new ArrayList>(); - List> inputPartitionInfo = new ArrayList>(); + JSONArray inputTableInfo = new JSONArray(); + JSONArray inputPartitionInfo = new JSONArray(); for (ReadEntity input: work.getInputs()) { switch (input.getType()) { case TABLE: Table table = input.getTable(); - Map tableInfo = new LinkedHashMap(); + 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 partitionInfo = new HashMap(); + 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; @@ -222,7 +222,7 @@ public JSONObject getJSONLogicalPlan(PrintStream out, ExplainWork work) throws E (isVectorizationEnabled ? trueCondNameVectorizationEnabled : falseCondNameVectorizationEnabled); - List isVectorizationEnabledCondList = Arrays.asList(isVectorizationEnabledCondName); + JSONArray isVectorizationEnabledCondList = new JSONArray(Arrays.asList(isVectorizationEnabledCondName)); if (out != null) { out.print(indentString(2)); -- 2.13.0