[ https://issues.apache.org/jira/browse/HIVE-22368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17109725#comment-17109725 ]
Hive QA commented on HIVE-22368: -------------------------------- | (/) *{color:green}+1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | || || || || {color:brown} master Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 11m 15s{color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 22s{color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 19s{color} | {color:green} master passed {color} | | {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue} 0m 48s{color} | {color:blue} serde in master has 198 extant Findbugs warnings. {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 19s{color} | {color:green} master passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 24s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 21s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 21s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 17s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 0m 56s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 19s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 18s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 16m 12s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Optional Tests | asflicense javac javadoc findbugs checkstyle compile | | uname | Linux hiveptest-server-upstream 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux | | Build tool | maven | | Personality | /data/hiveptest/working/yetus_PreCommit-HIVE-Build-22423/dev-support/hive-personality.sh | | git revision | master / 28bdeeb | | Default Java | 1.8.0_111 | | findbugs | v3.0.1 | | modules | C: serde U: serde | | Console output | http://104.198.109.242/logs//PreCommit-HIVE-Build-22423/yetus.txt | | Powered by | Apache Yetus http://yetus.apache.org | This message was automatically generated. > 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: 20m > 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)