Fix querying an array field with empty arrays.

Previously for an array field, when a nil value was passed for querying it was compacted, and proper handling

of value in such compacted array was done there onwards to generate SQL.

This commit tried to expand this behavior to handle empty arrays the same way as an array with nil values,
for proper SQL generation while querying an array field.

Fixes #13479 .