[jira] [Updated] (CARBONDATA-1461) Unable to Read Date And TimeStamp Type in HIve

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (CARBONDATA-1461) Unable to Read Date And TimeStamp Type in HIve

Akash R Nilugal (Jira)

     [ https://issues.apache.org/jira/browse/CARBONDATA-1461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

anubhav tarar updated CARBONDATA-1461:
--------------------------------------
    Summary: Unable to Read Date And TimeStamp Type in HIve  (was: Unable to Read Date Type in HIve)

> Unable to Read Date And TimeStamp Type in HIve
> ----------------------------------------------
>
>                 Key: CARBONDATA-1461
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-1461
>             Project: CarbonData
>          Issue Type: Bug
>          Components: hive-integration
>    Affects Versions: 1.2.0
>         Environment: hive1.21.,spark 2.1
>            Reporter: anubhav tarar
>            Assignee: anubhav tarar
>            Priority: Trivial
>             Fix For: 1.2.0
>
>
>     val connection = DriverManager.getConnection(s"jdbc:hive2://localhost:$port/default", "", "")
>     val statement: Statement = connection.createStatement
>     logger.info(s"============HIVE CLI IS STARTED ON PORT $port ==============")
>     statement.execute("CREATE TABLE IF NOT EXISTS carbon_table(shortField SMALLINT,intField INT,bigintField " +
>                       "bigint,doubleField DOUBLE,stringField STRING,timestampField TIMESTAMP," +
>                       "decimalField DECIMAL(18,2),dateField DATE,\n charField CHAR(5),floatField " +
>                       "double,complexData ARRAY<STRING>)")
>     statement
>       .execute(
>         "ALTER TABLE carbon_table SET FILEFORMAT INPUTFORMAT \"org.apache.carbondata." +
>         "hive.MapredCarbonInputFormat\"OUTPUTFORMAT \"org.apache.carbondata.hive." +
>         "MapredCarbonOutputFormat\"SERDE \"org.apache.carbondata.hive." +
>         "CarbonHiveSerDe\" ")
>     statement
>       .execute(
>         "ALTER TABLE carbon_table SET LOCATION 'file:///home/vinod/Desktop/carbondata/examples/spark2/target/store/default/carbon_table' ")
>     val sql = "SELECT dateField FROM carbon_table"
>     val resultSet: ResultSet = statement.executeQuery(sql)
>      logs
> exception in thread "main" org.apache.hive.service.cli.HiveSQLException:
> java.io.IOException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
> at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:256)
> at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:242)
> at org.apache.hive.jdbc.HiveQueryResultSet.next(HiveQueryResultSet.java:365)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)