snuyanzin commented on code in PR #4879:
URL: https://github.com/apache/calcite/pull/4879#discussion_r3068456011
##########
core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java:
##########
@@ -2482,20 +2482,27 @@ void testLikeAndSimilarFails() {
sql(sql).fails("DISTINCT/ALL not allowed with "
+ "COUNT\\(DISTINCT `A`\\.`DEPTNO`\\) function");
- sql("SELECT *\n"
+ final String simpleMatchRecognize = "SELECT *\n"
+ "FROM emp\n"
+ "MATCH_RECOGNIZE (\n"
+ " MEASURES\n"
+ " FINAL COUNT(A.deptno) AS deptno\n"
+ " PATTERN (A B)\n"
+ " DEFINE\n"
+ " A AS A.empno = 123\n"
- + ") AS T")
- .rewritesTo("SELECT *\n"
- + "FROM `EMP` MATCH_RECOGNIZE(\n"
- + "MEASURES FINAL COUNT(`A`.`DEPTNO`) AS `DEPTNO`\n"
- + "PATTERN (`A` `B`)\n"
- + "DEFINE `A` AS (PREV(`A`.`EMPNO`, 0) = 123 AS `A`)) AS `T`");
Review Comment:
this part is invalid
```sql
DEFINE `A` AS (PREV(`A`.`EMPNO`, 0) = 123 AS `A`)
```
since it contains 2 `AS` operators and Calcite is unable to parse it one
more time
--
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]