diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java index 1f00a7e..1ece8d5 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java @@ -385,6 +385,14 @@ public void initialize(Configuration hconf, ObjectInspector[] inputOIs) passExecContext(this.execContext); initializeOp(hconf); + + // sanity check + if (childOperatorsArray == null + && !(childOperators == null || childOperators.isEmpty())) { + throw new HiveException( + "Internal Hive error during operator initialization."); + } + LOG.info("Initialization Done " + id + " " + getName()); } @@ -780,7 +788,7 @@ public boolean removeChildren(int depth) { Operator currOp = this; for (int i = 0; i < depth; i++) { // If there are more than 1 children at any level, don't do anything - if ((currOp.getChildOperators() == null) || (currOp.getChildOperators().isEmpty()) || + if ((currOp.getChildOperators() == null) || (currOp.getChildOperators().isEmpty()) || (currOp.getChildOperators().size() > 1)) { return false; } @@ -844,11 +852,6 @@ protected void forward(Object row, ObjectInspector rowInspector) // System.out.println("" + this.getClass() + ">> " + // ObjectInspectorUtils.getObjectInspectorName(rowInspector)); - if (childOperatorsArray == null && childOperators != null) { - throw new HiveException( - "Internal Hive error during operator initialization."); - } - if ((childOperatorsArray == null) || (getDone())) { return; }