Map<String, ColumnVar> selectVars = new HashMap<String, ColumnVar>();
for (ColumnVar var : vars) {
if (var.isHidden())
continue;
if (selectVars.containsKey(var.getName())) {
ValueTypes types = selectVars.get(var.getName()).getTypes();
types = types.clone().merge(var.getTypes());
selectVars.get(var.getName()).setTypes(types);
}
else {
String name = var.getAlias() + var.getColumn();
ColumnVar as = var.as(getAlias(), name);