[jira] [Updated] (FLINK-22853) Flink SQL functions max/min/sum return duplicated records

2021-06-06 Thread Jark Wu (Jira)


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

Jark Wu updated FLINK-22853:

Component/s: Connectors / JDBC

> Flink SQL functions max/min/sum return duplicated records
> -
>
> Key: FLINK-22853
> URL: https://issues.apache.org/jira/browse/FLINK-22853
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / JDBC, Table SQL / API
>Affects Versions: 1.12.1
>Reporter: Raypon Wang
>Priority: Major
> Attachments: image-2021-06-07-11-00-05-608.png, 
> image-2021-06-07-11-00-49-109.png, image-2021-06-07-11-01-02-389.png
>
>
> mysql data:
> id    offset
> 1      1
> 1      3
> 1      2
> flinksql code:(I used flink-connector-jdbc_2.12:1.12.1)
>  
>  
> object FlinkSqlOnJdbcForMysql {
>  def main(args: Array[String]): Unit = {
> val settings = 
> EnvironmentSettings.newInstance().useBlinkPlanner().inBatchMode().build()
>  val tableEnvironment = TableEnvironment.create(settings)
> tableEnvironment.executeSql("" +
>  "CREATE TABLE test (" +
>  " id BIGINT," +
>  " `offset` INT," +
>  " PRIMARY KEY (id) NOT ENFORCED" +
>  ") WITH (" +
>  " 'connector' = 'jdbc'," +
>  " 'driver' = 'com.mysql.cj.jdbc.Driver'," +
>  " 'url' = 'jdbc:mysql://127.0.0.1:3306/test?=Asia/Shanghai'," 
> +
>  " 'username' = 'root'," +
>  " 'password' = 'Project.03'," +
>  " 'table-name' = 'test'," +
>  " 'scan.fetch-size' = '1000'," +
>  " 'scan.auto-commit' = 'true'" +
>  ")")
> tableEnvironment.executeSql(
>  "select id,max(`offset`) from test group by id").print()
>  }
> }
>  
> result:
> +---++
> |id|EXPR$1|
> +---++
> |1|1|
> |1|3|
> |1|2|
> +---++
> Result of max/min/sum is duplicated,
> but avg/count/last_value/first_value is ok.
>  
>  
>  
>  



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


[jira] [Updated] (FLINK-22853) Flink SQL functions max/min/sum return duplicated records

2021-06-06 Thread Raypon Wang (Jira)


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

Raypon Wang updated FLINK-22853:

Attachment: image-2021-06-07-11-00-05-608.png

> Flink SQL functions max/min/sum return duplicated records
> -
>
> Key: FLINK-22853
> URL: https://issues.apache.org/jira/browse/FLINK-22853
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / API
>Affects Versions: 1.12.1
>Reporter: Raypon Wang
>Priority: Major
> Attachments: image-2021-06-07-11-00-05-608.png
>
>
> mysql data:
> id    offset
> 1      1
> 1      3
> 1      2
> flinksql code:(I used flink-connector-jdbc_2.12:1.12.1)
>  
>  
> object FlinkSqlOnJdbcForMysql {
>  def main(args: Array[String]): Unit = {
> val settings = 
> EnvironmentSettings.newInstance().useBlinkPlanner().inBatchMode().build()
>  val tableEnvironment = TableEnvironment.create(settings)
> tableEnvironment.executeSql("" +
>  "CREATE TABLE test (" +
>  " id BIGINT," +
>  " `offset` INT," +
>  " PRIMARY KEY (id) NOT ENFORCED" +
>  ") WITH (" +
>  " 'connector' = 'jdbc'," +
>  " 'driver' = 'com.mysql.cj.jdbc.Driver'," +
>  " 'url' = 'jdbc:mysql://127.0.0.1:3306/test?=Asia/Shanghai'," 
> +
>  " 'username' = 'root'," +
>  " 'password' = 'Project.03'," +
>  " 'table-name' = 'test'," +
>  " 'scan.fetch-size' = '1000'," +
>  " 'scan.auto-commit' = 'true'" +
>  ")")
> tableEnvironment.executeSql(
>  "select id,max(`offset`) from test group by id").print()
>  }
> }
>  
> result:
> +---++
> |id|EXPR$1|
> +---++
> |1|1|
> |1|3|
> |1|2|
> +---++
> Result of max/min/sum is duplicated,
> but avg/count/last_value/first_value is ok.
>  
>  
>  
>  



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


[jira] [Updated] (FLINK-22853) Flink SQL functions max/min/sum return duplicated records

2021-06-02 Thread Leonard Xu (Jira)


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

Leonard Xu updated FLINK-22853:
---
Summary: Flink SQL functions max/min/sum return duplicated records  (was: 
FLinkSql functions max/min/sum returns duplicated record)

> Flink SQL functions max/min/sum return duplicated records
> -
>
> Key: FLINK-22853
> URL: https://issues.apache.org/jira/browse/FLINK-22853
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / API
>Affects Versions: 1.12.1
>Reporter: Raypon Wang
>Priority: Major
>
> mysql data:
> id    offset
> 1      1
> 1      3
> 1      2
> flinksql code:(I used flink-connector-jdbc_2.12:1.12.1)
>  
>  
> object FlinkSqlOnJdbcForMysql {
>  def main(args: Array[String]): Unit = {
> val settings = 
> EnvironmentSettings.newInstance().useBlinkPlanner().inBatchMode().build()
>  val tableEnvironment = TableEnvironment.create(settings)
> tableEnvironment.executeSql("" +
>  "CREATE TABLE test (" +
>  " id BIGINT," +
>  " `offset` INT," +
>  " PRIMARY KEY (id) NOT ENFORCED" +
>  ") WITH (" +
>  " 'connector' = 'jdbc'," +
>  " 'driver' = 'com.mysql.cj.jdbc.Driver'," +
>  " 'url' = 'jdbc:mysql://127.0.0.1:3306/test?=Asia/Shanghai'," 
> +
>  " 'username' = 'root'," +
>  " 'password' = 'Project.03'," +
>  " 'table-name' = 'test'," +
>  " 'scan.fetch-size' = '1000'," +
>  " 'scan.auto-commit' = 'true'" +
>  ")")
> tableEnvironment.executeSql(
>  "select id,max(`offset`) from test group by id").print()
>  }
> }
>  
> result:
> +---++
> |id|EXPR$1|
> +---++
> |1|1|
> |1|3|
> |1|2|
> +---++
> Result of max/min/sum is duplicated,
> but avg/count/last_value/first_value is ok.
>  
>  
>  
>  



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