Skip to content

Conversation

bombsimon
Copy link
Contributor

Implements querying SEMANTIC_VIEW in Snowflake: https://docs.snowflake.com/en/sql-reference/constructs/semantic_view

SEMANTIC_VIEW(
  [<namespace>.]<semantic_view_name>
  [
    {
      METRICS <metric> [ , ... ] |
      FACTS <fact_expr>  [ , ... ]
    }
  ]
  [ DIMENSIONS <dimension_expr>  [ , ... ] ]
  [ WHERE <predicate> ]
)

This change was more or less completely made with AI using Claude. I thought that's interesting to share both to ensure there's no non-AI policy I might violate, but also to showcase how quick it can be to extend functionality of this parser!

Other than some missing links, assumptions about METRICS and the usage of the discouraged dialect_of macro it more or less worked with a single prompt with some example queries and constraints as input! 🎉

@bombsimon bombsimon requested a review from iffyio August 21, 2025 10:04
@bombsimon bombsimon force-pushed the snowflake-semantic-view branch from 0eb0c6a to 7b55dd5 Compare August 21, 2025 14:53
Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @bombsimon!
cc @alamb

@iffyio iffyio merged commit 6e80e5c into apache:main Aug 21, 2025
10 checks passed
@iffyio iffyio deleted the snowflake-semantic-view branch August 21, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants