Commit 1e68674
authored
doc: Add documentation explaining the behavior of
## Which issue does this PR close?
- Closes #.
## Rationale for this change
DataFusion already supports tuple-like and `STRUCT` comparisons, but the
user-facing documentation did not clearly describe the current
comparison semantics, especially around lexicographical ordering and
`NULL` handling. The `IN` documentation also did not explain tuple-like
values.
## What changes are included in this PR?
- Added a short `STRUCT` comparison note to
[struct_coercion.md](/Users/jensen/code/datafusion/docs/source/user-guide/sql/struct_coercion.md),
documenting that:
- `STRUCT` values support standard comparison operators
- comparisons are lexicographical by field order
- `NULL` is ordered before non-`NULL`
- Added minimal examples for `STRUCT` comparisons, including a `NULL`
example
- Added a short note to
[subqueries.md](/Users/jensen/code/datafusion/docs/source/user-guide/sql/subqueries.md)
explaining that tuple-like `IN` uses DataFusion's struct equality
semantics
- Added a concrete example:
- `SELECT (7521, 30) IN ((7521, NULL));`
- result: `false`
## Are these changes tested?
No new tests were added. This PR only updates documentation for existing
behavior, and the documented behavior is already covered by existing
tuple/struct comparison and `IN` tests.
## Are there any user-facing changes?
Yes. This PR updates the SQL user documentation to clarify the current
semantics of `STRUCT` comparisons and tuple-like `IN` expressions.null values in struct comparisons (#21226)1 parent bc2b36c commit 1e68674
5 files changed
Lines changed: 42 additions & 2 deletions
File tree
- datafusion/functions/src/core
- docs/source/user-guide/sql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4709 | 4709 | | |
4710 | 4710 | | |
4711 | 4711 | | |
| 4712 | + | |
| 4713 | + | |
4712 | 4714 | | |
4713 | 4715 | | |
4714 | 4716 | | |
| |||
4750 | 4752 | | |
4751 | 4753 | | |
4752 | 4754 | | |
| 4755 | + | |
| 4756 | + | |
4753 | 4757 | | |
4754 | 4758 | | |
4755 | 4759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
211 | 231 | | |
212 | 232 | | |
213 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
105 | 117 | | |
106 | 118 | | |
107 | 119 | | |
| |||
0 commit comments