Write aborts with EOFException

33 views
Skip to first unread message

Max Heimel

unread,
Jan 12, 2011, 7:20:12 AM1/12/11
to jaql-...@googlegroups.com
Hello,

I am using a UDF to process an array of input records. Each call to func() returns an array of arrays.

   result = for (i in instances)  union( func( i ) ) ;

This call always suceesds without an error. However, if I try to store the result.

   result -> write({type:"local", location:"out.txt"});

I receive the following exception, if the original input was "large" (for small inputs no exception is thrown):

java.lang.reflect.UndeclaredThrowableException
at com.ibm.jaql.json.util.JsonIterator.hasNext(JsonIterator.java:152)
at com.ibm.jaql.lang.expr.io.AbstractWriteExpr.eval(AbstractWriteExpr.java:83)
at com.ibm.jaql.lang.expr.top.QueryExpr.eval(QueryExpr.java:85)
at com.ibm.jaql.lang.StreamPrinter.print(StreamPrinter.java:63)
at com.ibm.jaql.lang.Jaql.run(Jaql.java:597)
at com.ibm.jaql.lang.Jaql.run(Jaql.java:109)
at com.ibm.jaql.util.shell.AbstractJaqlShell.run(AbstractJaqlShell.java:54)
at com.ibm.jaql.util.shell.AbstractJaqlShell.main(AbstractJaqlShell.java:100)
at JaqlShell.main(JaqlShell.java:309)
Caused by: java.io.EOFException
at com.ibm.jaql.util.SpillFile$SFDataInput.reposition(SpillFile.java:225)
at com.ibm.jaql.util.SpillFile$SFDataInput.readFully(SpillFile.java:262)
at com.ibm.jaql.util.SpillFile$SFDataInput.readUnsignedByte(SpillFile.java:403)
at com.ibm.jaql.util.BaseUtil.readVUInt(BaseUtil.java:327)
at com.ibm.jaql.io.serialization.binary.def.DefaultBinaryFullSerializer.read(DefaultBinaryFullSerializer.java:93)
at com.ibm.jaql.io.serialization.binary.def.DefaultBinaryFullSerializer.read(DefaultBinaryFullSerializer.java:33)
at com.ibm.jaql.json.type.SpilledJsonArray$1.moveNext(SpilledJsonArray.java:212)
at com.ibm.jaql.lang.expr.core.ForExpr$1.moveNext(ForExpr.java:233)
at com.ibm.jaql.json.util.JsonIterator.hasNext(JsonIterator.java:149)

Any ideas what could have happend here?

Thanks
Max

Max Heimel

unread,
Jan 13, 2011, 12:15:02 PM1/13/11
to jaql-...@googlegroups.com
As a follow-up,

the error occors only, if I use SpilledJsonArray to construct the Output in my Java UDF. When I use BufferedJsonArray everything works fine.

Max Heimel

unread,
Jan 13, 2011, 3:12:52 PM1/13/11
to jaql-...@googlegroups.com
And another follow-up. :)

The problem was apparently caused by me forgetting to clear the result array at the start of each method invocation...
Reply all
Reply to author
Forward
0 new messages