Repository navigation
Conversation
…and skip SELECT DISTINCT
kayemkim
reviewed
Nov 21, 2026
| return None | ||
|
|
||
| interval_cls = getattr(exp, "Interval", None) | ||
| if interval_cls is not None and next(tree.find_all(interval_cls), None) is not None: |
Member
There was a problem hiding this comment.
This also catches a field named interval. sqlglot reads interval + grace as an INTERVAL literal, so a model with fields interval and grace and a third one defined as sql: interval + grace passed before #777 and now fails with "INTERVAL is not part of OSSIE_SQL_2026". The grammar takes interval as a plain name, and grace + interval or "interval" + grace pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #777:
_portable_sql_construct_errorfromvalidate_sql_expressioninto_parse_sql_expressionsoparse_treeand downstream checks (validate_metric_scoping,validate_metric_agreement,validate_metric_references,validate_field_shadowing,validate_agg_placement) treat rejectedOSSIE_SQL_2026expressions as unparsed instead of emitting secondary[Scope]/[Drift]diagnostics. This restores_parse_sql_expression's single-parse contract and aligns with feat(validation): reject queries in portable expressions and parse query sources #698.exp.Distinctnodes whose parent isexp.SelectsoSELECT DISTINCT ...stays deferred alongsideSELECT ...rather than reporting"DISTINCT requires an argument".Testing
uv run validation/test_validate.py(59 tests passed)uv run --with pytest --with pyyaml --with jsonschema --with sqlglot -m pytest validation/tests/(966 passed, 1 skipped)uv run validation/validate.py examples/tpcds_semantic_model.yamluv run validation/validate.py examples/renamed_fields.yaml