You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Ben Becker (JIRA)" <ji...@apache.org> on 2013/11/20 01:47:21 UTC

[jira] [Updated] (DRILL-301) Join two tables hit IndexOutOfBoundsException

     [ https://issues.apache.org/jira/browse/DRILL-301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Becker updated DRILL-301:
-----------------------------

    Attachment: DRILL-301.patch

The issue here was that the join operator failed to check for free space in the destination vector's outgoing buffer.  The supplied patch adds error checking to the generated copy code and record batch iterator, and rebuilds the worker on the next iteration.

> Join two tables hit IndexOutOfBoundsException
> ---------------------------------------------
>
>                 Key: DRILL-301
>                 URL: https://issues.apache.org/jira/browse/DRILL-301
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Jinfeng Ni
>            Assignee: Ben Becker
>         Attachments: DRILL-301.patch
>
>
> The following query, which joins two tables, will hit IndexOutOfBoundsException [ index: 31981700, length: 4 (expected: range(0, 4194244)) ].   If run a query which joins two smaller table (nation vs region), the query is successful.  
> SELECT S.S_ACCTBAL, S.S_NAME
> FROM
>   ( SELECT _MAP['S_SUPPKEY'] AS S_SUPPKEY,
>           _MAP['S_NATIONKEY'] AS S_NATIONKEY,
>           _MAP['S_ACCTBAL'] AS S_ACCTBAL,
>           _MAP['S_NAME']  AS S_NAME,
>           _MAP['S_ADDRESS'] AS S_ADDRESS,
>           _MAP['S_PHONE'] AS S_PHONE,
>           _MAP['S_COMMENT'] AS S_COMMENT
>    FROM "/Users/jni//work/tpc-h-parquet/supplier") S,
>  (SELECT _MAP['PS_PARTKEY'] AS PS_PARTKEY,
>          _MAP['PS_SUPPKEY'] AS PS_SUPPKEY
>   FROM "/Users/jni//work/tpc-h-parquet/partsupp") PS
>  WHERE S.S_SUPPKEY = PS.PS_SUPPKEY
>  LIMIT 100;
> The throwable stack when the exception is raised:
> java.lang.IndexOutOfBoundsException: index: 31981700, length: 4 (expected: range(0, 4194244))
> 	io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1130) ~[netty-buffer-4.0.7.Final.jar:na]
> 	io.netty.buffer.AbstractByteBuf.getInt(AbstractByteBuf.java:378) ~[netty-buffer-4.0.7.Final.jar:na]
> 	org.apache.drill.exec.vector.UInt4Vector$Accessor.get(UInt4Vector.java:188) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
> 	org.apache.drill.exec.vector.VarBinaryVector$Mutator.setValueCount(VarBinaryVector.java:355) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
> 	org.apache.drill.exec.physical.impl.svremover.RemovingRecordBatch.doWork(RemovingRecordBatch.java:92) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
> 	org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:63) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
> 	org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:42) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
> 	org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:42) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
> 	org.apache.drill.exec.physical.impl.limit.LimitRecordBatch.next(LimitRecordBatch.java:89) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
> 	org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:42) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
> 	org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.next(ScreenCreator.java:77) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
> 	org.apache.drill.exec.work.FragmentRunner.run(FragmentRunner.java:79) ~[drill-java-exec-1.0.0-m2-incubating-SNAPSHOT-rebuffed.jar:1.0.0-m2-incubating-SNAPSHOT]
> 	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
> 	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
> 	java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]



--
This message was sent by Atlassian JIRA
(v6.1#6144)