You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sqlalchemy.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1104,14 +1104,17 @@ Slice stops are inclusive, following SQLAlchemy's SQL array convention.
1104
1104
Omitted boundaries mean the beginning or end of the array; explicit boundaries are clipped to the array.
1105
1105
A reversed slice returns an empty array, and slicing a NULL array returns NULL.
1106
1106
Only `step=None` and `step=1` are supported.
1107
+
Slice SQL can evaluate the array and boundary expressions more than once; use deterministic expressions rather than volatile functions such as `random()` in slices.
1107
1108
Use `AthenaArray` for open-ended slices with `zero_indexes=True`; SQLAlchemy's generic `ARRAY` comparator requires explicit bounds in that mode.
1108
1109
Indexing a multidimensional array retains the remaining dimensions, while slicing retains its array type.
1109
1110
1110
1111
`any_(array)` and `all_(array)`, and the legacy `array.any(value)` and `array.all(value)` methods, compile to Athena's `any_match` and `all_match` functions.
1111
1112
Comparisons use SQL three-valued logic: NULL elements can produce NULL when no decisive true or false result exists.
1112
1113
For an empty array, ANY is false and ALL is true.
1113
1114
A NULL array produces NULL for both.
1114
-
SQLAlchemy comparison flipping and negation are preserved.
1115
+
SQLAlchemy comparison flipping is preserved.
1116
+
For boolean comparisons, SQLAlchemy can turn `~(any_(flags) == True)` into an element-wise `!= True` comparison before dialect compilation.
1117
+
To negate the whole match, explicitly group the comparison first: `~(any_(flags) == True).self_group()`.
1115
1118
Quantifiers over subqueries retain their usual SQL compilation.
0 commit comments