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
Adding additional relational simplification patterns for datetime comparisons (#405)
Patterns include:
- Switch comparisons between `QUARTER(x)` and a literal use `MONTH(x)` instead, e.g. `QUARTER(x) == 2` becomes `ISIN(MONTH(x), [4, 5, 6])`
- Having patterns such as `MONTH(x) < 0` return False and `HOUR(x) <= 60` return True
- Simplify `DATETIME(DATETIME(u, v, w), x, y, z)` -> `DATETIME(u, v, w, x, y, z)`
- Simplify a chain of `DATETIME` information on a literal to produce the final literal (e.g. `DATETIME('2024-13-05', '+25 days', 'start of month')` -> `'2024-02-01`)
- Simplify datetime part extraction on literals, e.g. `YEAR('2023-01-01')` ->` 2023`
- Infer that a column `x` is non-null if it is used in a filter / join condition (for an inner/semi join) where the condition would be false if `x` were NULL
- Simplify more functions to a NULL literal if any of their arguments are a NULL literal.
0 commit comments