[ 
https://issues.apache.org/jira/browse/FLINK-23026?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

MOBIN updated FLINK-23026:
--------------------------
    Description: 
{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:#ff0000}ITEM002{color},Electronic,{color:#ff0000}2017-11-11 
10:02:00{color},50
 {color:#ff0000}ITEM002{color},Electronic,{color:#ff0000}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=963,height=160!

  was:
{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:#FF0000}ITEM002{color},Electronic,{color:#FF0000}2017-11-11 
10:02:00{color},50
 {color:#FF0000}ITEM002{color},Electronic,{color:#FF0000}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=656,height=109!


> 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
>            Priority: Critical
>         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:#ff0000}ITEM002{color},Electronic,{color:#ff0000}2017-11-11 
> 10:02:00{color},50
>  {color:#ff0000}ITEM002{color},Electronic,{color:#ff0000}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=963,height=160!



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

Reply via email to