Commit 75da0390 by Madhan Neethiraj

ATLAS-2757: fix for NPE in Hive hook in handling column-rename on temporary table

parent 399468e6
...@@ -54,10 +54,17 @@ public class AlterTableRenameCol extends AlterTable { ...@@ -54,10 +54,17 @@ public class AlterTableRenameCol extends AlterTable {
return null; return null;
} }
List<HookNotification> ret = new ArrayList<>(super.getNotificationMessages()); List<HookNotification> baseMsgs = super.getNotificationMessages();
Table oldTable = getHiveContext().getInputs().iterator().next().getTable(); if (CollectionUtils.isEmpty(baseMsgs)) {
Table newTable = getHiveContext().getOutputs().iterator().next().getTable(); LOG.debug("Skipped processing of column-rename (on a temporary table?)");
return null;
}
List<HookNotification> ret = new ArrayList<>(baseMsgs);
Table oldTable = getHiveContext().getInputs().iterator().next().getTable();
Table newTable = getHiveContext().getOutputs().iterator().next().getTable();
newTable = getHive().getTable(newTable.getDbName(), newTable.getTableName()); newTable = getHive().getTable(newTable.getDbName(), newTable.getTableName());
......
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