You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Syed Shameerur Rahman (Jira)" <ji...@apache.org> on 2019/10/30 04:55:00 UTC
[jira] [Created] (HIVE-22431) Hive JDBC Storage Handler:
java.lang.ClassCastException on accessing TINYINT, SMALLINT Data Type From
JDBC Data Source
Syed Shameerur Rahman created HIVE-22431:
--------------------------------------------
Summary: 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
Reporter: Syed Shameerur Rahman
Assignee: Syed Shameerur Rahman
Steps to Reproduce:
{code:java}
//MySQL table:
create table testtbl(a TINYINT, b SMALLINT);
// Insert to table
//Hive table:
CREATE EXTERNAL TABLE `hive_table`(
a TINYINT, b SMALLINT
)
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'='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)