You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@livy.apache.org by GitBox <gi...@apache.org> on 2019/07/24 11:43:03 UTC

[GitHub] [incubator-livy] 397090770 opened a new pull request #186: [LIVY-613] Livy can't handle the java.sql.Date type correctly.

397090770 opened a new pull request #186: [LIVY-613] Livy can't handle the java.sql.Date type correctly.
URL: https://github.com/apache/incubator-livy/pull/186
 
 
   ## What changes were proposed in this pull request?
   
   When Spark table has java.sql.Date type column, Livy can't handle the java.sql.Date type correctly. e.g
   ```
   create table test(
       name string,
       birthday date
   );
   
   insert into test1 values ('Livy', '2019-07-24')
   
   curl -H "Content-Type:application/json" -X POST -d '{"code":"select * from test1", "kind":"sql"}' 192.168.1.6:8998/sessions/48/statements
   {"id":1,"code":"select * from test1","state":"waiting","output":null,"progress":0.0}
   
   curl 192.168.1.6:8998/sessions/48/statements/1
   {"id":1,"code":"select * from test1","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}
   ```
   as you can see, the output of `select * from test1` 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 PR  add a `DateSerializer` to support java.sql.Date parser.
   
   ## How was this patch tested?
   
   (Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
   (If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
   
   Please review https://livy.incubator.apache.org/community/ before opening a pull request.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services