question: public String buildUnionSubQuery ( String typeDiscriminatorColumn , String [ ] unionColumns , Set < String > columnsPresentInTable , int computedColumnsOffset , String typeDiscriminatorValue , String selection , String groupBy , String having ) { int unionColumnsCount = unionColumns . length ; String [ ] projectionIn = new String [ unionColumnsCount ] ; for ( int i = 0 ; i < unionColumnsCount ; i ++ ) { String unionColumn = unionColumns [ i ] ; if ( unionColumn . equals ( typeDiscriminatorColumn ) ) { projectionIn [ i ] = "'" + typeDiscriminatorValue + "' AS " + typeDiscriminatorColumn ; } else if ( i <= computedColumnsOffset || columnsPresentInTable . contains ( unionColumn ) ) { projectionIn [ i ] = unionColumn ; } else { projectionIn [ i ] = "NULL AS " + unionColumn ; } } return buildQuery ( projectionIn , selection , groupBy , having , null , null ) ; }
target:  Construct a SELECT statement suitable for use in a group of SELECT statements that will be joined through UNION operators in buildUnionQuery.