Commit 7fbd000
Fix timezone handling in to_timestamp functions (#136)
* Fix TIMESTAMP_NTZ cast not stripping timezone from timestamp_tz input
to_timestamp_ntz had early-return paths in return_field_from_args and
invoke_with_args that preserved the input timestamp type as-is, including
its timezone. This caused convert_timezone(...)::TIMESTAMP_NTZ to return
timestamp_tz instead of timestamp_ntz. Now both paths apply the function's
timezone policy via self.timezone(), which returns None for NTZ variants.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(clippy): use Copy deref instead of clone on TimeUnit
TimeUnit implements Copy, so unit.clone() triggers clippy::clone_on_copy
(denied via clippy::all in workspace lints). Use *unit to satisfy the lint.
https://claude.ai/code/session_01YUH8HvzyjxmHtjrNcALJXj
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ebc8a17 commit 7fbd000
3 files changed
Lines changed: 26 additions & 8 deletions
File tree
- crates
- executor/src
- tests/sql/functions/timestamp/snapshots/to_timestamp
- functions/src/conversion
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
950 | 950 | | |
951 | 951 | | |
952 | 952 | | |
953 | | - | |
| 953 | + | |
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
| 208 | + | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
213 | 217 | | |
214 | 218 | | |
215 | | - | |
| 219 | + | |
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
| |||
317 | 321 | | |
318 | 322 | | |
319 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
320 | 338 | | |
321 | 339 | | |
322 | 340 | | |
| |||
0 commit comments