/** * This constructor is used while generating QueryInfo object for the table * * @param cd ColumnDescriptor Object * @param tableName String * @param tableNum int * @throws StandardException * @see TableQueryInfo#TableQueryInfo(FromBaseTable) */ ColumnQueryInfo(ColumnDescriptor cd, TableQueryInfo tqi, int tableNum) throws StandardException { this.actualColumnName = cd.getColumnName(); this.actualColumnNumber = cd.getPosition(); this.columnDescriptor = cd; this.td = cd.getTableDescriptor(); this.columnType = cd.getType(); this.tqi = tqi; this.exposedColumnName = this.actualColumnName; this.virtualColumnNumber = this.actualColumnNumber; assert this.columnDescriptor != null; }
/** * This constructor is invoked while analyzing the projection attributes * * @param rc ResultColumn * @throws StandardException * @see SelectQueryInfo#visit(com.pivotal.gemfirexd.internal.iapi.sql.compile.Visitable) */ ColumnQueryInfo(final ResultColumn rc, QueryInfoContext qic) throws StandardException { final ColumnDescriptor cd = searchColumnDescriptor(rc); if (cd != null) { this.actualColumnName = cd.getColumnName(); this.actualColumnNumber = cd.getPosition(); this.columnDescriptor = cd; this.columnType = cd.getType(); this.td = cd.getTableDescriptor(); } else { String columnName = rc.getSourceColumnName(); if (columnName == null) { columnName = rc.getActualName(); } this.actualColumnName = columnName; this.actualColumnNumber = rc.getColumnPosition(); this.columnType = rc.getType(); this.td = null; this.columnDescriptor = new ColumnDescriptor( this.actualColumnName, this.actualColumnNumber, this.columnType, null, // default null, // defaultInfo (UUID) null, // table uuid (UUID) null, // default uuid 0L, // autoincStart 0L, // autoincInc 0L, false); // autoincValue } if (tableNum > -1) { DMLQueryInfo currentTop = qic.getCurrentScopeQueryInfo(); this.tqi = currentTop.getTableQueryInfo(tableNum); // TODO:Asif Should we do correlation check here? } this.exposedColumnName = rc.getName(); this.virtualColumnNumber = rc.getVirtualColumnId(); assert this.columnDescriptor != null; }