-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-14460] [SQL] properly handling of column name contains space #12252
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
|
Test build #55312 has finished for PR 12252 at commit
|
|
Test build #55309 has finished for PR 12252 at commit
|
|
Test build #55330 has finished for PR 12252 at commit
|
|
Test build #55328 has finished for PR 12252 at commit
|
|
@andrewor14 Could you please review my codes? |
|
Test build #55851 has finished for PR 12252 at commit
|
|
Test build #55854 has finished for PR 12252 at commit
|
| */ | ||
| def schemaString(df: DataFrame, url: String): String = { | ||
| def schemaString(dialect: JdbcDialect, df: DataFrame, url: String): String = { | ||
| val sb = new StringBuilder() |
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.
Is the new dialect you're passing in different from this one in some way?
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.
The purpose to pass in dialect is to get proper quote for columns based on its data source. Any suggestion?
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.
You pass in a parameter named dialect to the schemaString method, but there's also the dialect that comes from JdbcDialects.get(url) --- that's the duplicate I was trying to point out
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 for pointing out. I've modified the codes. Please check it out.
|
Test build #55889 has finished for PR 12252 at commit
|
|
Test build #55891 has finished for PR 12252 at commit
|
|
Test build #56384 has finished for PR 12252 at commit
|
|
seems it's fixed in #15662 ? |
|
ping @bomeng for ^. |
# What changes were proposed in this pull request? This PR proposes to close stale PRs, mostly the same instances with apache#18017 Closes apache#11459 Closes apache#13833 Closes apache#13720 Closes apache#12506 Closes apache#12456 Closes apache#12252 Closes apache#17689 Closes apache#17791 Closes apache#18163 Closes apache#17640 Closes apache#17926 Closes apache#18163 Closes apache#12506 Closes apache#18044 Closes apache#14036 Closes apache#15831 Closes apache#14461 Closes apache#17638 Closes apache#18222 Added: Closes apache#18045 Closes apache#18061 Closes apache#18010 Closes apache#18041 Closes apache#18124 Closes apache#18130 Closes apache#12217 Added: Closes apache#16291 Closes apache#17480 Closes apache#14995 Added: Closes apache#12835 Closes apache#17141 ## How was this patch tested? N/A Author: hyukjinkwon <gurwls223@gmail.com> Closes apache#18223 from HyukjinKwon/close-stale-prs.
What changes were proposed in this pull request?
Although it is not recommended, table can be created with column name containing space. For example,
When we query the table via JDBC, we also need to quote the column name in the same way if the column name contains space.
I am leveraging the quote method in the dialect, it will add the proper quote to the column name based on its data source.
How was this patch tested?
I've updated the test case to test this scenario.