code: RelDataType getTableConstructorRowType(
  		SqlCall values,
  		SqlValidatorScope scope) {
  		final List<SqlNode> rows = values.getOperandList();
  		assert rows.size() >= 1;
  		final List<RelDataType> rowTypes = new ArrayList<>();
  		for (final SqlNode row : rows) {
  			assert row.getKind() == SqlKind.ROW;
  			SqlCall rowConstructor = (SqlCall) row;
  
  			// REVIEW jvs 10-Sept-2003: Once we support single-row queries as
  			// rows, need to infer aliases from there.
  			final List<String> aliasList = new ArrayList<>();
  			final List<RelDataType> typeList = new ArrayList<>();
  			for (Ord<SqlNode> column : Ord.zip(rowConstructor.getOperandList())) {
  				final String alias = deriveAlias(column.e, column.i);
  				aliasList.add(alias);
  				final RelDataType type = deriveType(scope, column.e);
  				typeList.add(type);
  			}
  			rowTypes.add(typeFactory.createStructType(typeList, aliasList));
  		}
  		if (rows.size() == 1) {
  			// TODO jvs 10-Oct-2005:  get rid of this workaround once
  			// leastRestrictive can handle all cases
  			return rowTypes.get(0);
  		}
  		return typeFactory.leastRestrictive(rowTypes);
  	}
docs: Returns null if there is no common type. E.g. if the rows have a
  different number of columns.