You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Carl Steinbach (Created) (JIRA)" <ji...@apache.org> on 2012/02/09 03:25:59 UTC

[jira] [Created] (HIVE-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
------------------------------------------------------------

                 Key: HIVE-2792
                 URL: https://issues.apache.org/jira/browse/HIVE-2792
             Project: Hive
          Issue Type: Bug
          Components: UDF
            Reporter: Carl Steinbach




--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Phabricator updated HIVE-2792:
------------------------------

    Attachment: HIVE-2792.D1797.2.patch

navis updated the revision "HIVE-2792 [jira] SUBSTR(CAST(<string> AS BINARY)) produces unexpected results".
Reviewers: JIRA, ashutoshc

  added test cases requested

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

AFFECTED FILES
  ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java
  ql/src/test/queries/clientpositive/ba_table_udfs.q
  ql/src/test/queries/clientpositive/udf_substr.q
  ql/src/test/results/clientpositive/ba_table_udfs.q.out
  ql/src/test/results/clientpositive/udf_substr.q.out

                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0, 0.8.1
>            Reporter: Carl Steinbach
>            Assignee: Navis
>             Fix For: 0.9.0
>
>         Attachments: HIVE-2792.D1797.1.patch, HIVE-2792.D1797.2.patch
>
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Carl Steinbach commented on HIVE-2792:
--------------------------------------

{noformat}
SELECT
  value,
  SUBSTR(value, 4, 5),
  SUBSTR(CAST(value AS BINARY), 4, 5)
FROM src
ORDER BY value;
...
val_0	_0	039    <-- Third column of the first three rows should be the same, right?
val_0	_0	096    
val_0	_0	073
val_10	_10	105
val_100	_100	100
val_100	_100	100
val_103	_103	103
val_103	_103	103
val_104	_104	104
val_104	_104	104
val_105	_105	105
val_11	_11	116
val_111	_111	111
val_113	_113	113
val_113	_113	113
val_114	_114	114
val_116	_116	116
val_118	_118	118
val_118	_118	118
val_119	_119	119
val_119	_119	119
val_119	_119	119
val_12	_12	124
val_12	_12	124
...
{noformat}

                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>            Reporter: Carl Steinbach
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Ashutosh Chauhan resolved HIVE-2792.
------------------------------------

    Resolution: Fixed

Committed to trunk. Thanks, Navis!
                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0, 0.8.1
>            Reporter: Carl Steinbach
>            Assignee: Navis
>             Fix For: 0.9.0
>
>         Attachments: HIVE-2792.D1797.1.patch, HIVE-2792.D1797.2.patch, HIVE-2792.D1797.2.patch
>
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Phabricator commented on HIVE-2792:
-----------------------------------

navis has commented on the revision "HIVE-2792 [jira] SUBSTR(CAST(<string> AS BINARY)) produces unexpected results".

  For substr() for binary type..
  1. Fixed length problem (dummy values at the end)
  2. Changed to use 1-based index (like mysql)

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

                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>            Reporter: Carl Steinbach
>         Attachments: HIVE-2792.D1797.1.patch
>
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Phabricator commented on HIVE-2792:
-----------------------------------

ashutoshc has requested changes to the revision "HIVE-2792 [jira] SUBSTR(CAST(<string> AS BINARY)) produces unexpected results".

  Patch looks good. Can you update the testcase as I noted so that we have better coverage?

INLINE COMMENTS
  ql/src/test/results/clientpositive/ba_table_udfs.q.out:28 For a better test so that it captures variance in the rows, modify the test in ba_tables_udfs.q to SUBSTR(src.value AS BINARY), 3),
  SUBSTR(src.value AS BINARY), -4,3)




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

BRANCH
  DPAL-848

                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>            Reporter: Carl Steinbach
>         Attachments: HIVE-2792.D1797.1.patch
>
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Ashutosh Chauhan commented on HIVE-2792:
----------------------------------------

@Navis,
Can you please upload the patch on jira also granting ASF perms. On top of this page, click More Actions > Attach Files. Then after attaching your patch file, click on radio button granting ASF perms.
                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0, 0.8.1
>            Reporter: Carl Steinbach
>            Assignee: Navis
>             Fix For: 0.9.0
>
>         Attachments: HIVE-2792.D1797.1.patch, HIVE-2792.D1797.2.patch
>
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Navis updated HIVE-2792:
------------------------

    Attachment: HIVE-2792.D1797.2.patch
    
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0, 0.8.1
>            Reporter: Carl Steinbach
>            Assignee: Navis
>             Fix For: 0.9.0
>
>         Attachments: HIVE-2792.D1797.1.patch, HIVE-2792.D1797.2.patch, HIVE-2792.D1797.2.patch
>
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Phabricator commented on HIVE-2792:
-----------------------------------

