Source:
<code>public void resolveColumnIndexes() { IndexScanPlanNode index_scan = (IndexScanPlanNode) getInlinePlanNode(PlanNodeType.INDEXSCAN); assert(m_children.size() == 2 && index_scan == null); for (AbstractPlanNode child : m_children) { child.resolveColumnIndexes(); } final NodeSchema outer_schema = m_children.get(0).getOutputSchema(); final NodeSchema inner_schema = m_children.get(1).getOutputSchema(); final int outerSize = outer_schema.size(); final int innerSize = inner_schema.size(); resolvePredicate(m_preJoinPredicate, outer_schema, inner_schema); resolvePredicate(m_joinPredicate, outer_schema, inner_schema); resolvePredicate(m_wherePredicate, outer_schema, inner_schema); resolveSubqueryColumnIndexes(); for (int i = 0; i < m_outputSchemaPreInlineAgg.size(); ++i) { SchemaColumn col = m_outputSchemaPreInlineAgg.getColumns().get(i); assert(col.getExpression() instanceof TupleValueExpression); TupleValueExpression tve = (TupleValueExpression)col.getExpression(); <START> int index = i; <END> if (i < outerSize) { index = tve.setColumnIndexUsingSchema(outer_schema); } else { index = tve.setColumnIndexUsingSchema(inner_schema); index += outerSize; } if (index == -1) { throw new RuntimeException("Unable to find index for column: " + col.toString()); } tve.setColumnIndex(index); tve.setDifferentiator(index); } m_outputSchemaPreInlineAgg.sortByTveIndex(0, outer_schema.size()); m_outputSchemaPreInlineAgg.sortByTveIndex(outer_schema.size(), m_outputSchemaPreInlineAgg.size()); m_hasSignificantOutputSchema = true; resolveRealOutputSchema(); }</code><technical_language>initialize index non-zero if immediately overwritten. before, get a compiler error if read index initialized</technical_language>

Target:
public void resolveColumnIndexes() { IndexScanPlanNode index_scan = (IndexScanPlanNode) getInlinePlanNode(PlanNodeType.INDEXSCAN); assert(m_children.size() == 2 && index_scan == null); for (AbstractPlanNode child : m_children) { child.resolveColumnIndexes(); } final NodeSchema outer_schema = m_children.get(0).getOutputSchema(); final NodeSchema inner_schema = m_children.get(1).getOutputSchema(); final int outerSize = outer_schema.size(); final int innerSize = inner_schema.size(); resolvePredicate(m_preJoinPredicate, outer_schema, inner_schema); resolvePredicate(m_joinPredicate, outer_schema, inner_schema); resolvePredicate(m_wherePredicate, outer_schema, inner_schema); resolveSubqueryColumnIndexes(); for (int i = 0; i < m_outputSchemaPreInlineAgg.size(); ++i) { SchemaColumn col = m_outputSchemaPreInlineAgg.getColumns().get(i); assert(col.getExpression() instanceof TupleValueExpression); TupleValueExpression tve = (TupleValueExpression)col.getExpression(); int index; if (i < outerSize) { index = tve.setColumnIndexUsingSchema(outer_schema); } else { index = tve.setColumnIndexUsingSchema(inner_schema); index += outerSize; } if (index == -1) { throw new RuntimeException("Unable to find index for column: " + col.toString()); } tve.setColumnIndex(index); tve.setDifferentiator(index); } m_outputSchemaPreInlineAgg.sortByTveIndex(0, outer_schema.size()); m_outputSchemaPreInlineAgg.sortByTveIndex(outer_schema.size(), m_outputSchemaPreInlineAgg.size()); m_hasSignificantOutputSchema = true; resolveRealOutputSchema(); }