You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Jonathan Chang (Created) (JIRA)" <ji...@apache.org> on 2011/10/18 18:07:11 UTC

[jira] [Created] (HIVE-2509) Literal bigint

Literal bigint
--------------

                 Key: HIVE-2509
                 URL: https://issues.apache.org/jira/browse/HIVE-2509
             Project: Hive
          Issue Type: New Feature
            Reporter: Jonathan Chang
            Assignee: Jonathan Chang


Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2509) Literal bigint

Posted by "jsichi (John Sichi) (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jsichi (John Sichi) updated HIVE-2509:
--------------------------------------

    Attachment: D15.1.patch

jonchang requested code review of "[jira] [HIVE-2509] Literal bigint".
Reviewers: jsichi

  HIVE-2509

  This diff adds support for literal bigints to Hive.

  Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

TEST PLAN
  ant test -Dtestcase=TestCliDriver -Doffline=true -Dqfile=bigint_literal.q -Dtest.silent=false

REVISION DETAIL
  http://reviews.facebook.net/D15

AFFECTED FILES
  ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
  ql/src/test/queries/clientpositive/bigint_literal.q
  ql/src/test/results/clientpositive/bigint_literal.q.out

MANAGE HERALD DIFFERENTIAL RULES
  http://reviews.facebook.net/herald/view/differential/

WHY DID I GET THIS EMAIL?
  http://reviews.facebook.net/herald/transcript/45/

Tip: use the X-Herald-Rules header to filter Herald messages in your client.

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "John Sichi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135411#comment-13135411 ] 

John Sichi commented on HIVE-2509:
----------------------------------

Try now...I just granted you write access.

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>             Fix For: 0.9.0
>
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Jonathan Chang (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131216#comment-13131216 ] 

Jonathan Chang commented on HIVE-2509:
--------------------------------------

This also matters in a few other places like CTAS.

In any case, this is a pretty low-risk change and not too onerous on the code base so I hope this gets in...
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2509) Literal bigint

Posted by "jsichi (John Sichi) (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

jsichi (John Sichi) updated HIVE-2509:
--------------------------------------

    Attachment: D15.1.patch

jonchang requested code review of "[jira] [HIVE-2509] Literal bigint".
Reviewers: jsichi

  HIVE-2509

  This diff adds support for literal bigints to Hive.

  Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

TEST PLAN
  ant test -Dtestcase=TestCliDriver -Doffline=true -Dqfile=bigint_literal.q -Dtest.silent=false

REVISION DETAIL
  http://reviews.facebook.net/D15

AFFECTED FILES
  ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
  ql/src/test/queries/clientpositive/bigint_literal.q
  ql/src/test/results/clientpositive/bigint_literal.q.out

MANAGE HERALD DIFFERENTIAL RULES
  http://reviews.facebook.net/herald/view/differential/

WHY DID I GET THIS EMAIL?
  http://reviews.facebook.net/herald/transcript/45/

Tip: use the X-Herald-Rules header to filter Herald messages in your client.

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2509) Literal bigint

Posted by "Jonathan Chang (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Chang updated HIVE-2509:
---------------------------------

    Attachment: D15.4.patch
    
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "John Sichi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134512#comment-13134512 ] 

John Sichi commented on HIVE-2509:
----------------------------------

Note that the conflict came from your HIVE-1360 patch.
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Jonathan Chang (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131169#comment-13131169 ] 

Jonathan Chang commented on HIVE-2509:
--------------------------------------

There are two issues:

1.) There are actually lots of UDFs which are pretty sensitive to type.  In particular, widening will not handle cases where array<int> needs to be widened to array<bigint> (there's a reason this sort of thing isn't autocasted in C++, Java, etc.).
2.) I generally think widening is a bad idea because it makes people less careful with types.  For example, without looking, what will 

> explain select * from (select '0' from akramer_one_row union all select 12345678900 from akramer_one_row) a;

return as the type of the outer query?  The answer is pretty terrible; if any other language did this to you you'd be pretty furious.
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "John Sichi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131186#comment-13131186 ] 

John Sichi commented on HIVE-2509:
----------------------------------

