-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-11788][SQL] surround timestamp/date value with quotes in JDBC data source #9872
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
|
Can you add a regression test for this? |
|
Sure. Will add a test. |
|
@JoshRosen |
|
LGTM - Jenkins, test this please. |
|
Can you update the title to "[SPARK-11788][SQL] surround timestamp/date value with quotes in JDBC data source" |
|
Test build #2122 has finished for PR 9872 at commit
|
|
Fixed title and scala style problem. Thanks! |
|
Test build #2135 has finished for PR 9872 at commit
|
|
Merging to master and branch 1.6. |
…data source When query the Timestamp or Date column like the following val filtered = jdbcdf.where($"TIMESTAMP_COLUMN" >= beg && $"TIMESTAMP_COLUMN" < end) The generated SQL query is "TIMESTAMP_COLUMN >= 2015-01-01 00:00:00.0" It should have quote around the Timestamp/Date value such as "TIMESTAMP_COLUMN >= '2015-01-01 00:00:00.0'" Author: Huaxin Gao <[email protected]> Closes #9872 from huaxingao/spark-11788. (cherry picked from commit 5a8b5fd) Signed-off-by: Yin Huai <[email protected]>
…data source When query the Timestamp or Date column like the following val filtered = jdbcdf.where($"TIMESTAMP_COLUMN" >= beg && $"TIMESTAMP_COLUMN" < end) The generated SQL query is "TIMESTAMP_COLUMN >= 2015-01-01 00:00:00.0" It should have quote around the Timestamp/Date value such as "TIMESTAMP_COLUMN >= '2015-01-01 00:00:00.0'" Author: Huaxin Gao <[email protected]> Closes #9872 from huaxingao/spark-11788. (cherry picked from commit 5a8b5fd) Signed-off-by: Yin Huai <[email protected]> Conflicts: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala
|
I also merged it in branch 1.5. |
When query the Timestamp or Date column like the following$"TIMESTAMP_COLUMN" >= beg && $ "TIMESTAMP_COLUMN" < end)
val filtered = jdbcdf.where(
The generated SQL query is "TIMESTAMP_COLUMN >= 2015-01-01 00:00:00.0"
It should have quote around the Timestamp/Date value such as "TIMESTAMP_COLUMN >= '2015-01-01 00:00:00.0'"