mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-25 16:34:04 +00:00
snowflake/generic: position
can be the name of a column (#1022)
Co-authored-by: Lukasz Stefaniak <lustefaniak@gmail.com>
This commit is contained in:
parent
ce62fe6d27
commit
2798b65b42
2 changed files with 9 additions and 1 deletions
|
@ -794,7 +794,9 @@ impl<'a> Parser<'a> {
|
|||
Keyword::EXTRACT => self.parse_extract_expr(),
|
||||
Keyword::CEIL => self.parse_ceil_floor_expr(true),
|
||||
Keyword::FLOOR => self.parse_ceil_floor_expr(false),
|
||||
Keyword::POSITION => self.parse_position_expr(),
|
||||
Keyword::POSITION if self.peek_token().token == Token::LParen => {
|
||||
self.parse_position_expr()
|
||||
}
|
||||
Keyword::SUBSTRING => self.parse_substring_expr(),
|
||||
Keyword::OVERLAY => self.parse_overlay_expr(),
|
||||
Keyword::TRIM => self.parse_trim_expr(),
|
||||
|
|
|
@ -1067,6 +1067,12 @@ fn test_snowflake_trim() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_position_not_function_columns() {
|
||||
snowflake_and_generic()
|
||||
.verified_stmt("SELECT position FROM tbl1 WHERE position NOT IN ('first', 'last')");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_subquery_function_argument() {
|
||||
// Snowflake allows passing an unparenthesized subquery as the single
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue