You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sujith (JIRA)" <ji...@apache.org> on 2019/02/03 11:37:00 UTC

[jira] [Updated] (SPARK-26821) filters not working with char datatype when querying against hive table

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

Sujith updated SPARK-26821:
---------------------------
    Description: 
creates a table with a char type field, While inserting data to char data type column, if the data string length is less than the specified datatype length, spark2x will not process filter query properly leading to incorrect result .

0: jdbc:hive2://10.19.89.222:22550/default> create table jj(id int, name char(5));
 +----------+-+
|Result|

+----------+-+
 +----------+-+
 No rows selected (0.894 seconds)
 0: jdbc:hive2://10.19.89.222:22550/default> insert into table jj values(232,'ds');
 +----------+-+
|Result|

+----------+-+
 +----------+-+
 No rows selected (1.815 seconds)
 0: jdbc:hive2://10.19.89.222:22550/default> select * from jj where name='ds';
 +------+------++--
|id|name|

+------+------++--
 +------+------++--

 

The above query will not give any result.

  was:
creates a table with a char type field, While inserting data to char data type column, if the data string length  is less than the specified datatype length, spark2x will not process filter query properly leading to incorrect result .

0: jdbc:hive2://10.19.89.222:22550/default> create table jj(id int, name char(5));
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (0.894 seconds)
0: jdbc:hive2://10.19.89.222:22550/default> insert into table jj values(232,'ds');
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (1.815 seconds)
0: jdbc:hive2://10.19.89.222:22550/default> select * from jj where name='ds';
+-----+-------+--+
| id  | name  |
+-----+-------+--+
+-----+-------+--+


> filters not working with char datatype when querying against hive table
> -----------------------------------------------------------------------
>
>                 Key: SPARK-26821
>                 URL: https://issues.apache.org/jira/browse/SPARK-26821
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Sujith
>            Priority: Major
>
> creates a table with a char type field, While inserting data to char data type column, if the data string length is less than the specified datatype length, spark2x will not process filter query properly leading to incorrect result .
> 0: jdbc:hive2://10.19.89.222:22550/default> create table jj(id int, name char(5));
>  +----------+-+
> |Result|
> +----------+-+
>  +----------+-+
>  No rows selected (0.894 seconds)
>  0: jdbc:hive2://10.19.89.222:22550/default> insert into table jj values(232,'ds');
>  +----------+-+
> |Result|
> +----------+-+
>  +----------+-+
>  No rows selected (1.815 seconds)
>  0: jdbc:hive2://10.19.89.222:22550/default> select * from jj where name='ds';
>  +------+------++--
> |id|name|
> +------+------++--
>  +------+------++--
>  
> The above query will not give any result.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org