You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQL: CONTAINS with an array (not List) right-hand side never matches #6995
ContainsCondition.execute() only normalizes a plain array (String[], int[], ...) to a List when it appears on the left-hand side of CONTAINS (fixed in #6984 / PR #6993). When the array is on the right-hand side instead, it still falls through to the per-element equalsInContainsSpace(o, right) loop, which compares each left-hand element against the whole array object - so the condition is essentially always false.
Repro
SELECT ('a b c'.split('') CONTAINS 'x y'.split(''))
'x y'.split(' ') is a String[], so it never equals any of ['a','b','c']'s elements - the condition returns false even for overlapping content, and there's no working way to express "these two split() results share an element" without wrapping one side in a list-producing function.
Where
engine/src/main/java/com/arcadedb/query/sql/parser/ContainsCondition.java, execute(Object, Object) - the right instanceof Collection check (and the right instanceof Iterable fallback below it) both miss a plain array, same root cause as #6984 but on the other side of the operator.
Suggested fix
Normalize right the same way #6993 normalizes left: if right is an array, convert it to a List before the existing Collection/Iterable branches run.
Filed as a follow-up noted during review of PR #6993 (out of scope for #6984, which only reported the left-hand-side case).
CONTAINS now treats an array on the right the same as the equivalent list, so 'a b c'.split(' ') CONTAINS 'a'.split(' ') and a parameter bound to a Java array both work instead of never matching.
Note the meaning of CONTAINS with a collection on the right is unchanged: a single-item collection is unwrapped and its item looked up, while a longer one is searched for as one element of the left-hand list (tags CONTAINS ['a','b'] matches a row whose tags contains the list ['a','b']). To test membership of several values, use one condition per value.
One deliberate exception: a BINARY value on the right stays a single value, so list CONTAINS :binary still searches for that binary rather than for its bytes.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Activity
doc(#6984): explain why the array left-hand-side normalization recurses
review(#6995): keep the byte[] carve-out on the right-hand side only
Merge pull request #7079 from ArcadeData/fix/6995-7056-7029-6998
lvca commentedon Sep 3, 2026
Fixed in #7079, shipping in 26.9.1.
CONTAINSnow treats an array on the right the same as the equivalent list, so'a b c'.split(' ') CONTAINS 'a'.split(' ')and a parameter bound to a Java array both work instead of never matching.Note the meaning of
CONTAINSwith a collection on the right is unchanged: a single-item collection is unwrapped and its item looked up, while a longer one is searched for as one element of the left-hand list (tags CONTAINS ['a','b']matches a row whosetagscontains the list['a','b']). To test membership of several values, use one condition per value.One deliberate exception: a
BINARYvalue on the right stays a single value, solist CONTAINS :binarystill searches for that binary rather than for its bytes.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(ArcadeData#6995,ArcadeData#7056,ArcadeData#7029,ArcadeData#6998):…