-
Notifications
You must be signed in to change notification settings - Fork 564
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
Support SETTINGS
pairs for ClickHouse dialect
#1327
Support SETTINGS
pairs for ClickHouse dialect
#1327
Conversation
SETTINGS in query is supported by ClickHouse, for example: ``` SELECT * FROM t SETTINGS max_threads = 1, max_block_size = 10000 ``` For more information, please refer to: https://clickhouse.com/docs/en/sql-reference/statements/select#settings-in-select-query
5297864
to
cdba898
Compare
Pull Request Test Coverage Report for Build 9732400921Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9732425080Details
💛 - Coveralls |
src/parser/mod.rs
Outdated
let mut key_values: Vec<Setting> = vec![]; | ||
loop { | ||
let key = self.parse_identifier(false)?; | ||
self.expect_token(&Token::Eq)?; | ||
let value = self.parse_value()?; | ||
key_values.push(Setting { key, value }); | ||
if !self.consume_token(&Token::Comma) { | ||
break; | ||
} | ||
} | ||
Some(key_values) |
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.
I think we might be able to reuse the parse_comma_separated functionality here, could you take a look at that function to see if it works for this case?
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.
@iffyio Good point, it's done now.
Pull Request Test Coverage Report for Build 9807053567Details
💛 - Coveralls |
Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
Pull Request Test Coverage Report for Build 9808889487Details
💛 - Coveralls |
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.
LGTM! cc @alamb
SETTINGS
pairs for ClickHouse dialect
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.
SETTINGS in query is supported by ClickHouse, for example:
For more information, please refer to:
https://clickhouse.com/docs/en/sql-reference/statements/select#settings-in-select-query