You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by JannikArndt <gi...@git.apache.org> on 2017/05/02 13:49:02 UTC

[GitHub] spark pull request #17832: [SPARK-20557][SQL] Support for db column type TIM...

GitHub user JannikArndt opened a pull request:

    https://github.com/apache/spark/pull/17832

    [SPARK-20557][SQL] Support for db column type TIMESTAMP WITH TIME ZONE

    ## What changes were proposed in this pull request?
    
    SparkSQL can now read from a database table with column type [TIMESTAMP WITH TIME ZONE](https://docs.oracle.com/javase/8/docs/api/java/sql/Types.html#TIMESTAMP_WITH_TIMEZONE).
    
    ## How was this patch tested?
    
    Tested against Oracle database.
     
     
     
    @JoshRosen, you seem to know the class, would you look at this? Thanks!

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/JannikArndt/spark spark-20557-timestamp-with-timezone

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/17832.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17832
    
----
commit 44050ad3c6c616173e7903cde6f7ae5560a2dcdd
Author: Jannik Arndt <ja...@jannikarndt.de>
Date:   2017-05-02T13:39:31Z

    Fixes SPARK-20557, adds support for db column type TIMESTAMP WITH TIME ZONE

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17832: [SPARK-20557][SQL] Support for db column type TIM...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17832#discussion_r114396178
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -223,6 +223,9 @@ object JdbcUtils extends Logging {
           case java.sql.Types.STRUCT        => StringType
           case java.sql.Types.TIME          => TimestampType
           case java.sql.Types.TIMESTAMP     => TimestampType
    +      case java.sql.Types.TIMESTAMP_WITH_TIMEZONE
    +                                        => TimestampType
    +      case -101                         => TimestampType
    --- End diff --
    
    Could you add a test case to `OracleIntegrationSuite`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17832: [SPARK-20557][SQL] Support for db column type TIM...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17832#discussion_r114472869
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -223,6 +223,9 @@ object JdbcUtils extends Logging {
           case java.sql.Types.STRUCT        => StringType
           case java.sql.Types.TIME          => TimestampType
           case java.sql.Types.TIMESTAMP     => TimestampType
    +      case java.sql.Types.TIMESTAMP_WITH_TIMEZONE
    +                                        => TimestampType
    +      case -101                         => TimestampType
    --- End diff --
    
    Hi, @JannikArndt 
    Could you add a comment describing about `-101` here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    Yes. I also did it. Thanks! @dongjoon-hyun @JannikArndt 
    
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17832: [SPARK-20557][SQL] Support for db column type TIM...

Posted by JannikArndt <gi...@git.apache.org>.
Github user JannikArndt commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17832#discussion_r114371413
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -223,6 +223,9 @@ object JdbcUtils extends Logging {
           case java.sql.Types.STRUCT        => StringType
           case java.sql.Types.TIME          => TimestampType
           case java.sql.Types.TIMESTAMP     => TimestampType
    +      case java.sql.Types.TIMESTAMP_WITH_TIMEZONE
    +                                        => TimestampType
    +      case -101                         => TimestampType
    --- End diff --
    
    `-101` is the code Oracle databases use for `TIMESTAMP WITH TIME ZONE`. There is unfortunately no equivalent in the `java.sql.Types` Enum (https://docs.oracle.com/javase/8/docs/api/java/sql/Types.html)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76498/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17832: [SPARK-20557][SQL] Support for db column type TIM...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17832#discussion_r114413847
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -223,6 +223,9 @@ object JdbcUtils extends Logging {
           case java.sql.Types.STRUCT        => StringType
           case java.sql.Types.TIME          => TimestampType
           case java.sql.Types.TIMESTAMP     => TimestampType
    +      case java.sql.Types.TIMESTAMP_WITH_TIMEZONE
    +                                        => TimestampType
    +      case -101                         => TimestampType
    --- End diff --
    
    I did a try. The fix works in my local docker test environment. Below is the way how we run docker integration test. 
    
    ```
    build/mvn -Pyarn -Phadoop-2.6 -Dhadoop.version=2.6.0  -Phive-thriftserver -Phive -DskipTests  install
    
    Before running dockers test . You need to set the docker env variabled. Following does the magic:
    eval $(docker-machine env default)
    
    build/mvn -Pdocker-integration-tests -pl :spark-docker-integration-tests_2.11  compile test
    ```
    
    Feel free to ping me if you hit any issue. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    NVM, I will do it in my PR. Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    ok to test


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    @JannikArndt Could you check whether we can do the same thing for `TIME WITH TIME ZONE`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17832: [SPARK-20557][SQL] Support for db column type TIM...

Posted by atrigent <gi...@git.apache.org>.
Github user atrigent commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17832#discussion_r125385324
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -223,6 +223,9 @@ object JdbcUtils extends Logging {
           case java.sql.Types.STRUCT        => StringType
           case java.sql.Types.TIME          => TimestampType
           case java.sql.Types.TIMESTAMP     => TimestampType
    +      case java.sql.Types.TIMESTAMP_WITH_TIMEZONE
    +                                        => TimestampType
    +      case -101                         => TimestampType
    --- End diff --
    
    Why was this `-101` thing put here instead of in the Oracle dialect?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    Can one of the admins verify this patch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17832: [SPARK-20557][SQL] Support for db column type TIM...

Posted by JannikArndt <gi...@git.apache.org>.
Github user JannikArndt commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17832#discussion_r114765105
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -223,6 +223,9 @@ object JdbcUtils extends Logging {
           case java.sql.Types.STRUCT        => StringType
           case java.sql.Types.TIME          => TimestampType
           case java.sql.Types.TIMESTAMP     => TimestampType
    +      case java.sql.Types.TIMESTAMP_WITH_TIMEZONE
    +                                        => TimestampType
    +      case -101                         => TimestampType
    --- End diff --
    
    Write fix: 5 min ✅ 
    Write test: 5 min ✅ 
    Run test: 3 h. ✅ 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    **[Test build #76498 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76498/testReport)** for PR 17832 at commit [`113fd53`](https://github.com/apache/spark/commit/113fd53696417f00aea1aa6f892d92a754cca646).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    +1. LGTM. I also tested with docker integration test with/without this patch.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    Thanks! Merging to master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17832: [SPARK-20557][SQL] Support for db column type TIM...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/17832


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    can you please rebase your PR? it's including a lot of changes from other people


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by JannikArndt <gi...@git.apache.org>.
Github user JannikArndt commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    @felixcheung Done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17832: [SPARK-20557][SQL] Support for db column type TIM...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17832#discussion_r114370576
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -223,6 +223,9 @@ object JdbcUtils extends Logging {
           case java.sql.Types.STRUCT        => StringType
           case java.sql.Types.TIME          => TimestampType
           case java.sql.Types.TIMESTAMP     => TimestampType
    +      case java.sql.Types.TIMESTAMP_WITH_TIMEZONE
    +                                        => TimestampType
    +      case -101                         => TimestampType
    --- End diff --
    
    What is -101?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17832: [SPARK-20557][SQL] Support for db column type TIMESTAMP ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17832
  
    **[Test build #76498 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76498/testReport)** for PR 17832 at commit [`113fd53`](https://github.com/apache/spark/commit/113fd53696417f00aea1aa6f892d92a754cca646).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org