Conversation
jjbayer
commented
Feb 6, 2024
| strip_prefixes_mysql_generic, | ||
| r#"SELECT `table`.`foo`, count(*) from `table` WHERE sku = %s"#, | ||
| r#"SELECT foo, count(*) from table WHERE sku = %s"# | ||
| r#"SELECT foo, count(*) FROM table WHERE sku = %s"# |
Member
Author
There was a problem hiding this comment.
This is now parsed successfully and no longer relies on the fallback scrubber.
| // with regex | ||
| r#"REPLACE INTO `foo` (`a`) VALUES ("abcd1234")"#, | ||
| "REPLACE INTO foo (a) VALUES (%s)" | ||
| "REPLACE INTO foo (..) VALUES (%s)" |
Member
Author
There was a problem hiding this comment.
This is now parsed successfully and no longer relies on the fallback scrubber.
Comment on lines
+208
to
+235
| TableFactor::Function { | ||
| name, args, alias, .. | ||
| } => { | ||
| Self::simplify_compound_identifier(&mut name.0); | ||
| for arg in args { | ||
| if let FunctionArg::Named { name, .. } = arg { | ||
| Self::scrub_name(name); | ||
| } | ||
| } | ||
| Self::simplify_table_alias(alias); | ||
| } | ||
| TableFactor::JsonTable { columns, alias, .. } => { | ||
| for col in columns { | ||
| Self::scrub_name(&mut col.name); | ||
| Self::simplify_table_alias(alias); | ||
| } | ||
| } | ||
| TableFactor::Unpivot { | ||
| value, | ||
| name, | ||
| columns, | ||
| alias, | ||
| .. | ||
| } => { | ||
| Self::scrub_name(value); | ||
| Self::scrub_name(name); | ||
| Self::simplify_compound_identifier(columns); | ||
| Self::simplify_table_alias(alias); |
Member
Author
There was a problem hiding this comment.
This enum now has three new variants.
Comment on lines
+388
to
+389
| for operation in operations { | ||
| match operation { |
Member
Author
There was a problem hiding this comment.
We now have to loop through multiple operations, hence the large diff.
Dav1dde
approved these changes
Feb 6, 2024
iker-barriocanal
approved these changes
Feb 6, 2024
| TableFactor::JsonTable { columns, alias, .. } => { | ||
| for col in columns { | ||
| Self::scrub_name(&mut col.name); | ||
| Self::simplify_table_alias(alias); |
Contributor
There was a problem hiding this comment.
Do we need to simplify the alias for every column?
olksdr
approved these changes
Feb 6, 2024
jjbayer
added a commit
that referenced
this pull request
Feb 6, 2024
Causes panics, see [RELAY-2NRB](https://sentry.my.sentry.io/organizations/sentry/issues/581392/). Reverts #3057 #skip-changelog
jjbayer
added a commit
that referenced
this pull request
Feb 6, 2024
The `sqlparser` lib has been on a fork since #2846. We can now go back to the official version because apache/datafusion-sqlparser-rs#1065 has been merged & released.
jjbayer
added a commit
that referenced
this pull request
Feb 8, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
sqlparserlib has been on a fork since #2846. We can now go back to the official version because apache/datafusion-sqlparser-rs#1065 has been merged & released.ref: https://github.com/getsentry/team-ingest/issues/272