NobiGo commented on code in PR #3328:
URL: https://github.com/apache/calcite/pull/3328#discussion_r1292894923


##########
core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml:
##########
@@ -4203,6 +4203,22 @@ LogicalProject($0=[$3], $1=[$4])
       <![CDATA[
 LogicalProject(SUM1=[SUM($7) OVER (PARTITION BY $7 ORDER BY $5)], 
SUM2=[SUM(+($7, $5)) OVER (PARTITION BY $7 ORDER BY $5)])
   LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testExpressionPreceding">
+    <Resource name="sql">
+      <![CDATA[select COUNT(*) over (
+ORDER BY empno
+ROWS BETWEEN 5 + 5 PRECEDING AND 1 PRECEDING) AS w_count from emp
+]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject($0=[$1])
+  LogicalWindow(window#0=[window(order by [0] rows between $1 PRECEDING and $2 
PRECEDING aggs [COUNT()])])

Review Comment:
   It looks like we miss something in the plan. In general, we can extract the 
original SQL from the plan. But in this plan, we don't know the $1 and $2 
values. We should create a new ISSUE to improve it? @mihaibudiu @asolimando 



-- 
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]

Reply via email to