You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Pradeep Kamath (JIRA)" <ji...@apache.org> on 2009/01/30 23:16:59 UTC

[jira] Created: (PIG-649) RandomSampleLoader does not handle skipping correctly in getNext()

RandomSampleLoader does not handle skipping correctly in getNext()
------------------------------------------------------------------

                 Key: PIG-649
                 URL: https://issues.apache.org/jira/browse/PIG-649
             Project: Pig
          Issue Type: Bug
    Affects Versions: types_branch
            Reporter: Pradeep Kamath
            Assignee: Pradeep Kamath
             Fix For: types_branch


Currently RandomSampleLoader calls skip() on the underlying input stream (BufferedPositionedInputStream) in its getNext(). The input stream may not actually skip over the amount the RandomSampleLoader needs in one call. RandomSampleLoader should check the return value from the skip() call and ensure that skip() is called repeatedly (if necessary) till the needed number of bytes are skipped.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIG-649) RandomSampleLoader does not handle skipping correctly in getNext()

Posted by "Olga Natkovich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669124#action_12669124 ] 

Olga Natkovich commented on PIG-649:
------------------------------------

+1, please, commit

> RandomSampleLoader does not handle skipping correctly in getNext()
> ------------------------------------------------------------------
>
>                 Key: PIG-649
>                 URL: https://issues.apache.org/jira/browse/PIG-649
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: types_branch
>            Reporter: Pradeep Kamath
>            Assignee: Pradeep Kamath
>             Fix For: types_branch
>
>         Attachments: PIG-649.patch
>
>
> Currently RandomSampleLoader calls skip() on the underlying input stream (BufferedPositionedInputStream) in its getNext(). The input stream may not actually skip over the amount the RandomSampleLoader needs in one call. RandomSampleLoader should check the return value from the skip() call and ensure that skip() is called repeatedly (if necessary) till the needed number of bytes are skipped.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-649) RandomSampleLoader does not handle skipping correctly in getNext()

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

Pradeep Kamath updated PIG-649:
-------------------------------

    Status: Patch Available  (was: Open)

The attached patch fixes the issue by keep track of the return value of the underlying input stream's skip(). If enough bytes are not skipped on the initial call, multiple calls are made till enough bytes are skipped

> RandomSampleLoader does not handle skipping correctly in getNext()
> ------------------------------------------------------------------
>
>                 Key: PIG-649
>                 URL: https://issues.apache.org/jira/browse/PIG-649
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: types_branch
>            Reporter: Pradeep Kamath
>            Assignee: Pradeep Kamath
>             Fix For: types_branch
>
>         Attachments: PIG-649.patch
>
>
> Currently RandomSampleLoader calls skip() on the underlying input stream (BufferedPositionedInputStream) in its getNext(). The input stream may not actually skip over the amount the RandomSampleLoader needs in one call. RandomSampleLoader should check the return value from the skip() call and ensure that skip() is called repeatedly (if necessary) till the needed number of bytes are skipped.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-649) RandomSampleLoader does not handle skipping correctly in getNext()

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

Pradeep Kamath updated PIG-649:
-------------------------------

    Attachment: PIG-649.patch

> RandomSampleLoader does not handle skipping correctly in getNext()
> ------------------------------------------------------------------
>
>                 Key: PIG-649
>                 URL: https://issues.apache.org/jira/browse/PIG-649
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: types_branch
>            Reporter: Pradeep Kamath
>            Assignee: Pradeep Kamath
>             Fix For: types_branch
>
>         Attachments: PIG-649.patch
>
>
> Currently RandomSampleLoader calls skip() on the underlying input stream (BufferedPositionedInputStream) in its getNext(). The input stream may not actually skip over the amount the RandomSampleLoader needs in one call. RandomSampleLoader should check the return value from the skip() call and ensure that skip() is called repeatedly (if necessary) till the needed number of bytes are skipped.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (PIG-649) RandomSampleLoader does not handle skipping correctly in getNext()

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

Pradeep Kamath updated PIG-649:
-------------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

Patch committed

> RandomSampleLoader does not handle skipping correctly in getNext()
> ------------------------------------------------------------------
>
>                 Key: PIG-649
>                 URL: https://issues.apache.org/jira/browse/PIG-649
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: types_branch
>            Reporter: Pradeep Kamath
>            Assignee: Pradeep Kamath
>             Fix For: types_branch
>
>         Attachments: PIG-649.patch
>
>
> Currently RandomSampleLoader calls skip() on the underlying input stream (BufferedPositionedInputStream) in its getNext(). The input stream may not actually skip over the amount the RandomSampleLoader needs in one call. RandomSampleLoader should check the return value from the skip() call and ensure that skip() is called repeatedly (if necessary) till the needed number of bytes are skipped.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.