You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/05/17 19:18:24 UTC

[GitHub] [hive] ches commented on a change in pull request #822: HIVE-22368 Hive JDBC Storage Handler: some mysql data type can not be cast to hive data type

ches commented on a change in pull request #822:
URL: https://github.com/apache/hive/pull/822#discussion_r426294836



##########
File path: serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/JavaDateObjectInspector.java
##########
@@ -38,7 +38,7 @@ public DateWritableV2 getPrimitiveWritableObject(Object o) {
 
   @Override
   public Date getPrimitiveJavaObject(Object o) {
-    return o == null ? null : (Date) o;
+    return o == null ? null : Date.valueOf(o.toString());

Review comment:
       If this is the correct fix, I believe it's also needed on the `new DateWritableV2((Date) o)` in the method above. I'm having code break there on a write path.




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org