You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Andersson (Created) (JIRA)" <ji...@apache.org> on 2012/03/13 15:29:38 UTC

[jira] [Created] (PIG-2581) HashFNV inconsistent/non-deterministic due to default platform encoding

HashFNV inconsistent/non-deterministic due to default platform encoding
-----------------------------------------------------------------------

                 Key: PIG-2581
                 URL: https://issues.apache.org/jira/browse/PIG-2581
             Project: Pig
          Issue Type: Bug
          Components: piggybank
    Affects Versions: 0.8.1
            Reporter: Daniel Andersson
            Priority: Minor


HashFNV (org/apache/pig/piggybank/evaluation/string/HashFNV) bases its computation on String.getBytes(), which uses the platform default encoding. This leads to different results on different platforms. Worse, if any character is not supported by the encoding, the behavior is completely undefined. We have observed non-deterministic behavior that seems to be caused by this.

Suggested fix is to instead use String.getBytes("UTF-8"), which will be well-defined and consistent on every platform.

--
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] (PIG-2581) HashFNV inconsistent/non-deterministic due to default platform encoding

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

Daniel Dai updated PIG-2581:
----------------------------

    Fix Version/s: 0.11
    
> HashFNV inconsistent/non-deterministic due to default platform encoding
> -----------------------------------------------------------------------
>
>                 Key: PIG-2581
>                 URL: https://issues.apache.org/jira/browse/PIG-2581
>             Project: Pig
>          Issue Type: Bug
>          Components: piggybank
>    Affects Versions: 0.8.1
>            Reporter: Daniel Andersson
>            Assignee: Prashant Kommireddi
>            Priority: Minor
>             Fix For: 0.11
>
>         Attachments: PIG-2581-2.patch, PIG-2581.patch
>
>
> HashFNV (org/apache/pig/piggybank/evaluation/string/HashFNV) bases its computation on String.getBytes(), which uses the platform default encoding. This leads to different results on different platforms. Worse, if any character is not supported by the encoding, the behavior is completely undefined. We have observed non-deterministic behavior that seems to be caused by this.
> Suggested fix is to instead use String.getBytes("UTF-8"), which will be well-defined and consistent on every platform.

--
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] (PIG-2581) HashFNV inconsistent/non-deterministic due to default platform encoding

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

Prashant Kommireddi updated PIG-2581:
-------------------------------------

    Patch Info: Patch Available
    
> HashFNV inconsistent/non-deterministic due to default platform encoding
> -----------------------------------------------------------------------
>
>                 Key: PIG-2581
>                 URL: https://issues.apache.org/jira/browse/PIG-2581
>             Project: Pig
>          Issue Type: Bug
>          Components: piggybank
>    Affects Versions: 0.8.1
>            Reporter: Daniel Andersson
>            Assignee: Prashant Kommireddi
>            Priority: Minor
>         Attachments: PIG-2581.patch
>
>
> HashFNV (org/apache/pig/piggybank/evaluation/string/HashFNV) bases its computation on String.getBytes(), which uses the platform default encoding. This leads to different results on different platforms. Worse, if any character is not supported by the encoding, the behavior is completely undefined. We have observed non-deterministic behavior that seems to be caused by this.
> Suggested fix is to instead use String.getBytes("UTF-8"), which will be well-defined and consistent on every platform.

--
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] (PIG-2581) HashFNV inconsistent/non-deterministic due to default platform encoding

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

Prashant Kommireddi reassigned PIG-2581:
----------------------------------------

    Assignee: Prashant Kommireddi
    
> HashFNV inconsistent/non-deterministic due to default platform encoding
> -----------------------------------------------------------------------
>
>                 Key: PIG-2581
>                 URL: https://issues.apache.org/jira/browse/PIG-2581
>             Project: Pig
>          Issue Type: Bug
>          Components: piggybank
>    Affects Versions: 0.8.1
>            Reporter: Daniel Andersson
>            Assignee: Prashant Kommireddi
>            Priority: Minor
>         Attachments: PIG-2581.patch
>
>
> HashFNV (org/apache/pig/piggybank/evaluation/string/HashFNV) bases its computation on String.getBytes(), which uses the platform default encoding. This leads to different results on different platforms. Worse, if any character is not supported by the encoding, the behavior is completely undefined. We have observed non-deterministic behavior that seems to be caused by this.
> Suggested fix is to instead use String.getBytes("UTF-8"), which will be well-defined and consistent on every platform.

