bombsimon commented on code in PR #2009: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2009#discussion_r2290529098
########## src/parser/mod.rs: ########## @@ -13438,6 +13439,10 @@ impl<'a> Parser<'a> { } else if self.parse_keyword_with_tokens(Keyword::XMLTABLE, &[Token::LParen]) { self.prev_token(); self.parse_xml_table_factor() + } else if self.dialect.supports_semantic_view() + && self.parse_keyword_with_tokens(Keyword::SEMANTIC_VIEW, &[Token::LParen]) + { + self.parse_semantic_view_table_factor() Review Comment: I'm not sure if it would look the same in other contexts, the syntax above comes _specifically_ from the [`SELECT FROM`](https://docs.snowflake.com/en/user-guide/views-semantic/querying) docs which even states: > Specifies the [semantic view](https://docs.snowflake.com/en/user-guide/views-semantic/overview) to [query](https://docs.snowflake.com/en/user-guide/views-semantic/querying). You specify SEMANTIC_VIEW(…) in a [FROM](https://docs.snowflake.com/en/sql-reference/constructs/from) clause in a [SELECT](https://docs.snowflake.com/en/sql-reference/sql/select) statement. In the context of [creating a semantic view](https://docs.snowflake.com/en/sql-reference/sql/create-semantic-view), the syntax is much different: ```sql CREATE [ OR REPLACE ] SEMANTIC VIEW [ IF NOT EXISTS ] <name> TABLES ( logicalTable [ , ... ] ) [ RELATIONSHIPS ( relationshipDef [ , ... ] ) ] [ FACTS ( semanticExpression [ , ... ] ) ] [ DIMENSIONS ( semanticExpression [ , ... ] ) ] [ METRICS ( semanticExpression [ , ... ] ) ] [ COMMENT = '<comment_about_semantic_view>' ] [ COPY GRANTS ] ``` In what other cases or context do you think we could make use of the current parser function? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org