Skip to content

Commit 2fa676e

Browse files
localstack-spiral[bot]spiralsabir-akhadov-localstackgithub-actions[bot]
authored
LAV-4052: PERIOD types, literals, storage, constructor and accessor values (#4395)
* LAV-4052: implement PERIOD types, values, storage and accessors Register five fixed-size base types using consecutive existing temporal endpoint encodings. Normalize PERIOD syntax on the AST, preserve declared column typmods, transport text over JSON/Arrow, and return temporal accessor types. Reject invalid bounds/text with captured Cloud errors and attribute INSERT/CTAS failures to their target columns. Document the type mechanisms. Capture only the new PERIOD snapshots against Cloud. Existing snapshots and catalog projections are unchanged; no edition gate or general ordering added. PERIOD_CONSTRUCT, PERIOD_BEGIN and PERIOD_END score as supported. Verification: - Serial Cloud capture: 141 passed with --snapshot-update --runxfail, plus 16 additional CTAS error cases captured against Cloud. - make check: passed. - Focused PERIOD replay: 147 passed, 10 strict-xfailed staged sibling cases. - UUID, INTERVAL, SYSTEM$TYPEOF and interval-column regression replay: 226 passed. - git diff --check: passed. Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud> ## Deviations Cloud distinguishes canonical computed text from session-formatted stored values. LTZ constructor materialization also interprets canonical UTC-looking endpoints as session-local wall times. Implemented those captured distinctions with AST-selected internal storage constructors instead of uniform rendering. The added storage-scale boundary capture rejects constructor result scale 9 against declared PERIOD scale 3 with 002023 before coercion. These four cases are strict-xfailed for LAV-4057 because enforcing that result-scale compatibility requires the separately owned function-result typmod propagation mechanism. ## Test matrix DATE constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values DATE constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values DATE constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds DATE constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds DATE BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values DATE BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values DATE constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire DATE typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip DATE explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns DATE stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns DATE stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire DATE default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats DATE INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor DATE invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint DATE CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIME constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIME constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIME constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIME constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIME BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIME BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIME constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIME typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIME explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIME stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIME stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIME default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIME INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIME invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIME CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIMESTAMP_NTZ constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_NTZ constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_NTZ constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_NTZ constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_NTZ BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_NTZ BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_NTZ constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIMESTAMP_NTZ typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIMESTAMP_NTZ explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_NTZ stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_NTZ stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIMESTAMP_NTZ default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIMESTAMP_NTZ INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIMESTAMP_NTZ invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIMESTAMP_NTZ CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIMESTAMP_LTZ constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_LTZ constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_LTZ constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_LTZ constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_LTZ BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_LTZ BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_LTZ constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIMESTAMP_LTZ typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIMESTAMP_LTZ explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_LTZ stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_LTZ stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIMESTAMP_LTZ default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIMESTAMP_LTZ INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIMESTAMP_LTZ invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIMESTAMP_LTZ CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIMESTAMP_TZ constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_TZ constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_TZ constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_TZ constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_TZ BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_TZ BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_TZ constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIMESTAMP_TZ typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIMESTAMP_TZ explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_TZ stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_TZ stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIMESTAMP_TZ default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIMESTAMP_TZ INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIMESTAMP_TZ invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIMESTAMP_TZ CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIME explicit stored scales 0/3/6, CTAS retention, DESC/TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_scale TIME scale-3 stored constructor happy/error paths -> tests/queries/functions/test_period_types.py::test_period_stored_constructor_scale TIME invalid endpoint cast error -> tests/queries/functions/test_period_types.py::test_period_invalid_endpoint TIME adjacent nanosecond bounds and explicit scale-collapse error -> tests/queries/functions/test_period_types.py::test_period_nanosecond_boundary TIME VALUES equal/inverted temporal bounds and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_temporal_constructor TIME function-result/storage scale compatibility (strict-xfail LAV-4057) -> tests/queries/functions/test_period_types.py::test_period_expression_storage_scale_compatibility TIMESTAMP_NTZ explicit stored scales 0/3/6, CTAS retention, DESC/TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_scale TIMESTAMP_NTZ scale-3 stored constructor happy/error paths -> tests/queries/functions/test_period_types.py::test_period_stored_constructor_scale TIMESTAMP_NTZ invalid endpoint cast error -> tests/queries/functions/test_period_types.py::test_period_invalid_endpoint TIMESTAMP_NTZ adjacent nanosecond bounds and explicit scale-collapse error -> tests/queries/functions/test_period_types.py::test_period_nanosecond_boundary TIMESTAMP_NTZ VALUES equal/inverted temporal bounds and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_temporal_constructor TIMESTAMP_NTZ function-result/storage scale compatibility (strict-xfail LAV-4057) -> tests/queries/functions/test_period_types.py::test_period_expression_storage_scale_compatibility TIMESTAMP_LTZ explicit stored scales 0/3/6, CTAS retention, DESC/TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_scale TIMESTAMP_LTZ scale-3 stored constructor happy/error paths -> tests/queries/functions/test_period_types.py::test_period_stored_constructor_scale TIMESTAMP_LTZ invalid endpoint cast error -> tests/queries/functions/test_period_types.py::test_period_invalid_endpoint TIMESTAMP_LTZ adjacent nanosecond bounds and explicit scale-collapse error -> tests/queries/functions/test_period_types.py::test_period_nanosecond_boundary TIMESTAMP_LTZ VALUES equal/inverted temporal bounds and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_temporal_constructor TIMESTAMP_LTZ function-result/storage scale compatibility (strict-xfail LAV-4057) -> tests/queries/functions/test_period_types.py::test_period_expression_storage_scale_compatibility TIMESTAMP_TZ explicit stored scales 0/3/6, CTAS retention, DESC/TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_scale TIMESTAMP_TZ scale-3 stored constructor happy/error paths -> tests/queries/functions/test_period_types.py::test_period_stored_constructor_scale TIMESTAMP_TZ invalid endpoint cast error -> tests/queries/functions/test_period_types.py::test_period_invalid_endpoint TIMESTAMP_TZ adjacent nanosecond bounds and explicit scale-collapse error -> tests/queries/functions/test_period_types.py::test_period_nanosecond_boundary TIMESTAMP_TZ VALUES equal/inverted temporal bounds and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_temporal_constructor TIMESTAMP_TZ function-result/storage scale compatibility (strict-xfail LAV-4057) -> tests/queries/functions/test_period_types.py::test_period_expression_storage_scale_compatibility TIME scales 0/3/6; NTZ scale 3; LTZ scale 6; TZ scale 3 casts/TYPEOF -> tests/queries/functions/test_period_types.py::test_period_declared_scale DATE malformed text, brackets, missing endpoints -> tests/queries/functions/test_period_types.py::test_period_invalid_text DATE malformed/empty/inverted storage and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_invalid_storage DATE whitespace/year-0001 boundary and malformed/nonfinite endpoint errors -> tests/queries/functions/test_period_types.py::test_period_text_boundaries DATE VALUES equal/inverted bounds, direct/Nested/Cast error shapes -> tests/queries/functions/test_period_types.py::test_period_values_invalid_constructor DATE INSERT SELECT/CREATE OR REPLACE error attribution and preserved rows -> tests/queries/functions/test_period_types.py::test_period_select_invalid_constructor DATE CTAS explicit column names and projection ordinal error attribution -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor_column_names DATE/LTZ query parentheses, UNION, Nested, PERIOD cast, VARCHAR cast materialization -> tests/queries/functions/test_period_types.py::test_period_materialized_query_shape NTZ/LTZ/TZ pre-epoch nanosecond text precision -> tests/queries/functions/test_period_types.py::test_period_nanosecond_boundary TZ distinct endpoint offsets and nanosecond text precision -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TZ equal UTC instant with different offsets, both directions -> tests/queries/functions/test_period_types.py::test_period_tz_equal_instant, test_period_tz_equal_instant_reverse bare NULL BEGIN/END values and wire metadata -> tests/queries/functions/test_period_types.py::test_period_bare_null_accessors invalid argument families, mixed-family constructor, PERIOD-to-VARIANT (strict-xfail LAV-4053) -> tests/queries/functions/test_period_types.py::test_period_argument_compatibility expression-derived BEGIN/END/PERIOD result scale, TYPEOF and CTAS DESC (strict-xfail LAV-4057) -> tests/queries/functions/test_period_types.py::test_period_expression_scale * LAV-4052: wip (budget exhausted: wall_clock) Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud> * LAV-4052: investigator: finish the three pending captures, then repair G1-G3 Verified on 2026-10-09: git status --porcelain is empty. Spec-advancing commits aa1c26c9b and 403af4e3b preserve the implementation and the new reviewer-gap tests. This is the first wall-clock exhaustion in the supplied episode; attempt 1 was a sibling-ID block resolved by the human, not an exhaustion clear. Evidence: /var/lib/spiral/transcripts/driver.log records the initial turn 07:29:21-09:25:56, driver checks 09:25:56-10:20:59, review ending 10:26:07, and a repair turn 10:26:09 killed at 10:27:10. The three-hour cumulative clock left only approximately 61 seconds for repair after review, not a loop or an unresolved design/privilege decision. The repair transcript implementer-20261009T102609.944058179Z.jsonl ends with the patch adding three test functions and starting their Cloud capture, without a completed capture result. Their snapshots are absent from the checked-in JSON. checks.log reports success but explicitly leaves broad compat unfinished (timeout after 1010s), skips the state-snapshot and scripts lanes for lack of time, and defers those lanes to CI. Do not describe this as full gate coverage. The initial transcript independently records 226 regression passes; the initial commit records focused PERIOD verification. No new repair tests have verified outcomes yet. Resume from the saved tests rather than reimplementing or recapturing the foundation. First finalize and Cloud-capture only test_period_ltz_wrapped_storage, test_period_stored_calendar_formats and test_period_ctas_failing_projection: TEST_TARGET=SNOWFLAKE_CLOUD PYTEST_XDIST_ARGS='' make test-compat PYTEST_PATH=tests/queries/functions/test_period_types.py PYTEST_ARGS='--snapshot-update -k "ltz_wrapped_storage or stored_calendar_formats or ctas_failing_projection"' Do not value-change existing snapshots. New functions/additive snapshots are allowed by the implementer contract and need no waiver. Verified repair targets: - G1: values_cast_check.rs:50 normalizes only outer projections and direct, nested or PERIOD-cast constructors; derived tables/CTEs and conditional wrappers are not traced. Repair materialization across wrappers while preserving unshifted constructors consumed by accessors/VARCHAR. The saved tests include accessor siblings to catch overly broad recursive rewrites. - G2: post_process.rs:136 skips DATE and renders only fractional directives with a fixed layout. Carry complete effective output-format directives, preserving canonical computed rendering and nanoseconds/offsets. Reuse existing temporal formatter semantics: period.rs:160 already delegates explicit VARCHAR output to format_string_template::render_temporal. - G3: column_resolver.rs:2142 selects the first constructor and :2232 walks only the left set-operation branch. Attribute the actual failing projection and preserve output ordinals/explicit column names across both branches. LAV-4107's generic conversion-attribution debt is expressly not a prerequisite for this scoped PERIOD-constructor repair. Then run make check, focused new-test replay, and the PERIOD file before handoff. Do not rerun the broad initial capture/regression sweep or manually run .spiral/check.sh; the driver owns the post-turn gate. Report remaining CI-deferred validation honestly. No source/test/snapshot edits or waiver were made by the investigator; this commit is guidance only. * LAV-4052: repair PERIOD materialization, rendering and CTAS attribution Address reviewer gaps G1-G3. Apply LTZ materialization to period-valued output expressions, following conditional results, scalar subqueries, derived aliases and CTEs. Preserve projection labels and ordinary VARCHAR consumers. Homogeneous PERIOD/NULL conditionals retain their custom OID. Computed alias accessors match Cloud's separate endpoint interpretation. Share the temporal formatter between extension casts and stored wire reads. Honor full DATE, TIME and timestamp output formats, including calendar layout, omitted seconds/timezone tokens, nanoseconds and stored TZ offsets. LTZ/TZ temporal VARCHAR producers now honor session formats instead of hardcoding milliseconds; no native-typed bridge overload was introduced. Probe CTAS projections for the actual rejected bounds rather than choosing the first constructor. Traverse both UNION branches, use the rejected ordinal, and take implicit output names from the left branch. Explicit target names continue to take precedence. LAV-4107 is untouched. Investigator waiver: tests/queries/functions/test_period_types.py — correct only test_period_ltz_wrapped_storage destination-column selection: b and p for the direct two-column SELECT, p alone for the remaining shapes; retain all existing queries and assertions. test_edit_waiver: tests/queries/functions/test_period_types.py Swept INSERT SELECT/CTAS outputs for shape-dependent materialization; also fixed CASE/COALESCE/IFF/NVL/IFNULL/NVL2, scalar queries, declared and quoted aliases, chained CTEs, simple wildcards and UNION output ordinals; inline accessors and VARCHAR consumers retain their separately captured behavior. Swept all five stored-rendering families for dropped session directives; fixed DATE calendars, TIME clocks and timestamp calendar/offset omissions. Swept PERIOD CTAS error enrichment for first-compatible-projection guesses; also fixed conditional/subquery/derived/CTE projections, right UNION failures and differing left/right aliases. Generic conversion attribution remains outside this issue as LAV-4107. Verification: - 48 new snapshot cases captured serially against real Snowflake Cloud; all previously recorded snapshot values and recording metadata unchanged. - make check: green (including workspace lint/warnings and vendored tests). - PERIOD + conversions + FORMAT_STRING replay: 838 passed, 27 expected xfails. - Final PERIOD replay after the last scoped guard: 195 passed, 10 expected xfails. - Existing test formatting outside the waiver was restored to HEAD verbatim. - Driver-owned .spiral/check.sh was not run manually. Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud> ## Deviations Cloud distinguishes canonical computed text from session-formatted stored values. LTZ materialization reinterprets canonical UTC-looking endpoints as local wall time. Output-level AST materialization replaces the earlier direct storage-constructor rewrite so wrappers and aliases work without shifting inline accessors or VARCHAR siblings. Cloud captures additionally show computed LTZ aliases are materialized when consumed by temporal accessors. The storage-scale capture rejects constructor result scale 9 against declared PERIOD scale 3 with 002023. Those four cases remain strict-xfailed for LAV-4057; argument compatibility and PERIOD-to-VARIANT cases remain owned by LAV-4053. Moved the existing pure temporal translator/rendering helpers into the existing snowflake_common::format module, with extension re-exports, so wire reads and casts use identical semantics rather than parallel formatters. The new FF9 endpoint captures also required fixing LTZ/TZ temporal VARCHAR producers to use session formatting; their general conversion regressions pass. ## Test matrix DATE constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values DATE constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values DATE constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds DATE constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds DATE BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values DATE BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values DATE constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire DATE typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip DATE explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns DATE stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns DATE stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire DATE default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats DATE INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor DATE invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint DATE CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIME constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIME constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIME constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIME constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIME BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIME BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIME constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIME typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIME explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIME stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIME stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIME default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIME INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIME invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIME CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIMESTAMP_NTZ constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_NTZ constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_NTZ constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_NTZ constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_NTZ BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_NTZ BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_NTZ constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIMESTAMP_NTZ typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIMESTAMP_NTZ explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_NTZ stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_NTZ stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIMESTAMP_NTZ default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIMESTAMP_NTZ INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIMESTAMP_NTZ invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIMESTAMP_NTZ CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIMESTAMP_LTZ constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_LTZ constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_LTZ constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_LTZ constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_LTZ BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_LTZ BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_LTZ constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIMESTAMP_LTZ typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIMESTAMP_LTZ explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_LTZ stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_LTZ stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIMESTAMP_LTZ default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIMESTAMP_LTZ INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIMESTAMP_LTZ invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIMESTAMP_LTZ CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIMESTAMP_TZ constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_TZ constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_TZ constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_TZ constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_TZ BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_TZ BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_TZ constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIMESTAMP_TZ typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIMESTAMP_TZ explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_TZ stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_TZ stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIMESTAMP_TZ default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIMESTAMP_TZ INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIMESTAMP_TZ invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIMESTAMP_TZ CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIME explicit stored scales 0/3/6, CTAS retention, DESC/TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_scale TIME scale-3 stored constructor happy/error paths -> tests/queries/functions/test_period_types.py::test_period_stored_constructor_scale TIME invalid endpoint cast error -> tests/queries/functions/test_period_types.py::test_period_invalid_endpoint TIME adjacent nanosecond bounds and explicit scale-collapse error -> tests/queries/functions/test_period_types.py::test_period_nanosecond_boundary TIME VALUES equal/inverted temporal bounds and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_temporal_constructor TIME function-result/storage scale compatibility (strict-xfail LAV-4057) -> tests/queries/functions/test_period_types.py::test_period_expression_storage_scale_compatibility TIMESTAMP_NTZ explicit stored scales 0/3/6, CTAS retention, DESC/TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_scale TIMESTAMP_NTZ scale-3 stored constructor happy/error paths -> tests/queries/functions/test_period_types.py::test_period_stored_constructor_scale TIMESTAMP_NTZ invalid endpoint cast error -> tests/queries/functions/test_period_types.py::test_period_invalid_endpoint TIMESTAMP_NTZ adjacent nanosecond bounds and explicit scale-collapse error -> tests/queries/functions/test_period_types.py::test_period_nanosecond_boundary TIMESTAMP_NTZ VALUES equal/inverted temporal bounds and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_temporal_constructor TIMESTAMP_NTZ function-result/storage scale compatibility (strict-xfail LAV-4057) -> tests/queries/functions/test_period_types.py::test_period_expression_storage_scale_compatibility TIMESTAMP_LTZ explicit stored scales 0/3/6, CTAS retention, DESC/TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_scale TIMESTAMP_LTZ scale-3 stored constructor happy/error paths -> tests/queries/functions/test_period_types.py::test_period_stored_constructor_scale TIMESTAMP_LTZ invalid endpoint cast error -> tests/queries/functions/test_period_types.py::test_period_invalid_endpoint TIMESTAMP_LTZ adjacent nanosecond bounds and explicit scale-collapse error -> tests/queries/functions/test_period_types.py::test_period_nanosecond_boundary TIMESTAMP_LTZ VALUES equal/inverted temporal bounds and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_temporal_constructor TIMESTAMP_LTZ function-result/storage scale compatibility (strict-xfail LAV-4057) -> tests/queries/functions/test_period_types.py::test_period_expression_storage_scale_compatibility TIMESTAMP_TZ explicit stored scales 0/3/6, CTAS retention, DESC/TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_scale TIMESTAMP_TZ scale-3 stored constructor happy/error paths -> tests/queries/functions/test_period_types.py::test_period_stored_constructor_scale TIMESTAMP_TZ invalid endpoint cast error -> tests/queries/functions/test_period_types.py::test_period_invalid_endpoint TIMESTAMP_TZ adjacent nanosecond bounds and explicit scale-collapse error -> tests/queries/functions/test_period_types.py::test_period_nanosecond_boundary TIMESTAMP_TZ VALUES equal/inverted temporal bounds and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_temporal_constructor TIMESTAMP_TZ function-result/storage scale compatibility (strict-xfail LAV-4057) -> tests/queries/functions/test_period_types.py::test_period_expression_storage_scale_compatibility TIME scales 0/3/6; NTZ scale 3; LTZ scale 6; TZ scale 3 casts/TYPEOF -> tests/queries/functions/test_period_types.py::test_period_declared_scale DATE malformed text, brackets, missing endpoints -> tests/queries/functions/test_period_types.py::test_period_invalid_text DATE malformed/empty/inverted storage and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_invalid_storage DATE whitespace/year-0001 boundary and malformed/nonfinite endpoint errors -> tests/queries/functions/test_period_types.py::test_period_text_boundaries DATE VALUES equal/inverted bounds, direct/Nested/Cast error shapes -> tests/queries/functions/test_period_types.py::test_period_values_invalid_constructor DATE INSERT SELECT/CREATE OR REPLACE error attribution and preserved rows -> tests/queries/functions/test_period_types.py::test_period_select_invalid_constructor DATE CTAS explicit column names and projection ordinal error attribution -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor_column_names DATE/LTZ query parentheses, UNION, Nested, PERIOD cast, VARCHAR cast materialization -> tests/queries/functions/test_period_types.py::test_period_materialized_query_shape NTZ/LTZ/TZ pre-epoch nanosecond text precision -> tests/queries/functions/test_period_types.py::test_period_nanosecond_boundary TZ distinct endpoint offsets and nanosecond text precision -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TZ equal UTC instant with different offsets, both directions -> tests/queries/functions/test_period_types.py::test_period_tz_equal_instant, test_period_tz_equal_instant_reverse bare NULL BEGIN/END values and wire metadata -> tests/queries/functions/test_period_types.py::test_period_bare_null_accessors invalid argument families, mixed-family constructor, PERIOD-to-VARIANT (strict-xfail LAV-4053) -> tests/queries/functions/test_period_types.py::test_period_argument_compatibility expression-derived BEGIN/END/PERIOD result scale, TYPEOF and CTAS DESC (strict-xfail LAV-4057) -> tests/queries/functions/test_period_types.py::test_period_expression_scale DATE homogeneous COALESCE(NULL, constructor) / INSERT SELECT values and accessor families -> tests/queries/functions/test_period_types.py::test_period_coalesce_storage_families DATE homogeneous COALESCE(NULL, constructor) / CTAS values and accessor families -> tests/queries/functions/test_period_types.py::test_period_coalesce_storage_families DATE calendar/clock output-format directives / direct stored column -> tests/queries/functions/test_period_types.py::test_period_stored_calendar_formats DATE calendar/clock output-format directives / explicit VARCHAR -> tests/queries/functions/test_period_types.py::test_period_stored_calendar_formats TIME homogeneous COALESCE(NULL, constructor) / INSERT SELECT values and accessor families -> tests/queries/functions/test_period_types.py::test_period_coalesce_storage_families TIME homogeneous COALESCE(NULL, constructor) / CTAS values and accessor families -> tests/queries/functions/test_period_types.py::test_period_coalesce_storage_families TIME calendar/clock output-format directives / direct stored column -> tests/queries/functions/test_period_types.py::test_period_stored_calendar_formats TIME calendar/clock output-format directives / explicit VARCHAR -> tests/queries/functions/test_period_types.py::test_period_stored_calendar_formats TIMESTAMP_NTZ homogeneous COALESCE(NULL, constructor) / INSERT SELECT values and accessor families -> tests/queries/functions/test_period_types.py::test_period_coalesce_storage_families TIMESTAMP_NTZ homogeneous COALESCE(NULL, constructor) / CTAS values and accessor families -> tests/queries/functions/test_period_types.py::test_period_coalesce_storage_families TIMESTAMP_NTZ calendar/clock output-format directives / direct stored column -> tests/queries/functions/test_period_types.py::test_period_stored_calendar_formats TIMESTAMP_NTZ calendar/clock output-format directives / explicit VARCHAR -> tests/queries/functions/test_period_types.py::test_period_stored_calendar_formats TIMESTAMP_LTZ homogeneous COALESCE(NULL, constructor) / INSERT SELECT values and accessor families -> tests/queries/functions/test_period_types.py::test_period_coalesce_storage_families TIMESTAMP_LTZ homogeneous COALESCE(NULL, constructor) / CTAS values and accessor families -> tests/queries/functions/test_period_types.py::test_period_coalesce_storage_families TIMESTAMP_LTZ calendar/clock output-format directives / direct stored column -> tests/queries/functions/test_period_types.py::test_period_stored_calendar_formats TIMESTAMP_LTZ calendar/clock output-format directives / explicit VARCHAR -> tests/queries/functions/test_period_types.py::test_period_stored_calendar_formats TIMESTAMP_TZ homogeneous COALESCE(NULL, constructor) / INSERT SELECT values and accessor families -> tests/queries/functions/test_period_types.py::test_period_coalesce_storage_families TIMESTAMP_TZ homogeneous COALESCE(NULL, constructor) / CTAS values and accessor families -> tests/queries/functions/test_period_types.py::test_period_coalesce_storage_families TIMESTAMP_TZ calendar/clock output-format directives / direct stored column -> tests/queries/functions/test_period_types.py::test_period_stored_calendar_formats TIMESTAMP_TZ calendar/clock output-format directives / explicit VARCHAR -> tests/queries/functions/test_period_types.py::test_period_stored_calendar_formats LTZ America/Los_Angeles / CASE / INSERT SELECT endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / CASE / CTAS endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / COALESCE / INSERT SELECT endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / COALESCE / CTAS endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / scalar subquery / INSERT SELECT endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / scalar subquery / CTAS endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / derived-table alias / INSERT SELECT endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / derived-table alias / CTAS endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / CTE alias / INSERT SELECT endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / CTE alias / CTAS endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / inline accessor sibling / INSERT SELECT endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / inline accessor sibling / CTAS endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / derived alias with unused accessor sibling / INSERT SELECT endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ America/Los_Angeles / derived alias with unused accessor sibling / CTAS endpoints -> tests/queries/functions/test_period_types.py::test_period_ltz_wrapped_storage LTZ / NULL CASE boundary / INSERT SELECT endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / NULL CASE boundary / CTAS endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / COALESCE literal before constructor / INSERT SELECT endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / COALESCE literal before constructor / CTAS endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / IFF literal arm / INSERT SELECT endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / IFF literal arm / CTAS endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / IFF constructor arm / INSERT SELECT endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / IFF constructor arm / CTAS endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / qualified case-insensitive alias / INSERT SELECT endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / qualified case-insensitive alias / CTAS endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / CTE declared column alias / INSERT SELECT endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / CTE declared column alias / CTAS endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / chained CTE aliases / INSERT SELECT endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / chained CTE aliases / CTAS endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / UNION ALL output ordinal / INSERT SELECT endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / UNION ALL output ordinal / CTAS endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / temporal accessor alias consumer / INSERT SELECT endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / temporal accessor alias consumer / CTAS endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / VARCHAR alias consumer / INSERT SELECT endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / VARCHAR alias consumer / CTAS endpoints and sibling values -> tests/queries/functions/test_period_types.py::test_period_ltz_materialization_boundaries LTZ / derived-table wildcard / INSERT SELECT stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / derived-table wildcard / CTAS stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / qualified derived wildcard / INSERT SELECT stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / qualified derived wildcard / CTAS stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / CTE wildcard / INSERT SELECT stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / CTE wildcard / CTAS stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / quoted relation/column identifiers / INSERT SELECT stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / quoted relation/column identifiers / CTAS stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / derived declared column alias / INSERT SELECT stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / derived declared column alias / CTAS stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / NVL / INSERT SELECT stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / NVL / CTAS stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / IFNULL / INSERT SELECT stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / IFNULL / CTAS stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / NVL2 / INSERT SELECT stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / NVL2 / CTAS stored text -> tests/queries/functions/test_period_types.py::test_period_ltz_projection_forms LTZ / alias / BEGIN text and wire metadata; VARCHAR sibling unshifted -> tests/queries/functions/test_period_types.py::test_period_ltz_alias_accessors LTZ / alias / END text and wire metadata; VARCHAR sibling unshifted -> tests/queries/functions/test_period_types.py::test_period_ltz_alias_accessors LTZ / parenthesized alias / BEGIN text and wire metadata; VARCHAR sibling unshifted -> tests/queries/functions/test_period_types.py::test_period_ltz_alias_accessors LTZ / parenthesized alias / END text and wire metadata; VARCHAR sibling unshifted -> tests/queries/functions/test_period_types.py::test_period_ltz_alias_accessors LTZ / PERIOD-cast alias / BEGIN text and wire metadata; VARCHAR sibling unshifted -> tests/queries/functions/test_period_types.py::test_period_ltz_alias_accessors LTZ / PERIOD-cast alias / END text and wire metadata; VARCHAR sibling unshifted -> tests/queries/functions/test_period_types.py::test_period_ltz_alias_accessors DATE CTAS valid-before-invalid bounds / projection aliases / single SELECT exact failing column -> tests/queries/functions/test_period_types.py::test_period_ctas_failing_projection DATE CTAS valid-before-invalid bounds / projection aliases / right UNION ALL branch exact failing column -> tests/queries/functions/test_period_types.py::test_period_ctas_failing_projection DATE CTAS valid-before-invalid bounds / explicit target column names / single SELECT exact failing column -> tests/queries/functions/test_period_types.py::test_period_ctas_failing_projection DATE CTAS valid-before-invalid bounds / explicit target column names / right UNION ALL branch exact failing column -> tests/queries/functions/test_period_types.py::test_period_ctas_failing_projection DATE CTAS valid-before-invalid bounds / CASE exact error and failing column -> tests/queries/functions/test_period_types.py::test_period_ctas_wrapped_failing_projection DATE CTAS valid-before-invalid bounds / COALESCE exact error and failing column -> tests/queries/functions/test_period_types.py::test_period_ctas_wrapped_failing_projection DATE CTAS valid-before-invalid bounds / scalar subquery exact error and failing column -> tests/queries/functions/test_period_types.py::test_period_ctas_wrapped_failing_projection DATE CTAS valid-before-invalid bounds / derived-table alias exact error and failing column -> tests/queries/functions/test_period_types.py::test_period_ctas_wrapped_failing_projection DATE CTAS valid-before-invalid bounds / CTE alias exact error and failing column -> tests/queries/functions/test_period_types.py::test_period_ctas_wrapped_failing_projection DATE CTAS right UNION ALL failure / differing right aliases preserve left output names -> tests/queries/functions/test_period_types.py::test_period_ctas_union_output_names * LAV-4052: resolve wildcard PERIOD lineage and preserve query scopes Address reviewer gaps G1-G2. Resolve PERIOD output projections using the existing wildcard machinery before storage materialization and CTAS probing. Preserve output ordinals, wildcard modifiers, quoted identities, joins and query-local WITH scopes. CTAS probes retain each nested query container and UNION branch context. INSERT lookahead recognizes parenthesized WITH queries, and source unwrapping preserves their CTEs. Swept PERIOD projection lineage, CTAS branch probes and INSERT source unwrapping for wildcard bypasses and dropped WITH scopes; also fixed nested joins, qualified stars beside physical tables, EXCLUDE/RENAME/REPLACE, nested local CTEs and repeated query parentheses. Computed accessor/VARCHAR boundaries and ordinary wildcard/JOIN behavior remain covered by the regression replay. LAV-4107 is unchanged. Verification: - 37 finalized new cases captured serially against real Snowflake Cloud; all 205 previous entries and recording metadata unchanged. - make check: green (workspace lint, warnings, formatting and vendored sqlparser tests). - Focused PERIOD, wildcard options, wildcard option order and JOIN replay: 484 passed, 10 expected sibling-owned xfails. - Restored formatting-only changes to existing tests; this commit adds functions only, so no test-edit waiver is required. - Driver-owned .spiral/check.sh was not run manually. Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud> ## Deviations Reused the existing shared wildcard resolver in an early PERIOD projection pass instead of extending the PERIOD-only expansion helper. Canonicalize only lookup copies before expansion so original expressions and quoted names retain their identity; removed the redundant PERIOD wildcard machinery. Extended the existing INSERT parser lookahead and repaired INSERT source unwrapping, beyond the reviewer-named files. The captured parenthesized local-WITH cases exposed both prerequisite defects: the parser mistook WITH for a target-column list, and unwrapping then discarded the CTE scope. ## Test matrix DATE constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values DATE constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values DATE constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds DATE constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds DATE BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values DATE BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values DATE constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire DATE typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip DATE explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns DATE stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns DATE stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire DATE default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats DATE INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor DATE invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint DATE CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIME constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIME constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIME constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIME constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIME BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIME BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIME constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIME typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIME explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIME stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIME stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIME default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIME INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIME invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIME CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIMESTAMP_NTZ constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_NTZ constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_NTZ constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_NTZ constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_NTZ BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_NTZ BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_NTZ constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIMESTAMP_NTZ typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIMESTAMP_NTZ explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_NTZ stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_NTZ stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIMESTAMP_NTZ default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIMESTAMP_NTZ INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIMESTAMP_NTZ invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIMESTAMP_NTZ CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIMESTAMP_LTZ constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_LTZ constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_LTZ constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_LTZ constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_LTZ BEGIN/END values and temporal wire families -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_LTZ BEGIN/END typed PERIOD NULL -> tests/queries/functions/test_period_types.py::test_period_accessor_values TIMESTAMP_LTZ constructor/accessor typed NULL wire metadata -> tests/queries/functions/test_period_types.py::test_period_typed_null_wire TIMESTAMP_LTZ typed literal, CAST, :: and explicit VARCHAR roundtrip -> tests/queries/functions/test_period_types.py::test_period_literal_cast_roundtrip TIMESTAMP_LTZ explicit CREATE TABLE, INSERT/readback, CTAS/readback -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_LTZ stored DESCRIBE and SYSTEM$TYPEOF -> tests/queries/functions/test_period_types.py::test_period_stored_columns TIMESTAMP_LTZ stored JSON text metadata and source identity -> tests/queries/functions/test_period_types.py::test_period_stored_wire TIMESTAMP_LTZ default/session formats and VALUES materialization -> tests/queries/functions/test_period_types.py::test_period_default_formats TIMESTAMP_LTZ INSERT SELECT and CTAS constructor values, accessor types -> tests/queries/functions/test_period_types.py::test_period_materialized_constructor TIMESTAMP_LTZ invalid endpoint DML error and no inserted rows -> tests/queries/functions/test_period_types.py::test_period_values_invalid_endpoint TIMESTAMP_LTZ CTAS equal bounds error, direct/nested/cast/UNION projections -> tests/queries/functions/test_period_types.py::test_period_ctas_invalid_constructor TIMESTAMP_TZ constructor valid finite bounds -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_TZ constructor typed NULL begin/end/both -> tests/queries/functions/test_period_types.py::test_period_constructor_values TIMESTAMP_TZ constructor equal bounds error -> tests/queries/functions/test_period_types.py::test_period_invalid_bounds TIMESTAMP_TZ constructor inverted bounds error -> tests/queries/functions/test_period_types.py::test_per…
1 parent 4eda603 commit 2fa676e

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎src/ast/data_type.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ pub enum DataType {
7575
Nvarchar(Option<CharacterLength>),
7676
/// Uuid type.
7777
Uuid,
78+
/// Half-open temporal period with an element type.
79+
Period(Box<DataType>),
7880
/// Large character object with optional length,
7981
/// e.g. CHARACTER LARGE OBJECT, CHARACTER LARGE OBJECT(1000), [SQL Standard].
8082
///
@@ -515,6 +517,7 @@ impl fmt::Display for DataType {
515517
DataType::Varchar(size) => format_character_string_type(f, "VARCHAR", size),
516518
DataType::Nvarchar(size) => format_character_string_type(f, "NVARCHAR", size),
517519
DataType::Uuid => write!(f, "UUID"),
520+
DataType::Period(element) => write!(f, "PERIOD({element})"),
518521
DataType::CharacterLargeObject(size) => {
519522
format_type_with_optional_length(f, "CHARACTER LARGE OBJECT", size, false)
520523
}

‎src/parser/mod.rs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15035,6 +15035,12 @@ impl<'a> Parser<'a> {
1503515035
}
1503615036
Keyword::VARBIT => Ok(DataType::VarBit(self.parse_optional_precision()?)),
1503715037
Keyword::UUID => Ok(DataType::Uuid),
15038+
Keyword::PERIOD => {
15039+
self.expect_token(&Token::LParen)?;
15040+
let element = self.parse_data_type()?;
15041+
self.expect_token(&Token::RParen)?;
15042+
Ok(DataType::Period(Box::new(element)))
15043+
}
1503815044
Keyword::DATE => Ok(DataType::Date),
1503915045
Keyword::DATE32 => Ok(DataType::Date32),
1504015046
Keyword::DATETIME => Ok(DataType::Datetime(self.parse_optional_precision()?)),
@@ -21620,7 +21626,9 @@ impl<'a> Parser<'a> {
2162021626
loop {
2162121627
match &self.peek_nth_token_ref(i).token {
2162221628
Token::LParen => i += 1,
21623-
Token::Word(w) if w.keyword == Keyword::SELECT => return i > 0,
21629+
Token::Word(w) if matches!(w.keyword, Keyword::SELECT | Keyword::WITH) => {
21630+
return i > 0;
21631+
}
2162421632
_ => return false,
2162521633
}
2162621634
}

0 commit comments

Comments
 (0)