HIVE-21238: Fix Surrogate Key issue (Miklos Gergely reviewed by Vineet Garg)
authorMiklos Gergely <mgergely@hortonworks.com>
Tue, 12 Feb 2019 19:34:08 +0000 (11:34 -0800)
committerVineet Garg <vgarg@apache.org>
Tue, 12 Feb 2019 19:35:27 +0000 (11:35 -0800)
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java

index 0d0196e..f2ba1ad 100644 (file)
@@ -7957,6 +7957,10 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
         }
       }
     }
+
+    for (Operator<? extends OperatorDesc> parent : (List<Operator<? extends OperatorDesc>>)input.getParentOperators()) {
+      setWriteIdForSurrogateKeys(ltd, parent);
+    }
   }
 
   private WriteEntity generateTableWriteEntity(String dest, Table dest_tab,