Commit cca5ef5
LAV-3234: Support TAG clauses in CREATE SEMANTIC VIEW definitions (#3574)
* LAV-3234: Persist semantic view tag clauses and render tagged DDL
Parse view-level TAG, preserve declaration-level table and expression tags,
and record each assignment through the shared tag edge lifecycle. Render
Cloud-equivalent GET_DDL; preserve assignments through tag and view renames,
replacement, and tag deletion. Capture Cloud creation, errors, readback,
and DDL roundtrips.
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
## Deviations
Cloud accepts values outside a tag's ALLOWED_VALUES on semantic-view tables
and expressions, while it rejects them on the view itself. The child-domain
assignment path follows the Cloud snapshot.
## Test matrix
WITH TAG view, multiple names / create -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
bare TAG view / replace -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
bare TAG table / create -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
WITH TAG fact / create -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
bare TAG dimension / create -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
WITH TAG metric / create -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
view / SYSTEM$GET_TAG, TAG_REFERENCES -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
all targets / DESCRIBE, GET_DDL, replay -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
view missing tag / error, no view -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_errors
table missing tag / error, no view -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_errors
view disallowed value / error -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_errors
child disallowed value / accepted -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_errors
failed replacement / old tag kept -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_errors
successful replacement / tags reset -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
ALTER SET, UNSET / readback -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_alter_tag_readback
view rename / edge follows -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_alter_tag_readback
tag rename and drop / all targets -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_entity_rename
value 256 boundary / shared UDF -> tests/queries/test_tags.py::test_create_stream_with_tag
value 257 error / shared UDF -> tests/queries/test_tags.py::test_create_stream_tag_failures_are_atomic
* LAV-3234: Match quoted semantic-view tag DDL to Cloud
Render qualified tag names with identifier quoting and capture the Cloud
GET_DDL behavior for a value containing an apostrophe. A plain value on the
same quoted tag roundtrips through the emitted DDL.
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>
## Deviations
Cloud accepts values outside a tag's ALLOWED_VALUES on semantic-view tables
and expressions, while rejecting them on the view. Child-domain assignments
follow that captured behavior.
Cloud GET_DDL emits an embedded apostrophe in a semantic-view tag value
without escaping it; replay of that DDL fails with 001003. The captured
readback follows Cloud, and a quoted tag with a plain value proves the
roundtrip criterion where Cloud emits parseable DDL.
## Test matrix
WITH TAG view, multiple names / create -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
bare TAG view / replace -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
bare TAG table / create -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
WITH TAG fact / create -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
bare TAG dimension / create -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
WITH TAG metric / create -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
view / GET_TAG and TAG_REFERENCES -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
all targets / DESCRIBE and GET_DDL -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
all targets / GET_DDL replay -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
view missing tag / error, no view -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_errors
table missing tag / error, no view -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_errors
view disallowed value / error -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_errors
child disallowed value / accepted -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_errors
failed replace / old assignment kept -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_errors
successful replace / tags reset -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_assignments
ALTER SET, UNSET / readback -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_alter_tag_readback
view rename / assignment follows -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_alter_tag_readback
tag rename and drop / all targets -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_tag_entity_rename
quoted tag / GET_DDL and replay -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_quoted_tag_ddl_roundtrip
apostrophe value / Cloud GET_DDL -> tests/queries/ddl/test_semantic_view_tags.py::test_semantic_view_quoted_tag_ddl_roundtrip
256-character value / shared UDF -> tests/queries/test_tags.py::test_create_stream_with_tag
257-character value / shared UDF error -> tests/queries/test_tags.py::test_create_stream_tag_failures_are_atomic
---------
Co-authored-by: spiral <spiral@localhost>
Co-authored-by: Sabir Akhadov <sabir.akhadov@localstack.cloud>1 parent c753cf8 commit cca5ef5
2 files changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1914 | 1914 | | |
1915 | 1915 | | |
1916 | 1916 | | |
| 1917 | + | |
| 1918 | + | |
1917 | 1919 | | |
1918 | 1920 | | |
1919 | 1921 | | |
| |||
1942 | 1944 | | |
1943 | 1945 | | |
1944 | 1946 | | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
1945 | 1950 | | |
1946 | 1951 | | |
1947 | 1952 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5544 | 5544 | | |
5545 | 5545 | | |
5546 | 5546 | | |
| 5547 | + | |
5547 | 5548 | | |
5548 | 5549 | | |
5549 | 5550 | | |
| |||
5593 | 5594 | | |
5594 | 5595 | | |
5595 | 5596 | | |
| 5597 | + | |
| 5598 | + | |
| 5599 | + | |
| 5600 | + | |
| 5601 | + | |
5596 | 5602 | | |
5597 | 5603 | | |
5598 | 5604 | | |
| |||
5605 | 5611 | | |
5606 | 5612 | | |
5607 | 5613 | | |
| 5614 | + | |
5608 | 5615 | | |
5609 | 5616 | | |
5610 | 5617 | | |
| |||
0 commit comments