snuyanzin commented on code in PR #28227:
URL: https://github.com/apache/flink/pull/28227#discussion_r3286914754
##########
flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -5908,16 +5910,22 @@ public void validateMatchRecognize(SqlCall call) {
private PairList<String, RelDataType> validateMeasure(
SqlMatchRecognize mr, MatchRecognizeScope scope, boolean allRows) {
- final List<String> aliases = new ArrayList<>();
+ // FLINK MODIFICATION BEGIN
+ final Set<String> aliases = new HashSet<>();
final List<SqlNode> sqlNodes = new ArrayList<>();
final SqlNodeList measures = mr.getMeasureList();
final PairList<String, RelDataType> fields = PairList.of();
for (SqlNode measure : measures) {
assert measure instanceof SqlCall;
final String alias = SqlValidatorUtil.alias(measure,
aliases.size());
- aliases.add(alias);
-
+ if (!aliases.add(alias)) {
Review Comment:
port from
https://github.com/apache/calcite/commit/16c2b1c3469f504bc540c9f12438778e2ca7b2d7
Porting of `CalciteResource` is overkill, so for now just hardcoded message
in exception.
Will be replaced with Calcite upgrade
--
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]