You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@livy.apache.org by "Saisai Shao (JIRA)" <ji...@apache.org> on 2019/07/26 11:38:00 UTC

[jira] [Assigned] (LIVY-613) Livy can't handle the java.sql.Date type correctly

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

Saisai Shao reassigned LIVY-613:
--------------------------------

    Assignee: wyp

> Livy can't handle the java.sql.Date type correctly
> --------------------------------------------------
>
>                 Key: LIVY-613
>                 URL: https://issues.apache.org/jira/browse/LIVY-613
>             Project: Livy
>          Issue Type: Bug
>          Components: REPL
>    Affects Versions: 0.7.0
>            Reporter: wyp
>            Assignee: wyp
>            Priority: Minor
>             Fix For: 0.7.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> When Spark table has java.sql.Date type column, Livy can't handle the java.sql.Date type correctly. e.g
> {code:java}
> create table test(
>     name string,
>     birthday date
> );
> insert into test values ('Livy', '2019-07-24')
> curl -H "Content-Type:application/json" -X POST -d '{"code":"select * from test", "kind":"sql"}' 192.168.1.6:8998/sessions/48/statements
> {"id":1,"code":"select * from test","state":"waiting","output":null,"progress":0.0}
> curl 192.168.1.6:8998/sessions/48/statements/1
> {"id":1,"code":"select * from test","state":"available","output":{"status":"ok","execution_count":1,"data":{"application/json":{"schema":{"type":"struct","fields":[{"name":"name","type":"string","nullable":true,"metadata":{}},{"name":"birthday","type":"date","nullable":true,"metadata":{}}]},"data":[["Livy",{}]]}}},"progress":1.0}{code}
> as you can see, the output of `select * from test` is ["Livy",{}], birthday column's value isn't handle  correctly.
> The reason is that json4j can't handle java.sql.Date, so we should define the CustomSerializer for java.sql.Date.
>  



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