Please note that the use of where clause after group by clause is incorrect,
where clause needs to come before the group by clause in the query, doing that
gives desired results. However, if the where is put after the group by clause,
we see a null [ ] being returned. A better message should be returned to user
instead of the null.
What steps will reproduce the problem?
Start asterix using managix, one CC and NC. And run the query from Web UI.
Execute these statements from Web UI session one;
drop dataverse test if exists;
create dataverse test;
use dataverse test;
create type Schema as closed {
unique1: int32,
unique2: int32,
two: int32,
four: int32,
ten: int32,
twenty: int32,
onePercent: int32,
tenPercent: int32,
twentyPercent: int32,
fiftyPercent: int32,
unique3: int32,
evenOnePercent: int32,
oddOnePercent: int32,
stringu1: string,
stringu2: string,
string4: string
}
create dataset tenktup1(Schema) primary key unique2 ;
load dataset tenktup1 using localfs
(("path"="localhost:///home/kfmohamm/data-gen/one-mil-tup.adm"),("format"="delim
ited-text"),("delimiter"="|")) pre-sorted;
Execute this query from Web UI session two;
use dataverse test;
for $l in dataset tenktup1
let $id := $l.unique2
group by $m := $l.unique3 with $id
where $id > 25000 and $id < 75000
return { "grp-by-key":$m, "grp-members":$id }
returns:
null [ ]
Here is the stack trace from CC.log
INFO: Executing:
edu.uci.ics.hyracks.control.cc.work.WaitForJobCompletionWork@26230076
edu.uci.ics.hyracks.api.exceptions.HyracksException: Job failed on account of:
null
at edu.uci.ics.hyracks.control.cc.job.JobRun.waitForCompletion(JobRun.java:190)
at edu.uci.ics.hyracks.control.cc.work.WaitForJobCompletionWork$2.run(WaitForJobCompletionWork.java:58)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:538)
at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:359)
at edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAccessor.getTupleStartOffset(FrameTupleAccessor.java:65)
at edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder.addField(ArrayTupleBuilder.java:90)
at edu.uci.ics.hyracks.dataflow.std.group.preclustered.PreclusteredGroupWriter.writeOutput(PreclusteredGroupWriter.java:120)
at edu.uci.ics.hyracks.dataflow.std.group.preclustered.PreclusteredGroupWriter.close(PreclusteredGroupWriter.java:158)
at edu.uci.ics.hyracks.dataflow.std.group.preclustered.PreclusteredGroupOperatorNodePushable.close(PreclusteredGroupOperatorNodePushable.java:82)
at edu.uci.ics.hyracks.dataflow.std.sort.ExternalSortRunMerger.process(ExternalSortRunMerger.java:159)
at edu.uci.ics.hyracks.dataflow.std.sort.ExternalSortOperatorDescriptor$MergeActivity$1.initialize(ExternalSortOperatorDescriptor.java:177)
at edu.uci.ics.hyracks.api.rewriter.runtime.SuperActivityOperatorNodePushable.initialize(SuperActivityOperatorNodePushable.java:81)
at edu.uci.ics.hyracks.control.nc.Task.run(Task.java:228)
... 3 more
Jun 12, 2013 1:46:55 PM edu.uci.ics.asterix.api.http.servlet.APIServlet doPost
SEVERE: Job failed on account of:
null
edu.uci.ics.hyracks.api.exceptions.HyracksException: Job failed on account of:
null
at edu.uci.ics.hyracks.control.cc.job.JobRun.waitForCompletion(JobRun.java:190)
at edu.uci.ics.hyracks.control.cc.work.WaitForJobCompletionWork$2.run(WaitForJobCompletionWork.java:58)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:538)
at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:359)
at edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAccessor.getTupleStartOffset(FrameTupleAccessor.java:65)
at edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder.addField(ArrayTupleBuilder.java:90)
at edu.uci.ics.hyracks.dataflow.std.group.preclustered.PreclusteredGroupWriter.writeOutput(PreclusteredGroupWriter.java:120)
at edu.uci.ics.hyracks.dataflow.std.group.preclustered.PreclusteredGroupWriter.close(PreclusteredGroupWriter.java:158)
at edu.uci.ics.hyracks.dataflow.std.group.preclustered.PreclusteredGroupOperatorNodePushable.close(PreclusteredGroupOperatorNodePushable.java:82)
at edu.uci.ics.hyracks.dataflow.std.sort.ExternalSortRunMerger.process(ExternalSortRunMerger.java:159)
at edu.uci.ics.hyracks.dataflow.std.sort.ExternalSortOperatorDescriptor$MergeActivity$1.initialize(ExternalSortOperatorDescriptor.java:177)
at edu.uci.ics.hyracks.api.rewriter.runtime.SuperActivityOperatorNodePushable.initialize(SuperActivityOperatorNodePushable.java:81)
at edu.uci.ics.hyracks.control.nc.Task.run(Task.java:228)
... 3 more
Asterix version:0.8.1-SNAPSHOT
Original issue reported on code.google.com by khfaraaz82 on 12 Jun 2013 at 9:30
Original issue reported on code.google.com by
khfaraaz82
on 12 Jun 2013 at 9:30