[ 
https://issues.apache.org/jira/browse/PIG-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12749226#action_12749226
 ] 

He Yongqiang commented on PIG-937:
----------------------------------

The same loop also occurs at  BasicTable->Reader->BTScanner->getKey. I do not 
check if other places also have this kind of infinite loop. 

> Task get stuck in BasicTable's BTScaner's atEnd() method
> --------------------------------------------------------
>
>                 Key: PIG-937
>                 URL: https://issues.apache.org/jira/browse/PIG-937
>             Project: Pig
>          Issue Type: Bug
>            Reporter: He Yongqiang
>
> It seems is caused by the infinite loop in the code:
> BasicTable, Line 698
> {noformat}
>         while (true)
>         {
>           int index = random.nextInt(cgScanners.length - 1) + 1;
>           if (cgScanners[index] != null) {
>             if (cgScanners[index].atEnd() != ret) {
>               throw new IOException(
>                   "atEnd() failed: Column Groups are not evenly positioned.");
>             }
>             break;
>           }
>         }
> {noformat}
> I think it's fine to just use a for loop here, like:
> {noformat}
>         for (int index = 0; index < cgScanners.length; index++) {
>           if (cgScanners[index] != null) {
>             if (cgScanners[index].atEnd() != ret) {
>               throw new IOException(
>                   "atEnd() failed: Column Groups are not evenly positioned.");
>             }
>             break;
>           }
>         }
> {noformat}

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

Reply via email to