[12/50] [abbrv] hive git commit: HIVE-18054: Make Lineage work with concurrent queries on a Session (Andrew Sherman, reviewed by Sahil Takiar)
HIVE-18054: Make Lineage work with concurrent queries on a Session (Andrew Sherman, reviewed by Sahil Takiar) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/646ccce8 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/646ccce8 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/646ccce8 Branch: refs/heads/standalone-metastore Commit: 646ccce8ea3e8c944be164f86dbd5d3428bdbc44 Parents: f52e8b4 Author: Andrew Sherman Authored: Sat Dec 16 15:14:54 2017 -0600 Committer: Sahil Takiar Committed: Sat Dec 16 15:24:11 2017 -0600 -- .../java/org/apache/hive/jdbc/ReadableHook.java | 52 + .../apache/hive/jdbc/TestJdbcWithMiniHS2.java | 114 +++ .../java/org/apache/hadoop/hive/ql/Driver.java | 46 ++-- .../org/apache/hadoop/hive/ql/QueryState.java | 35 +- .../org/apache/hadoop/hive/ql/exec/DDLTask.java | 6 +- .../apache/hadoop/hive/ql/exec/MoveTask.java| 9 +- .../org/apache/hadoop/hive/ql/exec/Task.java| 4 + .../bootstrap/load/table/LoadPartitions.java| 3 +- .../repl/bootstrap/load/table/LoadTable.java| 3 +- .../hadoop/hive/ql/hooks/HookContext.java | 9 +- .../hadoop/hive/ql/hooks/LineageLogger.java | 56 +++-- .../hive/ql/index/AggregateIndexHandler.java| 7 +- .../hadoop/hive/ql/index/HiveIndexHandler.java | 6 +- .../hive/ql/index/TableBasedIndexHandler.java | 18 ++- .../ql/index/bitmap/BitmapIndexHandler.java | 8 +- .../ql/index/compact/CompactIndexHandler.java | 8 +- .../hive/ql/optimizer/GenMRFileSink1.java | 2 +- .../hive/ql/optimizer/GenMapRedUtils.java | 27 +++-- .../hadoop/hive/ql/optimizer/IndexUtils.java| 6 +- .../hive/ql/optimizer/lineage/Generator.java| 8 +- .../hive/ql/parse/DDLSemanticAnalyzer.java | 15 ++- .../hive/ql/parse/ExplainSemanticAnalyzer.java | 2 +- .../hadoop/hive/ql/parse/GenTezUtils.java | 3 +- .../hive/ql/parse/ImportSemanticAnalyzer.java | 5 +- .../hadoop/hive/ql/parse/IndexUpdater.java | 9 +- .../hive/ql/parse/LoadSemanticAnalyzer.java | 2 +- .../ql/parse/ReplicationSemanticAnalyzer.java | 4 +- .../hadoop/hive/ql/parse/SemanticAnalyzer.java | 8 +- .../hadoop/hive/ql/parse/TaskCompiler.java | 11 +- .../hive/ql/parse/spark/GenSparkUtils.java | 2 +- .../apache/hadoop/hive/ql/plan/MoveWork.java| 25 +--- .../hadoop/hive/ql/session/LineageState.java| 2 +- .../hadoop/hive/ql/session/SessionState.java| 15 --- ...TestGenMapRedUtilsCreateConditionalTask.java | 18 ++- 34 files changed, 403 insertions(+), 145 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/646ccce8/itests/hive-unit/src/test/java/org/apache/hive/jdbc/ReadableHook.java -- diff --git a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/ReadableHook.java b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/ReadableHook.java new file mode 100644 index 000..2dd283f --- /dev/null +++ b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/ReadableHook.java @@ -0,0 +1,52 @@ +/* + * 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.hive.jdbc; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext; +import org.apache.hadoop.hive.ql.hooks.HookContext; + +/** + * An ExecuteWithHookContext that stores HookContexts in memory and makes them available for reading + */ +public class ReadableHook implements ExecuteWithHookContext { + + private static List hookList = Collections.synchronizedList(new ArrayList<>()); + + @Override + public void run(HookContext hookContext) throws Exception { +hookList.add(hookContext); + } + + /** + * @return the stored HookContexts. + */ + public static List getHookList() { +return hookList; + } + + /** + * Clear the stored HookContexts. + */ + public static void clear() { +hookList.clear(); +
hive git commit: HIVE-18054: Make Lineage work with concurrent queries on a Session (Andrew Sherman, reviewed by Sahil Takiar)
Repository: hive Updated Branches: refs/heads/master f52e8b4ba -> 646ccce8e HIVE-18054: Make Lineage work with concurrent queries on a Session (Andrew Sherman, reviewed by Sahil Takiar) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/646ccce8 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/646ccce8 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/646ccce8 Branch: refs/heads/master Commit: 646ccce8ea3e8c944be164f86dbd5d3428bdbc44 Parents: f52e8b4 Author: Andrew Sherman Authored: Sat Dec 16 15:14:54 2017 -0600 Committer: Sahil Takiar Committed: Sat Dec 16 15:24:11 2017 -0600 -- .../java/org/apache/hive/jdbc/ReadableHook.java | 52 + .../apache/hive/jdbc/TestJdbcWithMiniHS2.java | 114 +++ .../java/org/apache/hadoop/hive/ql/Driver.java | 46 ++-- .../org/apache/hadoop/hive/ql/QueryState.java | 35 +- .../org/apache/hadoop/hive/ql/exec/DDLTask.java | 6 +- .../apache/hadoop/hive/ql/exec/MoveTask.java| 9 +- .../org/apache/hadoop/hive/ql/exec/Task.java| 4 + .../bootstrap/load/table/LoadPartitions.java| 3 +- .../repl/bootstrap/load/table/LoadTable.java| 3 +- .../hadoop/hive/ql/hooks/HookContext.java | 9 +- .../hadoop/hive/ql/hooks/LineageLogger.java | 56 +++-- .../hive/ql/index/AggregateIndexHandler.java| 7 +- .../hadoop/hive/ql/index/HiveIndexHandler.java | 6 +- .../hive/ql/index/TableBasedIndexHandler.java | 18 ++- .../ql/index/bitmap/BitmapIndexHandler.java | 8 +- .../ql/index/compact/CompactIndexHandler.java | 8 +- .../hive/ql/optimizer/GenMRFileSink1.java | 2 +- .../hive/ql/optimizer/GenMapRedUtils.java | 27 +++-- .../hadoop/hive/ql/optimizer/IndexUtils.java| 6 +- .../hive/ql/optimizer/lineage/Generator.java| 8 +- .../hive/ql/parse/DDLSemanticAnalyzer.java | 15 ++- .../hive/ql/parse/ExplainSemanticAnalyzer.java | 2 +- .../hadoop/hive/ql/parse/GenTezUtils.java | 3 +- .../hive/ql/parse/ImportSemanticAnalyzer.java | 5 +- .../hadoop/hive/ql/parse/IndexUpdater.java | 9 +- .../hive/ql/parse/LoadSemanticAnalyzer.java | 2 +- .../ql/parse/ReplicationSemanticAnalyzer.java | 4 +- .../hadoop/hive/ql/parse/SemanticAnalyzer.java | 8 +- .../hadoop/hive/ql/parse/TaskCompiler.java | 11 +- .../hive/ql/parse/spark/GenSparkUtils.java | 2 +- .../apache/hadoop/hive/ql/plan/MoveWork.java| 25 +--- .../hadoop/hive/ql/session/LineageState.java| 2 +- .../hadoop/hive/ql/session/SessionState.java| 15 --- ...TestGenMapRedUtilsCreateConditionalTask.java | 18 ++- 34 files changed, 403 insertions(+), 145 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/646ccce8/itests/hive-unit/src/test/java/org/apache/hive/jdbc/ReadableHook.java -- diff --git a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/ReadableHook.java b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/ReadableHook.java new file mode 100644 index 000..2dd283f --- /dev/null +++ b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/ReadableHook.java @@ -0,0 +1,52 @@ +/* + * 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.hive.jdbc; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext; +import org.apache.hadoop.hive.ql.hooks.HookContext; + +/** + * An ExecuteWithHookContext that stores HookContexts in memory and makes them available for reading + */ +public class ReadableHook implements ExecuteWithHookContext { + + private static List hookList = Collections.synchronizedList(new ArrayList<>()); + + @Override + public void run(HookContext hookContext) throws Exception { +hookList.add(hookContext); + } + + /** + * @return the stored HookContexts. + */ + public static List getHookList() { +return hookList; + } + + /** + * Clear the stored HookContext