Skip to content

Commit 1d7fffc

Browse files
committed
Add more tests and docstring
1 parent 11680b1 commit 1d7fffc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/parser/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13847,6 +13847,7 @@ impl<'a> Parser<'a> {
1384713847
Ok(XmlPassingClause { arguments })
1384813848
}
1384913849

13850+
/// Parse a [TableFactor::SemanticView]
1385013851
fn parse_semantic_view_table_factor(&mut self) -> Result<TableFactor, ParserError> {
1385113852
let name = self.parse_object_name(true)?;
1385213853

tests/sqlparser_snowflake.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4622,12 +4622,13 @@ fn test_semantic_view_all_variants_should_pass() {
46224622
"SELECT * FROM SEMANTIC_VIEW(model DIMENSIONS dim1, dim2)",
46234623
None,
46244624
),
4625+
("SELECT * FROM SEMANTIC_VIEW(a.b METRICS c.d, c.e)", None),
46254626
(
4626-
"SELECT * FROM SEMANTIC_VIEW(model METRICS met1, met2)",
4627+
"SELECT * FROM SEMANTIC_VIEW(model FACTS fact1, fact2)",
46274628
None,
46284629
),
46294630
(
4630-
"SELECT * FROM SEMANTIC_VIEW(model FACTS fact1, fact2)",
4631+
"SELECT * FROM SEMANTIC_VIEW(model FACTS DATE_PART('year', col))",
46314632
None,
46324633
),
46334634
(
@@ -4650,7 +4651,7 @@ fn test_semantic_view_all_variants_should_pass() {
46504651
"SELECT * FROM SEMANTIC_VIEW(model METRICS orders.col, orders.col2)",
46514652
None,
46524653
),
4653-
// We can parse in any order bu will always produce a result in a fixed order.
4654+
// We can parse in any order but will always produce a result in a fixed order.
46544655
(
46554656
"SELECT * FROM SEMANTIC_VIEW(model WHERE x > 0 DIMENSIONS dim1)",
46564657
Some("SELECT * FROM SEMANTIC_VIEW(model DIMENSIONS dim1 WHERE x > 0)"),

0 commit comments

Comments
 (0)