PS (to my previous note) - I suspect this function is assuming the bits
it's passed are a string, and not checking to ensure that first. One
question related to this would be whether the desired behavior on the
second record would be a runtime type error or the treatment of the
offending data as null (which then raises the issue of null semantics
for functions) - I would be inclined (w/o too much thought yet) to say
that this should raise a runtime type error. Another question related
to this is whether the author of each function should have to handle
wrong types and nulls for each parameter each time - or live in a
function invocation wrapping framework that provides some default
answers for those behaviors? Thoughts?
On 8/14/15 8:45 AM, Wail Alkowaileet wrote:
Hello Team,
I was testing some of Asterix built-in functions and I ran into a bug
if the fields are heterogeneous.
Reproduce the Problem:
let $k := [{"a":1, "b":"hello"}, {"a":2, "b":{"k": [1,2,2]}}]
for $x in $k
where $x.a = 1
return string-concat([$x.b, " world"])
Result:
summary: "edu.uci.ics.hyracks.api.exceptions.HyracksDataException:
java.lang.ArrayIndexOutOfBoundsException: 64
if the 2nd "b" is string as well, the issue doesn't appear.
logs attached.
--
*Regards,*
Wail Alkowaileet