}
@Override protected RelDataType validateImpl() {
final SqlValidatorNamespace childNs =
validator.getNamespace(withItem.query);
final RelDataType rowType = childNs.getRowTypeSansSystemColumns();
if (withItem.columnList == null) {
return rowType;
}
final RelDataTypeFactory.FieldInfoBuilder builder =
validator.getTypeFactory().builder();
for (Pair<SqlNode, RelDataTypeField> pair
: Pair.zip(withItem.columnList, rowType.getFieldList())) {
builder.add(((SqlIdentifier) pair.left).getSimple(),
pair.right.getType());
}
return builder.build();
}