Skip to content

Conversation

@huaxingao
Copy link
Contributor

When query the Timestamp or Date column like the following
val filtered = jdbcdf.where($"TIMESTAMP_COLUMN" &gt;= beg &amp;&amp; $"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'"

@JoshRosen
Copy link
Contributor

Can you add a regression test for this?

@huaxingao
Copy link
Contributor Author

Sure. Will add a test.

@huaxingao
Copy link
Contributor Author

@JoshRosen
Regression test added. Could you please take a look?
Thanks a lot for your help!!

@rxin
Copy link
Contributor

rxin commented Nov 27, 2015

LGTM - Jenkins, test this please.

@rxin
Copy link
Contributor

rxin commented Nov 27, 2015

Can you update the title to

"[SPARK-11788][SQL] surround timestamp/date value with quotes in JDBC data source"

@SparkQA
Copy link

SparkQA commented Nov 27, 2015

Test build #2122 has finished for PR 9872 at commit ece3838.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@huaxingao huaxingao changed the title [SPARK-11788][SQL]:surround timestamp/date value with quotes [SPARK-11788][SQL] surround timestamp/date value with quotes in JDBC data source Nov 27, 2015
@huaxingao
Copy link
Contributor Author

Fixed title and scala style problem. Thanks!

@SparkQA
Copy link

SparkQA commented Dec 1, 2015

Test build #2135 has finished for PR 9872 at commit 6bfcea0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yhuai
Copy link
Contributor

yhuai commented Dec 1, 2015

Merging to master and branch 1.6.

asfgit pushed a commit that referenced this pull request Dec 1, 2015
…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]>
@asfgit asfgit closed this in 5a8b5fd Dec 1, 2015
asfgit pushed a commit that referenced this pull request Dec 2, 2015
…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
@yhuai
Copy link
Contributor

yhuai commented Dec 2, 2015

I also merged it in branch 1.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants