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

Thejas M Nair commented on HIVE-14231:
--------------------------------------

[~spena]
[~taksaito] Found this issue while writing some end-to-end internal tests for 
ORC schema evolution, where bigint type was changed to timestamp type. The 
actual intent wasn't really to test larger dates. This was resulting in errors 
in beeline, such as the following. It seems like in thrift api/jdbc we are 
sending the timestamp across as strings and then failing to read the values 
because jdbc is using java.sql.Timestamp.valueOf(String). 

{noformat}
0: jdbc:hive2://host-> select * from test;
java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd 
hh:mm:ss[.fffffffff]
        at java.sql.Timestamp.valueOf(Timestamp.java:237)
        at 
org.apache.hive.jdbc.HiveBaseResultSet.evaluate(HiveBaseResultSet.java:443)
        at 
org.apache.hive.jdbc.HiveBaseResultSet.getColumnValue(HiveBaseResultSet.java:423)
        at 
org.apache.hive.jdbc.HiveBaseResultSet.getString(HiveBaseResultSet.java:536)
        at org.apache.hive.beeline.Rows$Row.<init>(Rows.java:166)
        at org.apache.hive.beeline.BufferedRows.<init>(BufferedRows.java:43)
        at org.apache.hive.beeline.BeeLine.print(BeeLine.java:1813)
        at org.apache.hive.beeline.Commands.execute(Commands.java:875)
        at org.apache.hive.beeline.Commands.sql(Commands.java:728)
        at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:992)
        at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:832)
        at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:790)
        at 
org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:490)
        at org.apache.hive.beeline.BeeLine.main(BeeLine.java:473)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Error: Unrecognized column type:TIMESTAMP_TYPE (state=,code=0)
{noformat}

> timestamp support is limited to 4 digit year
> --------------------------------------------
>
>                 Key: HIVE-14231
>                 URL: https://issues.apache.org/jira/browse/HIVE-14231
>             Project: Hive
>          Issue Type: Bug
>          Components: Types
>            Reporter: Takahiko Saito
>
> Hive doesn't handle timestamp type that have a year with more than 4 digits.
> This limitation seems to be primarily around string to timestamp conversion.
> {code}
> Following insert query would insert NULL record -
> create table ts_test (t timestamp);
> insert into ts_test values ('2015-01-01 1:1:1');
> insert into ts_test values ('20151-01-01 1:1:1');
> select CAST(t as String)  from ts_test;
> +----------------------+--+
> |          t           |
> +----------------------+--+
> | 2015-01-01 01:01:01  |
> | NULL                 |
> +----------------------+--+
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to