-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[SPARK-20557] [SQL] Only support TIMESTAMP WITH TIME ZONE for Oracle Dialect #19939
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -151,6 +151,8 @@ class PostgresIntegrationSuite extends DockerJDBCIntegrationSuite { | |
|
|
||
| test("SPARK-20557: column type TIMESTAMP with TIME ZONE and TIME with TIME ZONE " + | ||
| "should be recognized") { | ||
| // When using JDBC to read the columns of TIMESTAMP with TIME ZONE and TIME with TIME ZONE | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity, why do we not need something similar for postgres: https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala#L61?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is for the support of |
||
| // the actual types are java.sql.Types.TIMESTAMP and java.sql.Types.TIME | ||
| val dfRead = sqlContext.read.jdbc(jdbcUrl, "ts_with_timezone", new Properties) | ||
| val rows = dfRead.collect() | ||
| val types = rows(0).toSeq.map(x => x.getClass.toString) | ||
|
|
||
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.
how do you make sure sesson time zone is same with JVM time zone?
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.
oh i see, session time zone is dynamically evaluated with JVM timezone if not set, so we need to guarantee that session time zone is not set here.
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 feel it's safer if we also set session local time zone in
withTimeZone