Index: ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java (revision 915670) +++ ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java (working copy) @@ -192,7 +192,8 @@ protected transient Reporter reporter; protected transient String id; // object inspectors for input rows - protected transient ObjectInspector[] inputObjInspectors = new ObjectInspector[Short.MAX_VALUE]; + // We will increase the size of the array on demand + protected transient ObjectInspector[] inputObjInspectors = new ObjectInspector[1]; // for output rows of this operator protected transient ObjectInspector outputObjInspector; @@ -385,6 +386,10 @@ private void initialize(Configuration hconf, ObjectInspector inputOI, int parentId) throws HiveException { LOG.info("Initializing child " + id + " " + getName()); + // Double the size of the array if needed + if (parentId >= inputObjInspectors.length) { + inputObjInspectors = Arrays.copyOf(inputObjInspectors, inputObjInspectors.length * 2); + } inputObjInspectors[parentId] = inputOI; // call the actual operator initialization function initialize(hconf, null);