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
The EQL v3 JSON domain accepts an empty searchable vector, but ste_vec()
aggregates zero rows to SQL NULL. As a result, jsonb_array_length returns NULL instead of zero and jsonb_array_elements raises SQLSTATE 22004 because
its FOR loop has a null upper bound.
Acceptance criteria
The length of an encrypted empty JSON array is zero.
jsonb_array_elements returns zero rows without error.
Populated-array behaviour is unchanged.
Tests exercise a real encrypted empty-array payload as well as the SQL helper
boundary.
The implementation composes with the umbrella array aggregation design.
How the EQL v4 json_tree family (#1288, #1325, #1329) handles the empty array, for comparison, plus one gap it has of its own.
In v4 an empty array is a node whose encrypted plaintext says kind array, child count zero. eql_v4.json_tree_child_count returns 0 and json_tree_children returns no rows, with no null loop bound anywhere; a walk that reaches the empty array through gates (json_tree_subtree_at) returns the node itself at depth 0 and the client opens it to [].
The gap: an empty container that is a chain head (a top-level field under the sealed root). json_tree_subtree(doc, token) returns a node's descendants, not the node, so an empty $.tags yields no rows and the client reports "a node with children" instead of []; and -> on its selector returns the node, which the client refuses to open because a container holds no value of its own. The fix is small and client-side: an extracted container node with zero children should open to its empty value. Not filed separately yet; I will unless someone objects to tracking it under this issue.
v3's ste_vec() aggregation is unchanged by the v4 work.
Activity
coderdan commentedon Oct 21, 2026
How the EQL v4
json_treefamily (#1288, #1325, #1329) handles the empty array, for comparison, plus one gap it has of its own.In v4 an empty array is a node whose encrypted plaintext says kind array, child count zero.
eql_v4.json_tree_child_countreturns 0 andjson_tree_childrenreturns no rows, with no null loop bound anywhere; a walk that reaches the empty array through gates (json_tree_subtree_at) returns the node itself at depth 0 and the client opens it to[].The gap: an empty container that is a chain head (a top-level field under the sealed root).
json_tree_subtree(doc, token)returns a node's descendants, not the node, so an empty$.tagsyields no rows and the client reports "a node with children" instead of[]; and->on its selector returns the node, which the client refuses to open because a container holds no value of its own. The fix is small and client-side: an extracted container node with zero children should open to its empty value. Not filed separately yet; I will unless someone objects to tracking it under this issue.v3's
ste_vec()aggregation is unchanged by the v4 work.