The error is unexpected, possibly a bug. I'll raise it internally for investigation.
EDIT
Okay, here's what I found while tinkering:
This looks to be a bug when a function (such as toLower(), toUpper(), or toString(), and likely others) is part of a predicate that involves usage of some of our substring predicates: CONTAINS
, STARTS WITH
, and ENDS WITH
, and when one of the values processed by the function is not present (effectively null).
A minimal reproduction without needing any data is:
RETURN toLower(null) CONTAINS 'love'
If we do not use the substring predicates, and instead use =
, <>
, or the greater-than / less-than operators, we do not encounter the error.
As mentioned above, I'm raising this internally for tracking and fixing.