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

feiwang updated SPARK-30471:
----------------------------
    Description: 
When we comparing a String Type and IntegerType:
'2147483648'(StringType, which exceed Int.MaxValue) > 0(IntegerType).

Now the result of findCommonTypeForBinaryComparison(StringType, IntegerType) is 
IntegerType.

But the value of string may exceed Int.MaxValue, then the result is corruputed.


For example:
{code:java}
// Some comments here
 CREATE TEMPORARY VIEW ta AS SELECT * FROM VALUES(CAST ('2147483648' AS 
STRING))  AS ta(id);
SELECT * FROM ta WHERE id > 0;
{code}


> Fix issue when compare string and IntegerType
> ---------------------------------------------
>
>                 Key: SPARK-30471
>                 URL: https://issues.apache.org/jira/browse/SPARK-30471
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: feiwang
>            Priority: Major
>
> When we comparing a String Type and IntegerType:
> '2147483648'(StringType, which exceed Int.MaxValue) > 0(IntegerType).
> Now the result of findCommonTypeForBinaryComparison(StringType, IntegerType) 
> is IntegerType.
> But the value of string may exceed Int.MaxValue, then the result is 
> corruputed.
> For example:
> {code:java}
> // Some comments here
>  CREATE TEMPORARY VIEW ta AS SELECT * FROM VALUES(CAST ('2147483648' AS 
> STRING))  AS ta(id);
> SELECT * FROM ta WHERE id > 0;
> {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

Reply via email to