[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-11-09 Thread Timo Walther (Jira)


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

Timo Walther updated FLINK-24691:
-
Release Note: This changes the result of a decimal SUM() between 1.14.0 and 
1.14.1. It restores the behavior of 1.13 to be consistent with Hive/Spark.  
(was: This changes the result of a decimal SUM() between 1.14.0 and 1.14.1. It 
restores the behavior of 1.13.)

> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
>Reporter: Zongwen Li
>Assignee: Marios Trivyzas
>Priority: Critical
>  Labels: pull-request-available
> Fix For: 1.15.0, 1.14.1
>
> Attachments: image-2021-10-29-15-49-14-419.png
>
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates max precision(38) by 
> default, it leads to special circumstances, which reduces the scale by 1.
>   !image-2021-10-29-15-49-14-419.png!



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-11-01 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot updated FLINK-24691:
---
Labels: pull-request-available  (was: )

> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
>Reporter: Zongwen Li
>Assignee: Marios Trivyzas
>Priority: Critical
>  Labels: pull-request-available
> Fix For: 1.15.0, 1.14.1
>
> Attachments: image-2021-10-29-15-49-14-419.png
>
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates max precision(38) by 
> default, it leads to special circumstances, which reduces the scale by 1.
>   !image-2021-10-29-15-49-14-419.png!



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


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-10-31 Thread Kurt Young (Jira)


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

Kurt Young updated FLINK-24691:
---
Priority: Critical  (was: Major)

> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
>Reporter: Zongwen Li
>Assignee: Marios Trivyzas
>Priority: Critical
> Fix For: 1.15.0, 1.14.1
>
> Attachments: image-2021-10-29-15-49-14-419.png
>
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates max precision(38) by 
> default, it leads to special circumstances, which reduces the scale by 1.
>   !image-2021-10-29-15-49-14-419.png!



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


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-10-31 Thread Kurt Young (Jira)


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

Kurt Young updated FLINK-24691:
---
Fix Version/s: 1.14.1
   1.15.0

> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
>Reporter: Zongwen Li
>Assignee: Marios Trivyzas
>Priority: Major
> Fix For: 1.15.0, 1.14.1
>
> Attachments: image-2021-10-29-15-49-14-419.png
>
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates max precision(38) by 
> default, it leads to special circumstances, which reduces the scale by 1.
>   !image-2021-10-29-15-49-14-419.png!



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


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-10-29 Thread Zongwen Li (Jira)


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

Zongwen Li updated FLINK-24691:
---
Description: 
code: 
{code:java}
tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
").print();
{code}
expected:

1.03520274

actual:

1.03520270

 

This function is normal in version 1.13.x.

I found the code that caused the inconsistency:

org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
 method was added in 1.14. Because sum() generates max precision(38) by 
default, it leads to special circumstances, which reduces the scale by 1.

  !image-2021-10-29-15-49-14-419.png!

  was:
code: 
{code:java}
tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
").print();
{code}
expected:

1.03520274

actual:

1.03520270

 

This function is normal in version 1.13.x.

I found the code that caused the inconsistency:

org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
 method was added in 1.14. Because sum() generates max precision(38) by 
default, it leads to special circumstances, which reduces the scale by 1.

 


> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
>Reporter: Zongwen Li
>Assignee: Marios Trivyzas
>Priority: Major
> Attachments: image-2021-10-29-15-49-14-419.png
>
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates max precision(38) by 
> default, it leads to special circumstances, which reduces the scale by 1.
>   !image-2021-10-29-15-49-14-419.png!



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


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-10-29 Thread Zongwen Li (Jira)


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

Zongwen Li updated FLINK-24691:
---
Attachment: image-2021-10-29-15-49-14-419.png

> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
>Reporter: Zongwen Li
>Assignee: Marios Trivyzas
>Priority: Major
> Attachments: image-2021-10-29-15-49-14-419.png
>
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates max precision(38) by 
> default, it leads to special circumstances, which reduces the scale by 1.
>  



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


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-10-29 Thread Zongwen Li (Jira)


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

Zongwen Li updated FLINK-24691:
---
Attachment: image-2021-10-29-15-48-58-563.png

> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
>Reporter: Zongwen Li
>Assignee: Marios Trivyzas
>Priority: Major
> Attachments: image-2021-10-29-15-49-14-419.png
>
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates max precision(38) by 
> default, it leads to special circumstances, which reduces the scale by 1.
>  



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


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-10-29 Thread Zongwen Li (Jira)


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

Zongwen Li updated FLINK-24691:
---
Attachment: (was: image-2021-10-29-15-48-58-563.png)

> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
>Reporter: Zongwen Li
>Assignee: Marios Trivyzas
>Priority: Major
> Attachments: image-2021-10-29-15-49-14-419.png
>
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates max precision(38) by 
> default, it leads to special circumstances, which reduces the scale by 1.
>  



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


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-10-29 Thread Zongwen Li (Jira)


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

Zongwen Li updated FLINK-24691:
---
Description: 
code: 
{code:java}
tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
").print();
{code}
expected:

1.03520274

actual:

1.03520270

 

This function is normal in version 1.13.x.

I found the code that caused the inconsistency:

org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
 method was added in 1.14. Because sum() generates max precision(38) by 
default, it leads to special circumstances, which reduces the scale by 1.

 

  was:
code: 
{code:java}
tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
").print();
{code}
expected:

1.03520274

actual:

1.03520270

 

This function is normal in version 1.13.x.

I found the code that caused the inconsistency:

org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
 method was added in 1.14. Because sum() generates decimal(38,8) by default, it 
leads to special circumstances, which reduces the scale by 1.

 


> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
>Reporter: Zongwen Li
>Assignee: Marios Trivyzas
>Priority: Major
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates max precision(38) by 
> default, it leads to special circumstances, which reduces the scale by 1.
>  



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


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-10-29 Thread Martijn Visser (Jira)


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

Martijn Visser updated FLINK-24691:
---
Environment: (was: flink release-1.14.0)

> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
>Reporter: Zongwen Li
>Priority: Major
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates decimal(38,8) by default, 
> it leads to special circumstances, which reduces the scale by 1.
>  



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


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-10-29 Thread Zongwen Li (Jira)


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

Zongwen Li updated FLINK-24691:
---
Description: 
code: 
{code:java}
tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
").print();
{code}
expected:

1.03520274

actual:

1.03520270

 

This function is normal in version 1.13.x.

I found the code that caused the inconsistency:

org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
 method was added in 1.14. Because sum() generates decimal(38,8) by default, it 
leads to special circumstances, which reduces the scale by 1.

 

  was:
code: 
{code:java}
tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
").print();
{code}
expected:

1.03520274

actual:

1.03520270

 

This function is normal in version 1.13.x.

Because I am not familiar with the SQL API source code, I did not find the root 
error code.

 


> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
> Environment: flink release-1.14.0
>Reporter: Zongwen Li
>Priority: Major
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> I found the code that caused the inconsistency:
> org.apache.flink.table.types.logical.utils.LogicalTypeMerging#adjustPrecisionScale
>  method was added in 1.14. Because sum() generates decimal(38,8) by default, 
> it leads to special circumstances, which reduces the scale by 1.
>  



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


[jira] [Updated] (FLINK-24691) FLINK SQL SUM() causes a precision error

2021-10-29 Thread Zongwen Li (Jira)


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

Zongwen Li updated FLINK-24691:
---
Description: 
code: 
{code:java}
tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
").print();
{code}
expected:

1.03520274

actual:

1.03520270

 

This function is normal in version 1.13.x.

Because I am not familiar with the SQL API source code, I did not find the root 
error code.

 

  was:
code: 
{code:java}
tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
").print();
{code}
expected:

1.03520274

actual:

1.03520270

 

 This function is normal in version 1.13.x.

 


> FLINK SQL SUM() causes a precision error
> 
>
> Key: FLINK-24691
> URL: https://issues.apache.org/jira/browse/FLINK-24691
> Project: Flink
>  Issue Type: Bug
>  Components: Table SQL / Runtime
>Affects Versions: 1.14.0
> Environment: flink release-1.14.0
>Reporter: Zongwen Li
>Priority: Major
>
> code: 
> {code:java}
> tableEnv.executeSql("select sum(cast( 1.03520274 as decimal(32, 8))) as num 
> ").print();
> {code}
> expected:
> 1.03520274
> actual:
> 1.03520270
>  
> This function is normal in version 1.13.x.
> Because I am not familiar with the SQL API source code, I did not find the 
> root error code.
>  



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