dssysolyatin commented on code in PR #4746:
URL: https://github.com/apache/calcite/pull/4746#discussion_r2692260294
##########
core/src/main/java/org/apache/calcite/sql/SqlWindowTableFunction.java:
##########
@@ -233,6 +233,12 @@ boolean checkIntervalOperands(SqlCallBinding callBinding,
int startPos) {
void validateColumnNames(SqlValidator validator,
List<String> fieldNames, List<SqlNode> columnNames) {
final SqlNameMatcher matcher =
validator.getCatalogReader().nameMatcher();
+ for (SqlNode name : columnNames) {
Review Comment:
Also, can we put this in a single loop?
```
Ord.forEach(columnNames, (name, i) -> {
if (!(name instanceof SqlIdentifier)) {
throw SqlUtil.newContextException(name.getParserPosition(),
RESOURCE.descriptorMustBeIdentifier());
}
String simpleName = ((SqlIdentifier) name).getSimple();
if (matcher.indexOf(fieldNames, simpleName) < 0) {
final SqlIdentifier columnName = (SqlIdentifier)
columnNames.get(i);
throw SqlUtil.newContextException(columnName.getParserPosition(),
RESOURCE.unknownIdentifier(simpleName));
}
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]