[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nicholas Chammas updated SPARK-28024: - Description: Spark on {{master}} at commit {{de00ac8a05aedb3a150c8c10f76d1fe5496b1df3}} with {{set spark.sql.ansi.enabled=true;}} as compared to the default behavior on PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} With ANSI mode enabled, this case is no longer an issue. All 4 of the above statements now yield {{CAST_OVERFLOW}} or {{ARITHMETIC_OVERFLOW}} errors. Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(1.2345678901234E200); ERROR: value overflows numeric format {code} was: Spark on {{master}} at commit {{de00ac8a05aedb3a150c8c10f76d1fe5496b1df3}} with {{set spark.sql.ansi.enabled=true;}} as compared to the default behavior on PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} With ANSI mode enabled, this case is no longer an issue. All 4 of the above statements now yield {{CAST_OVERFLOW or }}{{ARITHMETIC_OVERFLOW}} errors. Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(1.2345678901234E200); ERROR: value overflows numeric format {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.4, 3.0.0 >Reporter: Yuming Wang >Priority: Major > Labels: correctness > Attachments: SPARK-28024.png > > > Spark on {{master}} at commit {{de00ac8a05aedb3a150c8c10f76d1fe5496b1df3}} > with {{set spark.sql.ansi.enabled=true;}} as compared to the default behavior > on PostgreSQL 16. > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > With ANSI mode enabled, this case is no longer an issue. All 4 of the above > statements now yield {{CAST_OVERFLOW}} or {{ARITHMETIC_OVERFLOW}} errors. > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > postgres=# select cast('10e-70' as float), cast('-10e-70' as float); > float8 | float8 > + > 1e-69 | -1e-69 {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > postgres=# select cast('10e-400' as double precision), cast('-10e-400' as > double precision); > ERROR: "10e-400" is out of range for type double precision > LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... > ^ {code} > Case 4: > {code:sql} > spark-sql (default)> select exp(1.2345678901234E200); > Infinity > postgres=# select exp(1.2345678901234E200); > ERROR: value overflows numeric format {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nicholas Chammas updated SPARK-28024: - Description: Spark on {{master}} at commit {{de00ac8a05aedb3a150c8c10f76d1fe5496b1df3}} with {{set spark.sql.ansi.enabled=true;}} as compared to the default behavior on PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} With ANSI mode enabled, this case is no longer an issue. All 4 of the above statements now yield {{CAST_OVERFLOW or }}{{ARITHMETIC_OVERFLOW}} errors. Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(1.2345678901234E200); ERROR: value overflows numeric format {code} was: As compared to PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(1.2345678901234E200); ERROR: value overflows numeric format {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.4, 3.0.0 >Reporter: Yuming Wang >Priority: Major > Labels: correctness > Attachments: SPARK-28024.png > > > Spark on {{master}} at commit {{de00ac8a05aedb3a150c8c10f76d1fe5496b1df3}} > with {{set spark.sql.ansi.enabled=true;}} as compared to the default behavior > on PostgreSQL 16. > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > With ANSI mode enabled, this case is no longer an issue. All 4 of the above > statements now yield {{CAST_OVERFLOW or }}{{ARITHMETIC_OVERFLOW}} errors. > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > postgres=# select cast('10e-70' as float), cast('-10e-70' as float); > float8 | float8 > + > 1e-69 | -1e-69 {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > postgres=# select cast('10e-400' as double precision), cast('-10e-400' as > double precision); > ERROR: "10e-400" is out of range for type double precision > LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... > ^ {code} > Case 4: > {code:sql} > spark-sql (default)> select exp(1.2345678901234E200); > Infinity > postgres=# select exp(1.2345678901234E200); > ERROR: value overflows numeric format {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nicholas Chammas updated SPARK-28024: - Description: As compared to PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(1.2345678901234E200); ERROR: value overflows numeric format {code} was: As compared to PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(-1.2345678901234E200); ERROR: value overflows numeric format {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.4, 3.0.0 >Reporter: Yuming Wang >Priority: Major > Labels: correctness > Attachments: SPARK-28024.png > > > As compared to PostgreSQL 16. > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > postgres=# select cast('10e-70' as float), cast('-10e-70' as float); > float8 | float8 > + > 1e-69 | -1e-69 {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > postgres=# select cast('10e-400' as double precision), cast('-10e-400' as > double precision); > ERROR: "10e-400" is out of range for type double precision > LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... > ^ {code} > Case 4: > {code:sql} > spark-sql (default)> select exp(1.2345678901234E200); > Infinity > postgres=# select exp(1.2345678901234E200); > ERROR: value overflows numeric format {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nicholas Chammas updated SPARK-28024: - Description: As compared to PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(-1.2345678901234E200); ERROR: value overflows numeric format {code} was: As compared to PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(-1.2345678901234E200); ERROR: value overflows numeric format {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.4, 3.0.0 >Reporter: Yuming Wang >Priority: Major > Labels: correctness > Attachments: SPARK-28024.png > > > As compared to PostgreSQL 16. > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > postgres=# select cast('10e-70' as float), cast('-10e-70' as float); > float8 | float8 > + > 1e-69 | -1e-69 {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > postgres=# select cast('10e-400' as double precision), cast('-10e-400' as > double precision); > ERROR: "10e-400" is out of range for type double precision > LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... > ^ {code} > Case 4: > {code:sql} > spark-sql (default)> select exp(1.2345678901234E200); > Infinity > postgres=# select exp(-1.2345678901234E200); > ERROR: value overflows numeric format > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nicholas Chammas updated SPARK-28024: - Description: As compared to PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(-1.2345678901234E200); ERROR: value overflows numeric format {code} was: As compared to PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(1.2345678901234E200); ERROR: value overflows numeric format {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.4, 3.0.0 >Reporter: Yuming Wang >Priority: Major > Labels: correctness > Attachments: SPARK-28024.png > > > As compared to PostgreSQL 16. > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > postgres=# select cast('10e-70' as float), cast('-10e-70' as float); > float8 | float8 > + > 1e-69 | -1e-69 {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > postgres=# select cast('10e-400' as double precision), cast('-10e-400' as > double precision); > ERROR: "10e-400" is out of range for type double precision > LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... > ^ {code} > Case 4: > {code:sql} > spark-sql (default)> select exp(1.2345678901234E200); > Infinity > postgres=# select exp(-1.2345678901234E200); > ERROR: value overflows numeric format > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nicholas Chammas updated SPARK-28024: - Description: As compared to PostgreSQL 16. Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 postgres=# select cast('10e-70' as float), cast('-10e-70' as float); float8 | float8 + 1e-69 | -1e-69 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 postgres=# select cast('10e-400' as double precision), cast('-10e-400' as double precision); ERROR: "10e-400" is out of range for type double precision LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... ^ {code} Case 4: {code:sql} spark-sql (default)> select exp(1.2345678901234E200); Infinity postgres=# select exp(1.2345678901234E200); ERROR: value overflows numeric format {code} was: For example Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 {code} Case 4: {code:sql} spark-sql> select exp(-1.2345678901234E200); 0.0 postgres=# select exp(-1.2345678901234E200); ERROR: value overflows numeric format {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.4, 3.0.0 >Reporter: Yuming Wang >Priority: Major > Labels: correctness > Attachments: SPARK-28024.png > > > As compared to PostgreSQL 16. > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > postgres=# select cast('10e-70' as float), cast('-10e-70' as float); > float8 | float8 > + > 1e-69 | -1e-69 {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > postgres=# select cast('10e-400' as double precision), cast('-10e-400' as > double precision); > ERROR: "10e-400" is out of range for type double precision > LINE 1: select cast('10e-400' as double precision), cast('-10e-400' ... > ^ {code} > Case 4: > {code:sql} > spark-sql (default)> select exp(1.2345678901234E200); > Infinity > postgres=# select exp(1.2345678901234E200); > ERROR: value overflows numeric format {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Wenchen Fan updated SPARK-28024: Priority: Major (was: Blocker) > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.4, 3.0.0 >Reporter: Yuming Wang >Priority: Major > Labels: correctness > Attachments: SPARK-28024.png > > > For example > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > {code} > Case 4: > {code:sql} > spark-sql> select exp(-1.2345678901234E200); > 0.0 > postgres=# select exp(-1.2345678901234E200); > ERROR: value overflows numeric format > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dongjoon Hyun updated SPARK-28024: -- Priority: Blocker (was: Critical) > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.4, 3.0.0 >Reporter: Yuming Wang >Priority: Blocker > Labels: correctness > Attachments: SPARK-28024.png > > > For example > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > {code} > Case 4: > {code:sql} > spark-sql> select exp(-1.2345678901234E200); > 0.0 > postgres=# select exp(-1.2345678901234E200); > ERROR: value overflows numeric format > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dongjoon Hyun updated SPARK-28024: -- Affects Version/s: 2.0.2 2.1.3 > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.4, 3.0.0 >Reporter: Yuming Wang >Priority: Critical > Labels: correctness > Attachments: SPARK-28024.png > > > For example > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > {code} > Case 4: > {code:sql} > spark-sql> select exp(-1.2345678901234E200); > 0.0 > postgres=# select exp(-1.2345678901234E200); > ERROR: value overflows numeric format > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dongjoon Hyun updated SPARK-28024: -- Affects Version/s: 2.2.3 2.3.4 2.4.4 > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 2.2.3, 2.3.4, 2.4.4, 3.0.0 >Reporter: Yuming Wang >Priority: Critical > Labels: correctness > Attachments: SPARK-28024.png > > > For example > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > {code} > Case 4: > {code:sql} > spark-sql> select exp(-1.2345678901234E200); > 0.0 > postgres=# select exp(-1.2345678901234E200); > ERROR: value overflows numeric format > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yuming Wang updated SPARK-28024: Description: For example Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 {code} Case 4: {code:sql} spark-sql> select exp(-1.2345678901234E200); 0.0 postgres=# select exp(-1.2345678901234E200); ERROR: value overflows numeric format {code} was: For example Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 3.0.0 >Reporter: Yuming Wang >Priority: Critical > Labels: correctness > Attachments: SPARK-28024.png > > > For example > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > {code} > Case 4: > {code:sql} > spark-sql> select exp(-1.2345678901234E200); > 0.0 > postgres=# select exp(-1.2345678901234E200); > ERROR: value overflows numeric format > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yuming Wang updated SPARK-28024: Description: For example Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 {code} Case 3: {code:sql} spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); 0.0 -0.0 {code} was: For example Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 3.0.0 >Reporter: Yuming Wang >Priority: Critical > Labels: correctness > Attachments: SPARK-28024.png > > > For example > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > {code} > Case 3: > {code:sql} > spark-sql> select cast('10e-400' as double), cast('-10e-400' as double); > 0.0 -0.0 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yuming Wang updated SPARK-28024: Description: For example Case 1: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} Case 2: {code:sql} spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); 0.0 -0.0 {code} was: For example: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 3.0.0 >Reporter: Yuming Wang >Priority: Critical > Labels: correctness > Attachments: SPARK-28024.png > > > For example > Case 1: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} > Case 2: > {code:sql} > spark-sql> select cast('10e-70' as float), cast('-10e-70' as float); > 0.0 -0.0 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xiao Li updated SPARK-28024: Priority: Critical (was: Major) > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 3.0.0 >Reporter: Yuming Wang >Priority: Critical > Labels: correctness > Attachments: SPARK-28024.png > > > For example: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xiao Li updated SPARK-28024: Labels: correctness (was: ) > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 3.0.0 >Reporter: Yuming Wang >Priority: Major > Labels: correctness > Attachments: SPARK-28024.png > > > For example: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xiao Li updated SPARK-28024: Target Version/s: 3.0.0 > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 3.0.0 >Reporter: Yuming Wang >Priority: Critical > Labels: correctness > Attachments: SPARK-28024.png > > > For example: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yuming Wang updated SPARK-28024: Attachment: SPARK-28024.png > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 3.0.0 >Reporter: Yuming Wang >Priority: Major > Attachments: SPARK-28024.png > > > For example: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yuming Wang updated SPARK-28024: Description: For example: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); -- -32768 {code} was: For example: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 3.0.0 >Reporter: Yuming Wang >Priority: Major > > For example: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); -- -32768 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yuming Wang updated SPARK-28024: Description: For example: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 SELECT smallint((-32768)) * smallint(-1); {code} was: For example: {code:sql} select tinyint(128) * tinyint(2); -- 0 select smallint(2147483647) * smallint(2); -- -2 select int(2147483647) * int(2); -- -2 {code} > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 3.0.0 >Reporter: Yuming Wang >Priority: Major > > For example: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > SELECT smallint((-32768)) * smallint(-1); > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Updated] (SPARK-28024) Incorrect numeric values when out of range
[ https://issues.apache.org/jira/browse/SPARK-28024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yuming Wang updated SPARK-28024: Summary: Incorrect numeric values when out of range (was: Incorrect value when out of range) > Incorrect numeric values when out of range > -- > > Key: SPARK-28024 > URL: https://issues.apache.org/jira/browse/SPARK-28024 > Project: Spark > Issue Type: Bug > Components: SQL >Affects Versions: 3.0.0 >Reporter: Yuming Wang >Priority: Major > > For example: > {code:sql} > select tinyint(128) * tinyint(2); -- 0 > select smallint(2147483647) * smallint(2); -- -2 > select int(2147483647) * int(2); -- -2 > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org