-
Notifications
You must be signed in to change notification settings - Fork 212
feat!: honor reader timezone in partition values #3119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -249,9 +249,9 @@ If the scan has no predicate, this returns `None`. | |
| ## Typed partition values | ||
|
|
||
| Kernel reads each file's partition values from the Delta log and exposes them on its | ||
| `ScanFile` as a raw string map. Kernel's `transform_to_logical` could materialize them as | ||
| typed columns. If your connector assembles output rows itself instead of using that transform, | ||
| it parses the string map per file. | ||
| `ScanFile` as a raw string map. `transform_to_logical` materializes them as typed columns. A | ||
| connector that assembles output rows itself instead of using that transform would otherwise need | ||
| to parse the string map per file. | ||
|
|
||
| To have Kernel hand you the typed values directly, opt in with `with_partition_values`: | ||
|
|
||
|
|
@@ -270,7 +270,10 @@ To have Kernel hand you the typed values directly, opt in with `with_partition_v | |
| # let snapshot = Snapshot::builder_for(url).build(&engine)?; | ||
| let scan = snapshot | ||
| .scan_builder() | ||
| .with_partition_values(PartitionValuesOptions::with_struct()) | ||
| .with_partition_values( | ||
| PartitionValuesOptions::with_struct() | ||
| .with_timestamp_timezone("America/Los_Angeles"), | ||
| ) | ||
| .build()?; | ||
| # Ok(()) | ||
| # } | ||
|
|
@@ -281,9 +284,21 @@ nullable field per partition column (by physical name). You read it as a typed c | |
| of parsing the string map per file. The raw string map is still present, so this option only | ||
| adds the typed column. | ||
|
|
||
| By default, offset-less `TIMESTAMP` partition strings are interpreted in UTC. Use | ||
| `with_timestamp_timezone` with a recognized IANA timezone or a normalized `+HH:MM`, `-HH:MM`, | ||
| `+HH:MM:SS`, or `-HH:MM:SS` fixed offset when the reader uses another timezone. An explicit offset | ||
|
DrakeLin marked this conversation as resolved.
|
||
| or embedded time zone in a partition value takes precedence. This setting affects typed | ||
| `scan_metadata` output, partition predicate evaluation after log replay, and the partition-column | ||
| row transforms used by `Scan::execute`. Checkpoint footer pruning continues to use the | ||
|
DrakeLin marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blocker1 Checkpoint native partition pruning (kernel/src/scan/scan_plan.rs:185-192 via build_actions_partition_predicate) evaluates the query predicate against native partitionValues_parsed, which is parsed in UTC, while surviving rows are reparsed with the reader timezone. With a non-UTC with_timestamp_timezone, an offset-less TIMESTAMP partition value is instant U natively but U+offset after reparse, so a file whose reader-timezone value matches the predicate can be definitively rejected by its UTC value and pruned. The |
||
| checkpoint's native parsed partition values. Incremental scans expose the raw partition-value map. | ||
| `TIMESTAMP_NTZ` remains timezone-independent. For daylight-saving transitions, ambiguous local | ||
| times use the earlier instant, and nonexistent local times use the offset from before the | ||
| transition. | ||
|
|
||
| > [!TIP] | ||
| > When the checkpoint already stores typed partition values, Kernel reads that column directly | ||
| > and skips parsing entirely. | ||
| > Kernel reparses surviving commit and checkpoint rows from the raw map for typed output and final | ||
| > predicate evaluation. Checkpoint footer pruning happens first and continues to use the | ||
| > checkpoint's native parsed partition values. | ||
|
|
||
|
DrakeLin marked this conversation as resolved.
|
||
| ## Cancelling a scan | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.