comphead opened a new pull request, #57413:
URL: https://github.com/apache/spark/pull/57413
### What changes were proposed in this pull request?
Clarify the `array_contains` documentation:
- `sql/api/.../functions.scala`: rewrote the Scaladoc summary to cover all
three return cases (true / false / null).
- `sql/catalyst/.../collectionOperations.scala`: added a SQL example
showing the null result when the value is absent but the array contains a null
element.
### Why are the changes needed?
The old docs said `array_contains` returns "false otherwise", omitting the
null-propagation case:
```
scala> spark.sql("select array_contains(array(1, null, 3), 2)").show(false)
+------------------------------------+
|array_contains(array(1, NULL, 3), 2)|
+------------------------------------+
|NULL |
+------------------------------------+
```
### Does this PR introduce _any_ user-facing change?
No. Documentation-only.
### How was this patch tested?
N/A — docs only.
### Was this patch authored or co-authored using generative AI tooling?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]