You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "philipse (Jira)" <ji...@apache.org> on 2020/04/21 10:57:00 UTC
[jira] [Created] (SPARK-31508) string type compare with numberic
case data inaccurate
philipse created SPARK-31508:
--------------------------------
Summary: string type compare with numberic case data inaccurate
Key: SPARK-31508
URL: https://issues.apache.org/jira/browse/SPARK-31508
Project: Spark
Issue Type: Bug
Components: SQL
Affects Versions: 2.4.5
Environment: hadoop2.7
spark2.4.5
Reporter: philipse
Hi all
Sparksql may should convert values to double if string type compare with number type.the cases shows as below
1, create table
create table test1(id string);
2,insert data into table
insert into test1 select 'avc';
insert into test1 select '2';
insert into test1 select '0a';
insert into test1 select '1111111111111111';
insert into test1 select '22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222';
3.Let's check what's happening
select * from test_gf13871.test1 where id > 0
the results shows below
*2*
*11111111*
Really amazing,the big number 222...cannot be selected.
while when i check in hive,the 222...shows normal.
4.try to explain the command,we may know what happened,if the data is big enough than max_int_value,it will not selected,we may need to convert to double instand.
!image-2020-04-21-18-49-58-850.png!
I wanna know if we have fixed or planned in 3.0 or later version.,please feel free to give any advice,
Many Thanks
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org