ashutoshc has accepted the revision "HIVE-2792 [jira] SUBSTR(CAST(<string> AS BINARY)) produces unexpected results".

  +1 Will commit if tests pass.

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

BRANCH
  DPAL-848

                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0, 0.8.1
>            Reporter: Carl Steinbach
>            Assignee: Navis
>             Fix For: 0.9.0
>
>         Attachments: HIVE-2792.D1797.1.patch, HIVE-2792.D1797.2.patch
>
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Ashutosh Chauhan updated HIVE-2792:
-----------------------------------

    Affects Version/s: 0.8.0
                       0.8.1
        Fix Version/s: 0.9.0
    
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0, 0.8.1
>            Reporter: Carl Steinbach
>            Assignee: Navis
>             Fix For: 0.9.0
>
>         Attachments: HIVE-2792.D1797.1.patch
>
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Hudson commented on HIVE-2792:
------------------------------

Integrated in Hive-trunk-h0.21 #1267 (See [https://builds.apache.org/job/Hive-trunk-h0.21/1267/])
    HIVE-2792: SUBSTR(CAST(<string> AS BINARY)) produces unexpected results (navis via hashutosh) (Revision 1291633)

     Result = SUCCESS
hashutosh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1291633
Files : 
* /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java
* /hive/trunk/ql/src/test/queries/clientpositive/ba_table_udfs.q
* /hive/trunk/ql/src/test/queries/clientpositive/udf_substr.q
* /hive/trunk/ql/src/test/results/clientpositive/ba_table_udfs.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf_substr.q.out

                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0, 0.8.1
>            Reporter: Carl Steinbach
>            Assignee: Navis
>             Fix For: 0.9.0
>
>         Attachments: HIVE-2792.D1797.1.patch, HIVE-2792.D1797.2.patch, HIVE-2792.D1797.2.patch
>
>


--
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] [Assigned] (HIVE-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Ashutosh Chauhan reassigned HIVE-2792:
--------------------------------------

    Assignee: Navis

@Navis, Can you also please upload the updated patch directly on jira granting ASF perms?
                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0, 0.8.1
>            Reporter: Carl Steinbach
>            Assignee: Navis
>             Fix For: 0.9.0
>
>         Attachments: HIVE-2792.D1797.1.patch
>
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Phabricator updated HIVE-2792:
------------------------------

    Attachment: HIVE-2792.D1797.1.patch

navis requested code review of "HIVE-2792 [jira] SUBSTR(CAST(<string> AS BINARY)) produces unexpected results".
Reviewers: JIRA

  DPAL-848 SUBSTR(CAST(<string> AS BINARY)) produces unexpected results

TEST PLAN
  EMPTY

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

AFFECTED FILES
  ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java
  ql/src/test/queries/clientpositive/udf_substr.q
  ql/src/test/results/clientpositive/ba_table_udfs.q.out
  ql/src/test/results/clientpositive/udf_substr.q.out

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

WHY DID I GET THIS EMAIL?
  https://reviews.facebook.net/herald/transcript/3831/

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

                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>            Reporter: Carl Steinbach
>         Attachments: HIVE-2792.D1797.1.patch
>
>


--
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-2792) SUBSTR(CAST( AS BINARY)) produces unexpected results

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

Hudson commented on HIVE-2792:
------------------------------

Integrated in Hive-trunk-h0.21 #1268 (See [https://builds.apache.org/job/Hive-trunk-h0.21/1268/])
    HIVE-2792: SUBSTR(CAST(<string> AS BINARY)) produces unexpected results (navis via hashutosh) (Revision 1291633)

     Result = SUCCESS
hashutosh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1291633
Files : 
* /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java
* /hive/trunk/ql/src/test/queries/clientpositive/ba_table_udfs.q
* /hive/trunk/ql/src/test/queries/clientpositive/udf_substr.q
* /hive/trunk/ql/src/test/results/clientpositive/ba_table_udfs.q.out
* /hive/trunk/ql/src/test/results/clientpositive/udf_substr.q.out

                
> SUBSTR(CAST(<string> AS BINARY)) produces unexpected results
> ------------------------------------------------------------
>
>                 Key: HIVE-2792
>                 URL: https://issues.apache.org/jira/browse/HIVE-2792
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.0, 0.8.1
>            Reporter: Carl Steinbach
>            Assignee: Navis
>             Fix For: 0.9.0
>
>         Attachments: HIVE-2792.D1797.1.patch, HIVE-2792.D1797.2.patch, HIVE-2792.D1797.2.patch
>
>


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