You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2018/09/26 05:10:29 UTC
atlas git commit: ATLAS-2885: Skip handling of INSERT INTO...VALUES
hive query messages
Repository: atlas
Updated Branches:
refs/heads/branch-0.8 60104c18a -> 7876049ff
ATLAS-2885: Skip handling of INSERT INTO...VALUES hive query messages
Signed-off-by: Sarath Subramanian <ss...@hortonworks.com>
Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/7876049f
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/7876049f
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/7876049f
Branch: refs/heads/branch-0.8
Commit: 7876049ff319a1578798df13fc7ce6b2d8b38e31
Parents: 60104c1
Author: apoorvnaik <an...@hortonworks.com>
Authored: Tue Sep 25 22:10:08 2018 -0700
Committer: Sarath Subramanian <ss...@hortonworks.com>
Committed: Tue Sep 25 22:10:08 2018 -0700
----------------------------------------------------------------------
.../atlas/hive/hook/events/CreateHiveProcess.java | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/atlas/blob/7876049f/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateHiveProcess.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateHiveProcess.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateHiveProcess.java
index f465e49..c99a699 100644
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateHiveProcess.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateHiveProcess.java
@@ -63,7 +63,7 @@ public class CreateHiveProcess extends BaseHiveEvent {
}
public AtlasEntitiesWithExtInfo getEntities() throws Exception {
- AtlasEntitiesWithExtInfo ret = null;
+ AtlasEntitiesWithExtInfo ret = null;
if (!skipProcess()) {
List<AtlasEntity> inputs = new ArrayList<>();
@@ -189,7 +189,7 @@ public class CreateHiveProcess extends BaseHiveEvent {
ret = (Collection) retGetBaseCols;
} else {
LOG.warn("{}: unexpected return type from LineageInfo.Dependency.getBaseCols(), expected type {}",
- retGetBaseCols.getClass().getName(), "Collection");
+ retGetBaseCols.getClass().getName(), "Collection");
}
}
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException ex) {
@@ -202,8 +202,8 @@ public class CreateHiveProcess extends BaseHiveEvent {
private boolean skipProcess() {
- Set<ReadEntity> inputs = getHiveContext().getInputs();
- Set<WriteEntity> outputs = getHiveContext().getOutputs();
+ Set<ReadEntity> inputs = getHiveContext().getInputs();
+ Set<WriteEntity> outputs = getHiveContext().getOutputs();
boolean ret = CollectionUtils.isEmpty(inputs) && CollectionUtils.isEmpty(outputs);
@@ -220,6 +220,15 @@ public class CreateHiveProcess extends BaseHiveEvent {
}
}
+
+ // skip insert into tbl_x values() statements
+ if (!ret && CollectionUtils.isNotEmpty(inputs) && inputs.size() == 1) {
+ ReadEntity input = inputs.iterator().next();
+
+ if (input.getType() == Entity.Type.TABLE && input.getTable().isTemporary()) {
+ ret = true;
+ }
+ }
}
}