You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Syed Shameerur Rahman (Jira)" <ji...@apache.org> on 2019/10/30 13:14:00 UTC

[jira] [Commented] (HIVE-22431) Hive JDBC Storage Handler: java.lang.ClassCastException on accessing TINYINT, SMALLINT Data Type From JDBC Data Source

    [ https://issues.apache.org/jira/browse/HIVE-22431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16963008#comment-16963008 ] 

Syed Shameerur Rahman commented on HIVE-22431:
----------------------------------------------

[~jcamachorodriguez]  [~daijy] Could you please review

> Hive JDBC Storage Handler: java.lang.ClassCastException on accessing TINYINT, SMALLINT Data Type From JDBC Data Source
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-22431
>                 URL: https://issues.apache.org/jira/browse/HIVE-22431
>             Project: Hive
>          Issue Type: Bug
>          Components: StorageHandler
>            Reporter: Syed Shameerur Rahman
>            Assignee: Syed Shameerur Rahman
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-22431.01.patch
>
>
> Steps to Reproduce:
> {code:java}
> //MySQL table:
> create table testtbl(a TINYINT, b SMALLINT);
> // Insert to table via mysql connector
> //Hive table:
> CREATE EXTERNAL TABLE `hive_table`(               
>       a TINYINT, b SMALLINT
>  )           
>     STORED BY                                          
>       'org.apache.hive.storage.jdbc.JdbcStorageHandler'                       
>     TBLPROPERTIES (                                                            
>       'hive.sql.database.type'='MYSQL',                                  
>       'hive.sql.dbcp.password'='',             
>       'hive.sql.dbcp.username'='',             
>       'hive.sql.jdbc.driver'='com.mysql.jdbc.Driver',  
>       'hive.sql.jdbc.url'='',  
>       'hive.sql.table'='testtbl');
> //Hive query:
> select * from hive_table;
> {code}
> *Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Byte*
> *Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Short*
> {code:java}
>  {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)