Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-22431

Hive JDBC Storage Handler: java.lang.ClassCastException on accessing TINYINT, SMALLINT Data Type From JDBC Data Source

    XMLWordPrintableJSON

Details

    Description

      Steps to Reproduce:

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

      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

       

      Attachments

        1. HIVE-22431.01.patch
          1 kB
          Syed Shameerur Rahman
        2. HIVE-22431.02.patch
          1 kB
          Syed Shameerur Rahman

        Issue Links

          Activity

            People

              srahman Syed Shameerur Rahman
              srahman Syed Shameerur Rahman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: