Skip to content

Commit 08890d1

Browse files
committed
Code review comments
1 parent 2559075 commit 08890d1

15 files changed

+112
-86
lines changed

src/ast/query.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ pub enum TableFactor {
975975
/// [Partition selection](https://dev.mysql.com/doc/refman/8.0/en/partitioning-selection.html), supported by MySQL.
976976
partitions: Vec<Ident>,
977977
/// Optional PartiQL JsonPath: <https://partiql.org/dql/from.html>
978-
partiql: Option<JsonPath>,
978+
json_path: Option<JsonPath>,
979979
},
980980
Derived {
981981
lateral: bool,
@@ -1377,11 +1377,11 @@ impl fmt::Display for TableFactor {
13771377
version,
13781378
partitions,
13791379
with_ordinality,
1380-
partiql,
1380+
json_path,
13811381
} => {
13821382
write!(f, "{name}")?;
1383-
if let Some(partiql) = partiql {
1384-
write!(f, "{partiql}")?;
1383+
if let Some(json_path) = json_path {
1384+
write!(f, "{json_path}")?;
13851385
}
13861386
if !partitions.is_empty() {
13871387
write!(f, "PARTITION ({})", display_comma_separated(partitions))?;

src/parser/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10328,7 +10328,7 @@ impl<'a> Parser<'a> {
1032810328
} else {
1032910329
let name = self.parse_object_name(true)?;
1033010330

10331-
let partiql = match self.peek_token().token {
10331+
let json_path = match self.peek_token().token {
1033210332
Token::LBracket if self.dialect.supports_partiql() => Some(self.parse_json_path()?),
1033310333
_ => None,
1033410334
};
@@ -10375,7 +10375,7 @@ impl<'a> Parser<'a> {
1037510375
version,
1037610376
partitions,
1037710377
with_ordinality,
10378-
partiql,
10378+
json_path,
1037910379
};
1038010380

1038110381
while let Some(kw) = self.parse_one_of_keywords(&[Keyword::PIVOT, Keyword::UNPIVOT]) {

src/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ pub fn table(name: impl Into<String>) -> TableFactor {
345345
version: None,
346346
partitions: vec![],
347347
with_ordinality: false,
348-
partiql: None,
348+
json_path: None,
349349
}
350350
}
351351

@@ -361,7 +361,7 @@ pub fn table_with_alias(name: impl Into<String>, alias: impl Into<String>) -> Ta
361361
version: None,
362362
partitions: vec![],
363363
with_ordinality: false,
364-
partiql: None,
364+
json_path: None,
365365
}
366366
}
367367

tests/sqlparser_bigquery.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ fn parse_delete_statement() {
229229
version: None,
230230
partitions: vec![],
231231
with_ordinality: false,
232-
partiql: None,
232+
json_path: None,
233233
},
234234
from[0].relation
235235
);
@@ -1374,7 +1374,7 @@ fn parse_table_identifiers() {
13741374
version: None,
13751375
partitions: vec![],
13761376
with_ordinality: false,
1377-
partiql: None,
1377+
json_path: None,
13781378
},
13791379
joins: vec![]
13801380
},]
@@ -1548,7 +1548,7 @@ fn parse_table_time_travel() {
15481548
))),
15491549
partitions: vec![],
15501550
with_ordinality: false,
1551-
partiql: None,
1551+
json_path: None,
15521552
},
15531553
joins: vec![]
15541554
},]
@@ -1647,7 +1647,7 @@ fn parse_merge() {
16471647
version: Default::default(),
16481648
partitions: Default::default(),
16491649
with_ordinality: false,
1650-
partiql: None,
1650+
json_path: None,
16511651
},
16521652
table
16531653
);
@@ -1663,7 +1663,7 @@ fn parse_merge() {
16631663
version: Default::default(),
16641664
partitions: Default::default(),
16651665
with_ordinality: false,
1666-
partiql: None,
1666+
json_path: None,
16671667
},
16681668
source
16691669
);

tests/sqlparser_clickhouse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn parse_map_access_expr() {
6767
version: None,
6868
partitions: vec![],
6969
with_ordinality: false,
70-
partiql: None,
70+
json_path: None,
7171
},
7272
joins: vec![],
7373
}],
@@ -173,7 +173,7 @@ fn parse_delimited_identifiers() {
173173
version,
174174
with_ordinality: _,
175175
partitions: _,
176-
partiql: _,
176+
json_path: _,
177177
} => {
178178
assert_eq!(vec![Ident::with_quote('"', "a table")], name.0);
179179
assert_eq!(Ident::with_quote('"', "alias"), alias.unwrap().name);

0 commit comments

Comments
 (0)