[ 
https://issues.apache.org/jira/browse/FLINK-27969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17842051#comment-17842051
 ] 

Martijn Visser commented on FLINK-27969:
----------------------------------------

A relatively simple reproducer:
{code:sql}
CREATE OR REPLACE TABLE orders (
    order_number BIGINT,
    product_id   STRING,    
    price        DECIMAL(32,2),
    order_time   TIMESTAMP(3),
    WATERMARK for order_time AS order_time
) WITH (
  'connector' = 'datagen'
);
{code}
{code:sql}
CREATE OR REPLACE TABLE shipments (
    shipment_id BIGINT,
    order_number BIGINT,  
    product_id   STRING,
    shipment_time TIMESTAMP(3),
    WATERMARK FOR shipment_time AS shipment_time
) WITH (
    'connector' = 'datagen'
);
{code}
{code:sql}
WITH deduplicated AS (
        SELECT *, SUM(price)
        FROM (
          SELECT *,
            ROW_NUMBER() OVER (PARTITION BY order_number ORDER BY order_time 
ASC) AS row_num
          FROM orders)
        WHERE row_num = 1
        GROUP BY order_number, product_id, price, order_time, row_num
)
SELECT order_number, order_time, price,
  SUM(price) OVER (
    PARTITION BY product_id
    ORDER BY order_time
    RANGE BETWEEN INTERVAL '1' HOUR PRECEDING AND CURRENT ROW
  ) AS one_hour_prod_amount_sum
FROM deduplicated;
{code}
Error:
{code:java}
org.apache.flink.table.api.TableException: StreamPhysicalOverAggregate doesn't 
support consuming update and delete changes which is produced by node 
GroupAggregate(groupBy=[order_number, product_id, price, order_time, w0$o0], 
select=[order_number, product_id, price, order_time, w0$o0]) {code}

> StreamPhysicalOverAggregate doesn't support consuming update and delete 
> changes
> -------------------------------------------------------------------------------
>
>                 Key: FLINK-27969
>                 URL: https://issues.apache.org/jira/browse/FLINK-27969
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 1.14.3
>            Reporter: Spongebob
>            Priority: Major
>
> Exception trace:
> {code:java}
> // exception
> StreamPhysicalOverAggregate doesn't support consuming update and delete 
> changes which is produced by node Join(joinType=[LeftOuterJoin], where=[(COL2 
> = COL4)], select=[...], leftInputSpec=[NoUniqueKey], 
> rightInputSpec=[NoUniqueKey]) {code}
> FlinkSQL that scheduled as streaming table like this:
> {code:java}
> // dml
> SELECT RANK() OVER (PARTITION BY A.COL1 ORDER BY A.COL2) AS ODER_ONUM
> FROM A
> INNER JOIN B ON A.COL1 = B.COL1
> LEFT JOIN C ON C.COL3 = 1 AND CAST(A.COL2 AS STRING) = C.COL4{code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to