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

[jira] [Created] (SPARK-28748) Zeros(0) inserted as decimal (n , n) in hive tables shows as null in spark sql

Rohit Sindhu created SPARK-28748:
------------------------------------

             Summary: Zeros(0) inserted as decimal (n , n) in hive tables shows as null in spark sql
                 Key: SPARK-28748
                 URL: https://issues.apache.org/jira/browse/SPARK-28748
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.4.3, 2.3.2, 2.3.1, 2.2.1, 2.1.0
            Reporter: Rohit Sindhu


Zeros(0) inserted as decimal (n , n) in hive tables shows as null in spark sql.

Repro Steps

*Hive Shell*
 # create table test_dec (name string , id decimal(3,3));

 # insert into test_dec values ('c1' , 0) , ('c2' , 0.0) , ('c3' , 0.1);

 # select * from test_dec;

c1 0.000

c2 0.000

c3 0.100

 

*Spark* Shell
 * spark.sqlContext.sql("select * from test_dec").show;

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

|name|   id|

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

|  c1 | null |

|  c2 | null |

|  c3 | 0.100 |

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



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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