1) So for the array case, you're going to stick an L on the end of every literal in the array?  An explicit CAST seems cleaner in that case (assuming it works).  What are some other cases?  I'd like to understand them better before we add more Hive-specific syntax (I'm not aware of any other SQL parsers that use the L suffix).

2) In standard SQL, that would be an error since strings and numbers are not union-compatible.  Simple.  I wish Hive followed standard SQL in this and many other areas (such as comparison strictness).

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Phabricator (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135382#comment-13135382 ] 

Phabricator commented on HIVE-2509:
-----------------------------------

jonchang has committed the revision "[jira] [HIVE-2509] Literal bigint".

REVISION DETAIL
  https://reviews.facebook.net/D15

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>             Fix For: 0.9.0
>
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Jonathan Chang (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131201#comment-13131201 ] 

Jonathan Chang commented on HIVE-2509:
--------------------------------------

1.) You can't cast array<int> to array<bigint> in Hive which is why we had to write an FB UDF for this exact problem.  Right now you need to pass in an instance of the desired type which is annoying with BIGINTs.  This starts to become a deep rabbit hole.  For example, how do you tell if an array is equal to [0L]?  Turns out you can't compare arrays in Hive.  So we have a UDF, which chokes if you try to compare array<int> to array<bigint>, which is IMO reasonable behavior because the complexity/corner cases which we've been talking about here (and on point #2) just gets moved into this UDF which is untenable for the large library of UDFs we have.  

2.) Yes, I agree that an error would be good in those cases.  Can we make that happen? (Unrelated issue but type widening still fails with NULLs; in general I think type widening is uber complicated and prone to all sorts of issues we wouldn't have if we were more type safe throughout.)
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "John Sichi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132099#comment-13132099 ] 

John Sichi commented on HIVE-2509:
----------------------------------

Based on what you're saying, it sounds like literal bigint is just a bandaid for the real issues with collection types and casting.  If you think the non-portability is worth it, let's commit it, but in that case, shouldn't syntactic shorthand be provided for the other integer types (TINYINT and SMALLINT) as well for comprehensiveness?

Regarding proposed repairs to the type system, I'm all in favor of strong typing combined with conservative comparison/widening/assignment rules plus robust explicit conversions.  However, getting from the existing liberal system to the promised land may be difficult due to breakage in legacy queries.

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2509) Literal bigint

Posted by "Phabricator (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phabricator updated HIVE-2509:
------------------------------

    Attachment: D15.4.patch

jonchang updated the revision "[jira] [HIVE-2509] Literal bigint".
Reviewers: jsichi

  Really rebase.

REVISION DETAIL
  https://reviews.facebook.net/D15

AFFECTED FILES
  ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
  ql/src/test/queries/clientpositive/literal_ints.q
  ql/src/test/results/clientpositive/literal_ints.q.out

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (HIVE-2509) Literal bigint

Posted by "John Sichi (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Sichi resolved HIVE-2509.
------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9.0
     Release Note: This change adds parser support for typed integer literal variants (tinyint, smallint, and bigint).
     Hadoop Flags: Reviewed

Committed to trunk.  Thanks Jonathan!

