Skip to content

Commit 60fbc9b

Browse files
committed
Add more tests and docstring
1 parent 4ebd0d4 commit 60fbc9b

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
@@ -13774,6 +13774,7 @@ impl<'a> Parser<'a> {
1377413774
Ok(XmlPassingClause { arguments })
1377513775
}
1377613776

13777+
/// Parse a [TableFactor::SemanticView]
1377713778
fn parse_semantic_view_table_factor(&mut self) -> Result<TableFactor, ParserError> {
1377813779
let name = self.parse_object_name(true)?;
1377913780

tests/sqlparser_snowflake.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4590,12 +4590,13 @@ fn test_semantic_view_all_variants_should_pass() {
45904590
"SELECT * FROM SEMANTIC_VIEW(model DIMENSIONS dim1, dim2)",
45914591
None,
45924592
),
4593+
("SELECT * FROM SEMANTIC_VIEW(a.b METRICS c.d, c.e)", None),
45934594
(
4594-
"SELECT * FROM SEMANTIC_VIEW(model METRICS met1, met2)",
4595+
"SELECT * FROM SEMANTIC_VIEW(model FACTS fact1, fact2)",
45954596
None,
45964597
),
45974598
(
4598-
"SELECT * FROM SEMANTIC_VIEW(model FACTS fact1, fact2)",
4599+
"SELECT * FROM SEMANTIC_VIEW(model FACTS DATE_PART('year', col))",
45994600
None,
46004601
),
46014602
(
@@ -4618,7 +4619,7 @@ fn test_semantic_view_all_variants_should_pass() {
46184619
"SELECT * FROM SEMANTIC_VIEW(model METRICS orders.col, orders.col2)",
46194620
None,
46204621
),
4621-
// We can parse in any order bu will always produce a result in a fixed order.
4622+
// We can parse in any order but will always produce a result in a fixed order.
46224623
(
46234624
"SELECT * FROM SEMANTIC_VIEW(model WHERE x > 0 DIMENSIONS dim1)",
46244625
Some("SELECT * FROM SEMANTIC_VIEW(model DIMENSIONS dim1 WHERE x > 0)"),

0 commit comments

Comments
 (0)