You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Szehon Ho (JIRA)" <ji...@apache.org> on 2013/10/30 19:35:31 UTC

[jira] [Commented] (HIVE-5286) Negative test date_literal1.q fails on java7 because the syntax is valid

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

Szehon Ho commented on HIVE-5286:
---------------------------------

[~brocknoland], I am wondering what this test was trying to assert, that 2011-1-1 should be invalid to Hive?  Hive uses java.sql.Date to parse dates, so whatever is valid to Date, is valid for Hive, in the implementation.

It doesn't seem like we should make it invalid on purpose for backward compatibility, now that Java7 supports dates of this format.  So I am wondering is this JIRA asking to find an equally invalid date format for Java6/7 for this test then, or remove it?

> Negative test date_literal1.q fails on java7 because the syntax is valid
> ------------------------------------------------------------------------
>
>                 Key: HIVE-5286
>                 URL: https://issues.apache.org/jira/browse/HIVE-5286
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 0.12.0
>            Reporter: Brock Noland
>
> {noformat}
> [brock@bigboy java-date]$ cat Test.java 
> import java.sql.Date;
> public class Test {
>   public static void main(String[] args) throws Exception {
>     System.out.println(Date.valueOf("2001-1-1"));
>   }
> }
> [brock@bigboy java-date]$ exec-via-java6 java -cp . Test
> Exception in thread "main" java.lang.IllegalArgumentException
> 	at java.sql.Date.valueOf(Date.java:138)
> 	at Test.main(Test.java:4)
> [brock@bigboy java-date]$ exec-via-java7 java -cp . Test
> 2001-01-01
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.1#6144)