Column oldCol = origTable.getColumnsIncludingInternal().get(oldPosition);
TInstance oldInst = oldCol.getType();
TPreparedExpression pExp = new TPreparedField(oldInst, oldPosition);
if(!oldInst.equalsExcludingNullable(newInst)) {
TCast cast = typesRegistry.getCastsResolver().cast(oldInst.typeClass(), newInst.typeClass());
pExp = new TCastExpression(pExp, cast, newInst);
}
projections.add(pExp);
}
}
return new ProjectedTableRowType(newRowType.schema(), newTable, projections, !isGroupChange);