--
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] (PIG-2581) HashFNV inconsistent/non-deterministic due to default platform encoding

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

Daniel Dai commented on PIG-2581:
---------------------------------

Sounds good, will you make a patch?
                
> HashFNV inconsistent/non-deterministic due to default platform encoding
> -----------------------------------------------------------------------
>
>                 Key: PIG-2581
>                 URL: https://issues.apache.org/jira/browse/PIG-2581
>             Project: Pig
>          Issue Type: Bug
>          Components: piggybank
>    Affects Versions: 0.8.1
>            Reporter: Daniel Andersson
>            Priority: Minor
>
> HashFNV (org/apache/pig/piggybank/evaluation/string/HashFNV) bases its computation on String.getBytes(), which uses the platform default encoding. This leads to different results on different platforms. Worse, if any character is not supported by the encoding, the behavior is completely undefined. We have observed non-deterministic behavior that seems to be caused by this.
> Suggested fix is to instead use String.getBytes("UTF-8"), which will be well-defined and consistent on every platform.

--
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] (PIG-2581) HashFNV inconsistent/non-deterministic due to default platform encoding

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

Prashant Kommireddi updated PIG-2581:
-------------------------------------

    Attachment: PIG-2581.patch

Adding a patch with the fix.
                
> HashFNV inconsistent/non-deterministic due to default platform encoding
> -----------------------------------------------------------------------
>
>                 Key: PIG-2581
>                 URL: https://issues.apache.org/jira/browse/PIG-2581
>             Project: Pig
>          Issue Type: Bug
>          Components: piggybank
>    Affects Versions: 0.8.1
>            Reporter: Daniel Andersson
>            Priority: Minor
>         Attachments: PIG-2581.patch
>
>
> HashFNV (org/apache/pig/piggybank/evaluation/string/HashFNV) bases its computation on String.getBytes(), which uses the platform default encoding. This leads to different results on different platforms. Worse, if any character is not supported by the encoding, the behavior is completely undefined. We have observed non-deterministic behavior that seems to be caused by this.
> Suggested fix is to instead use String.getBytes("UTF-8"), which will be well-defined and consistent on every platform.

--
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] (PIG-2581) HashFNV inconsistent/non-deterministic due to default platform encoding

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

Daniel Dai updated PIG-2581:
----------------------------

    Attachment: PIG-2581-2.patch

Need to catch exception.
                
> HashFNV inconsistent/non-deterministic due to default platform encoding
> -----------------------------------------------------------------------
>
>                 Key: PIG-2581
>                 URL: https://issues.apache.org/jira/browse/PIG-2581
>             Project: Pig
>          Issue Type: Bug
>          Components: piggybank
>    Affects Versions: 0.8.1
>            Reporter: Daniel Andersson
>            Assignee: Prashant Kommireddi
>            Priority: Minor
>         Attachments: PIG-2581-2.patch, PIG-2581.patch
>
>
> HashFNV (org/apache/pig/piggybank/evaluation/string/HashFNV) bases its computation on String.getBytes(), which uses the platform default encoding. This leads to different results on different platforms. Worse, if any character is not supported by the encoding, the behavior is completely undefined. We have observed non-deterministic behavior that seems to be caused by this.
> Suggested fix is to instead use String.getBytes("UTF-8"), which will be well-defined and consistent on every platform.

--
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] (PIG-2581) HashFNV inconsistent/non-deterministic due to default platform encoding

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

Daniel Dai resolved PIG-2581.
-----------------------------

      Resolution: Fixed
    Hadoop Flags: Reviewed

Patch committed to trunk.
                
> HashFNV inconsistent/non-deterministic due to default platform encoding
> -----------------------------------------------------------------------
>
>                 Key: PIG-2581
>                 URL: https://issues.apache.org/jira/browse/PIG-2581
>             Project: Pig
>          Issue Type: Bug
>          Components: piggybank
>    Affects Versions: 0.8.1
>            Reporter: Daniel Andersson
>            Assignee: Prashant Kommireddi
>            Priority: Minor
>         Attachments: PIG-2581-2.patch, PIG-2581.patch
>
>
> HashFNV (org/apache/pig/piggybank/evaluation/string/HashFNV) bases its computation on String.getBytes(), which uses the platform default encoding. This leads to different results on different platforms. Worse, if any character is not supported by the encoding, the behavior is completely undefined. We have observed non-deterministic behavior that seems to be caused by this.
> Suggested fix is to instead use String.getBytes("UTF-8"), which will be well-defined and consistent on every platform.

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