[jira] [Created] (FLINK-23026) OVER WINDOWS function lost data

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-23026) OVER WINDOWS function lost data

Shang Yuanchun (Jira)
MOBIN created FLINK-23026:
-----------------------------

             Summary: OVER WINDOWS function lost data
                 Key: FLINK-23026
                 URL: https://issues.apache.org/jira/browse/FLINK-23026
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / API, Table SQL / Client
    Affects Versions: 1.12.1
            Reporter: MOBIN
         Attachments: image-2021-06-18-10-54-18-125.png

{code:java}
Flink SQL> CREATE TABLE tmall_item(

>   itemID VARCHAR,
>   itemType VARCHAR,
>   eventtime varchar,
>   onSellTime AS TO_TIMESTAMP(eventtime),
>   price DOUBLE,
>   WATERMARK FOR onSellTime AS onSellTime - INTERVAL '0' SECOND
> ) with (
>   'connector.type' = 'kafka',
>    'connector.version' = 'universal',
>    'connector.topic' = 'items',
>    'format.type' = 'csv',
>    'connector.properties.bootstrap.servers' = 'localhost:9092'
> );
>
[INFO] Table has been created.

Flink SQL> SELECT
>     itemType,
>     COUNT(itemID) OVER (
>         PARTITION BY itemType
>         ORDER BY onSellTime
>         RANGE BETWEEN INTERVAL '1' DAY preceding AND CURRENT ROW) AS cot
> FROM tmall_item;
{code}

When I enter the following data into the topic, its Electronic count value is 3, which should normally be 4. If the event time and the value of the partition field are the same, data will be lost

ITEM001,Electronic,2017-11-11 10:01:00,20
{color:red}ITEM002{color},Electronic,{color:red}2017-11-11 10:02:00{color},50
{color:red}ITEM002{color},Electronic,{color:red}2017-11-11 10:02:00{color},50
ITEM003,Electronic,2017-11-11 10:03:00,50

!image-2021-06-18-10-54-18-125.png|width=1066,height=177!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)