-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improved ergonomy for CREATE EXTERNAL TABLE OPTIONS
: Don't require quotations for simple namespaced keys like foo.bar
#10483
Improved ergonomy for CREATE EXTERNAL TABLE OPTIONS
: Don't require quotations for simple namespaced keys like foo.bar
#10483
Conversation
datafusion/sql/src/parser.rs
Outdated
Token::Word(Word { value, .. }) => { | ||
let mut parts = vec![value]; | ||
while self.parser.consume_token(&Token::Period) { | ||
let next_token = self.parser.next_token(); | ||
if let Token::Word(Word { value, .. }) = next_token.token { | ||
parts.push(value); | ||
} else { | ||
return self.parser.expected("key name", next_token); | ||
} | ||
} | ||
Ok(parts.join(".")) | ||
} |
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.
This is the main change, the rest is clean-up.
@berkaysynnada PTAL |
format.delimiter '|', | ||
has_header false, | ||
compression gzip); |
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.
👍🏻
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.
❤️
This PR addresses the last remaining gap, ensuring that UX achieves the desired balance of consistency and flexibility. |
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 thanks @ozankabak
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.
Thanks @ozankabak and @berkaysynnada and @comphead -- this looks really nice 👍
I think not only is UX better, the code is better as well
Thank you all for the reviews 🚀 |
…quotations for simple namespaced keys like `foo.bar` (apache#10483) * Don't require quotations for simple namespaced keys like foo.bar * Add comments clarifying parse error cases for unquoted namespaced keys
Which issue does this PR close?
Quick follow-on to #10404.
Rationale for this change
Now that we migrated to a consistent options syntax for external tables, we should focus on user ergonomy. I don't see a reason why we require simple namespaced option keys like
foo.bar
to have explicit quotes.What changes are included in this PR?
Tweaked parser logic to allow quoteless namespaced keys for the
OPTIONS
clause.Are these changes tested?
Added a new slt test to exercise the new code path.
Are there any user-facing changes?
Increased user ergonomy.