-
Notifications
You must be signed in to change notification settings - Fork 0
SYN-1945 Support Snowflake TRIM. #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1275,13 +1276,24 @@ impl<'a> Parser<'a> { | |||
expr: Box::new(expr), | |||
trim_where, | |||
trim_what: Some(trim_what), | |||
trim_characters: None, | |||
}) | |||
} else if self.consume_token(&Token::Comma) && dialect_of!(self is SnowflakeDialect) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no FROM
and Snowflake
and next is Comma
(by doc Snowflake doesn't support FROM
syntax) -> parse characters
Box::new(PostgreSqlDialect {}), | ||
Box::new(MsSqlDialect {}), | ||
Box::new(AnsiDialect {}), | ||
//Box::new(SnowflakeDialect {}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure it is still failing on others than snowflake.
@@ -0,0 +1,36 @@ | |||
name: Test Suite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added simple test workflow to see on PRs results of tests.
@@ -994,6 +997,9 @@ impl fmt::Display for Expr { | |||
} else { | |||
write!(f, "{expr}")?; | |||
} | |||
if let Some(characters) = trim_characters { | |||
write!(f, ", {}", display_comma_separated(characters))?; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print trim characters after expression if there are
c01f05c
to
0398ed5
Compare
Why
We are getting errors with parsing snowflake
TRIM
expression including removing characters separated by comma.https://docs.snowflake.com/en/sql-reference/functions/trim
Example of real failing sql