simenliuxing commented on a change in pull request #18414:
URL: https://github.com/apache/flink/pull/18414#discussion_r789333463



##########
File path: docs/content.zh/docs/dev/table/sql/queries/window-agg.md
##########
@@ -199,7 +199,7 @@ The following shows a cascading window aggregation where 
the first window aggreg
 ```sql
 -- tumbling 5 minutes for each supplier_id
 CREATE VIEW window1 AS
-SELECT window_start, window_end, window_time as rowtime, SUM(price) as 
partial_price
+SELECT window_start as window1_start, window_end as window1_end, window_time 
as rowtime, SUM(price) as partial_price

Review comment:
       When i use sql as below:
   ```
   -- tumbling 5 minutes for each supplier_id
   CREATE VIEW window1 AS
   SELECT window_start as window1_start, window_end as window1_end, window_time 
as rowtime, SUM(price) as partial_price
     FROM TABLE(
       TUMBLE(TABLE Bid, DESCRIPTOR(bidtime), INTERVAL '5' MINUTES))
     GROUP BY supplier_id, window_start, window_end, window_time;
   
   -- tumbling 10 minutes on the first window
   SELECT window_start, window_end, SUM(partial_price) as total_price
     FROM TABLE(
         TUMBLE(TABLE window1, DESCRIPTOR(rowtime), INTERVAL '10' MINUTES))
     GROUP BY window_start, window_end;
   ```
    The following exception occurs:
    ```
   Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Column 
'window_start' is ambiguous
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
       at 
org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:467)
       at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:560)
       ... 41 more
   ```
   I think the following piece of sql cannot identify whether window_start is 
from window1 or from built-in.
   But the following sql is for Group Window Aggregation, the required 
window_start and window_end are not from window1, So I renamed window_start and 
window_end in the above sql.
   




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to