I think this exception has to do with the fact that $popularDocIDs was
materialized. Please see the following exception when the first
statement succeed, and the second statement which uses a materialized
variable fails with the same IllegalArgumentException
# successful execution
jaql> join $docs, $relations where $docs.docid == $relations.docid
into {$relations.*} -> group by docid=$.docid into {docid, N:
count($)} -> top 10 by [$.N desc];
[
{
"docid": 1745119925,
"N": 2
},
{
"docid": 1745321350,
"N": 2
},
{
"docid": 1745519229,
"N": 2
},
{
"docid": 1746309602,
"N": 2
},
{
"docid": 1756177636,
"N": 2
},
{
"docid": 1756459099,
"N": 2
},
{
"docid": 1761047532,
"N": 2
},
{
"docid": 1761177742,
"N": 2
},
{
"docid": 1764934260,
"N": 2
},
{
"docid": 1765026381,
"N": 2
}
]
## Same sequence fails when using a materialized variable !!! #
jaql> $popularDocIDs = join $docs, $relations where $docs.docid ==
$relations.docid into {$relations.*} -> group by docid=$.docid into
{docid, N: count($)};
jaql> materialize $popularDocIDs;
"$popularDocIDs"
jaql> $popularDocIDs-> top 10 by [$.N desc];
[
{
"N": java.lang.IllegalArgumentException: value not matched by this
serializer
at
com.ibm.jaql.io.serialization.text.schema.SchemaTextFullSerializer
$DefaultBasicSerializer.write(SchemaTextFullSerializer.java:175)
at
com.ibm.jaql.io.serialization.text.schema.SchemaTextFullSerializer.write(SchemaTextFullSerializer.java:
96)
at
com.ibm.jaql.io.serialization.text.TextFullSerializer.write(TextFullSerializer.java:
36)
at
com.ibm.jaql.io.serialization.text.schema.RecordSerializer.write(RecordSerializer.java:
108)
at
com.ibm.jaql.io.serialization.text.schema.RecordSerializer.write(RecordSerializer.java:
33)
at
com.ibm.jaql.io.serialization.text.schema.SchemaTextFullSerializer.write(SchemaTextFullSerializer.java:
96)
at com.ibm.jaql.json.util.JsonIterator.print(JsonIterator.java:
250)
at com.ibm.jaql.lang.StreamPrinter.print(StreamPrinter.java:
59)
at com.ibm.jaql.lang.Jaql.run(Jaql.java:561)
at com.ibm.jaql.lang.Jaql.run(Jaql.java:95)
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:322)