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.
The EQL v3 JSON domain accepts an empty searchable vector, but
ste_vec()aggregates zero rows to SQL
NULL. As a result,jsonb_array_lengthreturnsNULLinstead of zero andjsonb_array_elementsraises SQLSTATE 22004 becauseits
FORloop has a null upper bound.Acceptance criteria
jsonb_array_elementsreturns zero rows without error.boundary.