Details
-
Bug
-
Status: In Progress
-
Major
-
Resolution: Unresolved
-
3.0.0
-
None
-
None
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:
// Some comments here CREATE TEMPORARY VIEW ta AS SELECT * FROM VALUES(CAST ('2147483648' AS STRING)) AS ta(id); SELECT * FROM ta WHERE id > 0; // result is null
Attachments
Issue Links
- duplicates
-
SPARK-21646 Add new type coercion rules to compatible with Hive
- Resolved
- is duplicated by
-
SPARK-31508 string type compare with numberic cause data inaccurate
- Resolved
- links to