Tpt opened a new pull request, #27793: URL: https://github.com/apache/datafusion/pull/27793
## Rationale for this change Add support for PostgreSQL syntax `SELECT [1, 2] && [2, 3]`. DataFusion already has the matching function, `array_has_any` (alias `arrays_overlap`), and already plans the containment operators `@>` / `<@` to `array_has_all`. ## What changes are included in this PR? - `NestedFunctionPlanner::plan_binary_op` plans `array1 && array2` as `array_has_any(array1, array2)` when both operands are lists. Other operands fall through unchanged, so `1 && 2` still fails with the same error, and other planners can still handle `&&` (e.g. geometry types). - Documentation of `&&` in the SQL operators page. ## What is the testing strategy for this PR? sqllogictest cases in `array/array_operators.slt`, limited to the rewrite (the semantics of `array_has_any` are already covered in `array_has.slt`): - `&&` on `List`, `LargeList` and `FixedSizeList` operands; - an `explain` showing the rewrite to `array_has_any`; - `select 1 && 2` still fails with the unsupported-operator error. ## Are there any user-facing changes? Yes: a new SQL operator `&&` on arrays, documented in the operators page. No public API change. -- 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]
