Commit be9df1c3 by Le Ma Committed by Sarath Subramanian

ATLAS-3229 DDL should not capture DML queries

parent e21f569f
...@@ -109,7 +109,8 @@ public class CreateHiveProcess extends BaseHiveEvent { ...@@ -109,7 +109,8 @@ public class CreateHiveProcess extends BaseHiveEvent {
outputs.add(entity); outputs.add(entity);
} }
if (entity != null && !context.isMetastoreHook()) { if (isDdlOperation(entity)) {
AtlasEntity ddlEntity = createHiveDDLEntity(entity); AtlasEntity ddlEntity = createHiveDDLEntity(entity);
if (ddlEntity != null) { if (ddlEntity != null) {
...@@ -277,4 +278,11 @@ public class CreateHiveProcess extends BaseHiveEvent { ...@@ -277,4 +278,11 @@ public class CreateHiveProcess extends BaseHiveEvent {
return ret; return ret;
} }
private boolean isDdlOperation(AtlasEntity entity) {
return entity != null && !context.isMetastoreHook()
&& (context.getHiveOperation().equals(HiveOperation.CREATETABLE_AS_SELECT)
|| context.getHiveOperation().equals(HiveOperation.CREATEVIEW)
|| context.getHiveOperation().equals(HiveOperation.ALTERVIEW_AS));
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment