[
https://issues.apache.org/jira/browse/HIVE-22368?focusedWorklogId=475612&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-475612
]
ASF GitHub Bot logged work on HIVE-22368:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Aug/20 00:45
Start Date: 28/Aug/20 00:45
Worklog Time Spent: 10m
Work Description: github-actions[bot] commented on pull request #822:
URL: https://github.com/apache/hive/pull/822#issuecomment-682262017
This pull request has been automatically marked as stale because it has not
had recent activity. It will be closed if no further activity occurs.
Feel free to reach out on the [email protected] list if the patch is in
need of reviews.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 475612)
Time Spent: 0.5h (was: 20m)
> Hive JDBC Storage Handler: some mysql data type can not be cast to hive data
> type
> ---------------------------------------------------------------------------------
>
> Key: HIVE-22368
> URL: https://issues.apache.org/jira/browse/HIVE-22368
> Project: Hive
> Issue Type: Bug
> Affects Versions: 3.1.0, 4.0.0, 3.1.1
> Reporter: zhangbutao
> Assignee: zhangbutao
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.0.0
>
> Attachments: HIVE-22368.01.patch
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Mysql data type(date、timestamp、decimal)can not be cast to hive data
> type(date、timestamp、decimal)。
> step to repo(take date type for example):
> {code:java}
> //MySQL table:
> create table testdate(id date);
> //Hive table:
> CREATE EXTERNAL TABLE `hive_date`(
> id date )
> ROW FORMAT SERDE
> 'org.apache.hive.storage.jdbc.JdbcSerDe'
> STORED BY
> 'org.apache.hive.storage.jdbc.JdbcStorageHandler'
> TBLPROPERTIES (
>
> 'hive.sql.database.type'='MYSQL',
> 'hive.sql.dbcp.password'='hive',
> 'hive.sql.dbcp.username'='hive',
> 'hive.sql.jdbc.driver'='com.mysql.jdbc.Driver',
> 'hive.sql.jdbc.url'='jdbc:mysql://hadoop/test',
> 'hive.sql.table'='testdate');
> //Hive query:
> select * from hive_date;
> Error: java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException:
> java.lang.ClassCastException: java.sql.Date cannot be cast to
> org.apache.hadoop.hive.common.type.Date (state=,code=0)
> //Error stack trace
> Caused by: java.lang.ClassCastException: java.sql.Date cannot be cast to
> org.apache.hadoop.hive.common.type.Date
> at
> org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaDateObjectInspector.getPrimitiveJavaObject(JavaDateObjectInspector.java:41)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaDateObjectInspector.getPrimitiveJavaObject(JavaDateObjectInspector.java:27)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils.copyToStandardObject(ObjectInspectorUtils.java:422)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.serde2.SerDeUtils.toThriftPayload(SerDeUtils.java:173)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.serde2.thrift.ThriftFormatter.convert(ThriftFormatter.java:49)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.ql.exec.ListSinkOperator.process(ListSinkOperator.java:94)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.ql.exec.Operator.baseForward(Operator.java:995)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:941)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:928)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.ql.exec.SelectOperator.process(SelectOperator.java:95)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.ql.exec.Operator.baseForward(Operator.java:995)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:941)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.ql.exec.TableScanOperator.process(TableScanOperator.java:125)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:519)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:511)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:146)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:2706)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hadoop.hive.ql.reexec.ReExecDriver.getResults(ReExecDriver.java:229)
> ~[hive-exec-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> at
> org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet(SQLOperation.java:460)
> ~[hive-service-3.1.0-bc3.0.1.jar:3.1.0-bc3.0.1]
> ... 25 more
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)