private void inFixup ( VoltXMLElement inElement ) { // make this an in expression inElement . name = "operation" ; inElement . attributes . put ( "optype" , "in" ) ; VoltXMLElement rowElem = null ; VoltXMLElement tableElem = null ; VoltXMLElement subqueryElem = null ; VoltXMLElement valueElem = null ; for ( VoltXMLElement child : inElement . children ) { if ( child . name . equals ( "row" ) ) { rowElem = child ; } else if ( child . name . equals ( "table" ) ) { tableElem = child ; } else if ( child . name . equals ( "tablesubquery" ) ) { subqueryElem = child ; } else if ( child . name . equals ( "value" ) ) { valueElem = child ; } } VoltXMLElement inlist ; if ( tableElem != null ) { // make the table expression an in-list inlist = new VoltXMLElement ( "vector" ) ; for ( VoltXMLElement child : tableElem . children ) { assert ( child . name . equals ( "row" ) ) ; assert ( child . children . size ( ) == 1 ) ; inlist . children . addAll ( child . children ) ; } } else if ( subqueryElem != null ) { inlist = subqueryElem ; } else { assert valueElem != null ; inlist = valueElem ; } assert ( rowElem != null ) ; assert ( inlist != null ) ; inElement . children . clear ( ) ; // add the row inElement . children . add ( rowElem ) ; // add the inlist inElement . children . add ( inlist ) ; }
Take an equality - test expression that represents in - list and munge it into the simpler thing we want to output to the AbstractParsedStmt for its AbstractExpression classes .