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

[jira] [Created] (SPARK-22420) Spark SQL return invalid json string for struct with date/datetime field

pin_zhang created SPARK-22420:
---------------------------------

             Summary: Spark SQL return invalid json string for struct with date/datetime field
                 Key: SPARK-22420
                 URL: https://issues.apache.org/jira/browse/SPARK-22420
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.1.1
            Reporter: pin_zhang
            Priority: Normal


Run SQL with JDBC client in spark hiveserver2

select  named_struct ( 'b',current_timestamp) from test;
+---------------------------------------+--+
| named_struct(b, current_timestamp())  |
+---------------------------------------+--+
| {"b":2017-11-01 23:18:40.988}         |
The json string is is invalid, date time value should be quoted.

If run sql in Apache hiveserver2, get expected json string
select  named_struct ( 'b',current_timestamp) from dummy_table ;
+----------------------------------+--+
|               _c0                |
+----------------------------------+--+
| {"b":"2017-11-01 23:21:24.168"}  |
+----------------------------------+--+




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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