Can you update the wiki with the new syntax?

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>             Fix For: 0.9.0
>
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Phabricator (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135338#comment-13135338 ] 

Phabricator commented on HIVE-2509:
-----------------------------------

jsichi has accepted the revision "[jira] [HIVE-2509] Literal bigint".

REVISION DETAIL
  https://reviews.facebook.net/D15

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>             Fix For: 0.9.0
>
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Jonathan Chang (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135093#comment-13135093 ] 

Jonathan Chang commented on HIVE-2509:
--------------------------------------

Done.
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2509) Literal bigint

Posted by "Phabricator (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phabricator updated HIVE-2509:
------------------------------

    Attachment: D15.3.patch

jonchang updated the revision "[jira] [HIVE-2509] Literal bigint".
Reviewers: jsichi

  Rebased.

REVISION DETAIL
  https://reviews.facebook.net/D15

AFFECTED FILES
  ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
  ql/src/test/queries/clientpositive/literal_ints.q
  ql/src/test/results/clientpositive/literal_ints.q.out
  serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java
  serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantByteObjectInspector.java

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Phabricator (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134451#comment-13134451 ] 

Phabricator commented on HIVE-2509:
-----------------------------------

jonchang has commented on the revision "[jira] [HIVE-2509] Literal bigint".

  Hm, it seemed to display fine in phabricator before the rebase.  I wonder how it would do that if the patch cannot be applied cleanly.  Maybe there's a bug somewhere?

REVISION DETAIL
  https://reviews.facebook.net/D15

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135624#comment-13135624 ] 

Hudson commented on HIVE-2509:
------------------------------

Integrated in Hive-trunk-h0.21 #1034 (See [https://builds.apache.org/job/Hive-trunk-h0.21/1034/])
    HIVE-2509. Literal bigint
(Jonathan Chang via jvs)

jvs : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1188858
Files : 
* /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
* /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
* /hive/trunk/ql/src/test/queries/clientpositive/literal_ints.q
* /hive/trunk/ql/src/test/results/clientpositive/literal_ints.q.out

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>             Fix For: 0.9.0
>
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "John Sichi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131156#comment-13131156 ] 

John Sichi commented on HIVE-2509:
----------------------------------

Just checking...is there a case where the bigint type is actually important?  HIVE-872 was supposed to address the implicit conversion cases.
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Jonathan Chang (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131209#comment-13131209 ] 

Jonathan Chang commented on HIVE-2509:
--------------------------------------

To put it another way, once you have complex types (arrays, maps, struct and the like) you either need strong typing (a la C++, Java, etc.) or full-on duck typing (a la Python).  I don't think any language has successfully maintained a middle ground (what Hive is trying to do right now). 
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "John Sichi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134769#comment-13134769 ] 

John Sichi commented on HIVE-2509:
----------------------------------

Tests passed...could you grant ASF rights on the last patch?
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Phabricator (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135385#comment-13135385 ] 

Phabricator commented on HIVE-2509:
-----------------------------------

jonchang has committed the revision "[jira] [HIVE-2509] Literal bigint".

REVISION DETAIL
  https://reviews.facebook.net/D15

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>             Fix For: 0.9.0
>
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "John Sichi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132181#comment-13132181 ] 

John Sichi commented on HIVE-2509:
----------------------------------

Lazyweb says:

http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/000905.html

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Phabricator (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134448#comment-13134448 ] 

Phabricator commented on HIVE-2509:
-----------------------------------

jonchang has commented on the revision "[jira] [HIVE-2509] Literal bigint".

  Hm, it seemed to display fine in phabricator before the rebase.  I wonder how it would do that if the patch cannot be applied cleanly.  Maybe there's a bug somewhere?

REVISION DETAIL
  https://reviews.facebook.net/D15

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "John Sichi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134554#comment-13134554 ] 

John Sichi commented on HIVE-2509:
----------------------------------

+1, will commit when tests pass.  A good followup would be negative tests for out of range constants.

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Jonathan Chang (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132123#comment-13132123 ] 

Jonathan Chang commented on HIVE-2509:
--------------------------------------

0L just brings this up to parity with C but C doesn't have convenient shorthands for shorts/chars so I'm open to suggestions on how to best represent these.
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2509) Literal bigint

Posted by "Phabricator (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phabricator updated HIVE-2509:
------------------------------

    Attachment: D15.2.patch

jonchang updated the revision "[jira] [HIVE-2509] Literal bigint".
Reviewers: jsichi

  Add small int and tiny int.

REVISION DETAIL
  http://reviews.facebook.net/D15

AFFECTED FILES
  ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
  ql/src/test/queries/clientpositive/literal_ints.q
  ql/src/test/results/clientpositive/literal_ints.q.out
  serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java
  serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantByteObjectInspector.java

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "John Sichi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134487#comment-13134487 ] 

John Sichi commented on HIVE-2509:
----------------------------------

It's still not applying.  The reason is that for PrimitiveObjectInspectorFactory.java, the latest svn already has

{noformat}
import org.apache.hadoop.hive.serde2.io.ByteWritable;
{noformat}

but your patches have

{noformat}
-import org.apache.hadoop.io.ByteWritable;                                      
+import org.apache.hadoop.hive.serde2.io.ByteWritable;                          
{noformat}

Maybe your git tree is stale?

Note that phabricator just works off of your diff (with a huge diff context flag setting); according to Marek, it's not currently doing anything with what's actually in the repo.

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Phabricator (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135339#comment-13135339 ] 

Phabricator commented on HIVE-2509:
-----------------------------------

jsichi has accepted the revision "[jira] [HIVE-2509] Literal bigint".

REVISION DETAIL
  https://reviews.facebook.net/D15

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>             Fix For: 0.9.0
>
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-2509) Literal bigint

Posted by "Phabricator (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phabricator updated HIVE-2509:
------------------------------

    Attachment: D15.3.patch

jonchang updated the revision "[jira] [HIVE-2509] Literal bigint".
Reviewers: jsichi

  Rebased.

REVISION DETAIL
  https://reviews.facebook.net/D15

AFFECTED FILES
  ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java
  ql/src/test/queries/clientpositive/literal_ints.q
  ql/src/test/results/clientpositive/literal_ints.q.out
  serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorFactory.java
  serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantByteObjectInspector.java

                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "Jonathan Chang (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135398#comment-13135398 ] 

Jonathan Chang commented on HIVE-2509:
--------------------------------------

How do I get edit rights to the wiki?
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>             Fix For: 0.9.0
>
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch, D15.3.patch, D15.3.patch, D15.4.patch, D15.4.patch, D15.4.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HIVE-2509) Literal bigint

Posted by "John Sichi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134435#comment-13134435 ] 

John Sichi commented on HIVE-2509:
----------------------------------

Patch is not applying cleanly on latest trunk...can you rebase?
                
> Literal bigint
> --------------
>
>                 Key: HIVE-2509
>                 URL: https://issues.apache.org/jira/browse/HIVE-2509
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Jonathan Chang
>            Assignee: Jonathan Chang
>         Attachments: D15.1.patch, D15.1.patch, D15.2.patch, D15.2.patch
>
>
> Typing bigints is a pain because you have to write CAST(0 AS BIGINT).  We should let people type 0L instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira