You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by JasonMWhite <gi...@git.apache.org> on 2017/03/08 01:22:55 UTC

[GitHub] spark pull request #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

GitHub user JasonMWhite opened a pull request:

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

    [SPARK-19561][Python] cast TimestampType.toInternal output to long

    ## What changes were proposed in this pull request?
    
    Cast the output of `TimestampType.toInternal` to long to allow for proper Timestamp creation in DataFrames near the epoch.
    
    ## How was this patch tested?
    
    Added a new test that fails without the change.
    
    The contribution is my original work and I license the work to the project under the project\u2019s open source license.
    
    Resubmission of https://github.com/apache/spark/pull/16896. The original PR didn't go through Jenkins and broke the build. @davies @dongjoon-hyun
    
    @cloud-fan Could you kick off a Jenkins run for me? It passed everything for me locally, but it's possible something has changed in the last few weeks.

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

    $ git pull https://github.com/JasonMWhite/spark SPARK-19561

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

    https://github.com/apache/spark/pull/17200.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 #17200
    
----
commit 4238533f8699dfff75d3b5fe437668cc0ce4d55c
Author: Jason White <ja...@shopify.com>
Date:   2017-02-11T21:39:19Z

    cast TimestampType.toInternal output to long

commit 5b1dd6785014bc8159e5c8b2c22a18ecb673afde
Author: Jason White <ja...@shopify.com>
Date:   2017-02-16T03:09:19Z

    replace int function call with long

----


---
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 #17200: [SPARK-19561][SQL] cast TimestampType.toInternal output ...

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

    https://github.com/apache/spark/pull/17200
  
    **[Test build #74240 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74240/testReport)** for PR 17200 at commit [`bee635a`](https://github.com/apache/spark/commit/bee635a3ebd96fe28e04b0fd95290b6960ea8d22).


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/74254/
    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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

    https://github.com/apache/spark/pull/17200
  
    Merged build finished. Test FAILed.


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

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


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

    https://github.com/apache/spark/pull/17200
  
    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 issue #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    oh, the PR description is not correct now. Can you update it too?



---
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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

    https://github.com/apache/spark/pull/17200
  
    Ah, test failed on Python 3.4 only. That makes some sense, I only tested locally on 2.6, and there are changes with how Python 3 handles ints vs longs. I'll dig in with Python 3.4 and see if I can see the cause for the test failure.


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r104856801
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -189,7 +189,7 @@ def toInternal(self, dt):
             if dt is not None:
                 seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
    --- End diff --
    
    https://github.com/bartdag/py4j/blob/master/py4j-python/src/py4j/protocol.py#L271-L275
    
    Py4J automatically serializes any Python integer larger than 2 ^ 31 as `LONG_TYPE`, otherwise it's `INTEGER_TYPE`. Python longs are always serialized as `LONG_TYPE`.
    
    I suspect my issue with Python 3 is that there is no more `long`, it's all just `int`. This may require a fix on the Scala side to accept either an int or a long to the appropriate constructor.


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    retest this please.


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

    https://github.com/apache/spark/pull/17200
  
    **[Test build #74178 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74178/testReport)** for PR 17200 at commit [`5b1dd67`](https://github.com/apache/spark/commit/5b1dd6785014bc8159e5c8b2c22a18ecb673afde).


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r105083494
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -189,7 +189,7 @@ def toInternal(self, dt):
             if dt is not None:
                 seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
    --- End diff --
    
    I will, yes. Trying to find where the appropriate location is in the Scala code.


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r105069175
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -189,7 +189,7 @@ def toInternal(self, dt):
             if dt is not None:
                 seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
    --- End diff --
    
    @JasonMWhite Are you going to submit another PR for it?


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

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


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r104845981
  
    --- Diff: python/pyspark/sql/tests.py ---
    @@ -1435,6 +1435,12 @@ def test_time_with_timezone(self):
             self.assertEqual(now, now1)
             self.assertEqual(now, utcnow1)
     
    +    # regression test for SPARK-19561
    +    def test_datetime_at_epoch(self):
    +        epoch = datetime.datetime.fromtimestamp(0)
    +        df = self.spark.createDataFrame([Row(date=epoch)])
    +        self.assertEqual(df.first()['date'], epoch)
    --- End diff --
    
    This test is invalid. `df.first()['date']` is `None` even in current master branch.


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r104855668
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -189,7 +189,7 @@ def toInternal(self, dt):
             if dt is not None:
                 seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
    --- End diff --
    
    hmm, for the value of `epoch = datetime.datetime.fromtimestamp(0)`, `seconds` is 0. What is it different to use `int` or `long`?


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r104869596
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -189,7 +189,7 @@ def toInternal(self, dt):
             if dt is not None:
                 seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
    --- End diff --
    
    Due the Python3 doesn't have `long` anymore, I think we can't solve this in python. I can fix this in JVM side.


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    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 issue #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

    https://github.com/apache/spark/pull/17200
  
    **[Test build #74239 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74239/testReport)** for PR 17200 at commit [`a1936af`](https://github.com/apache/spark/commit/a1936afddb5e16f4b8f8954cd07ce78ad3e58ea3).
     * This patch **fails Python style 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 pull request #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r104856310
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -189,7 +189,7 @@ def toInternal(self, dt):
             if dt is not None:
                 seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
    --- End diff --
    
    The JIRA ticket has the details: https://issues.apache.org/jira/browse/SPARK-19561. But in a nutshell, that's the point: `int(0)` fails but `long(0)` succeeds.


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    **[Test build #74252 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74252/testReport)** for PR 17200 at commit [`bee635a`](https://github.com/apache/spark/commit/bee635a3ebd96fe28e04b0fd95290b6960ea8d22).


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    Merged build finished. Test FAILed.


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    **[Test build #74254 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74254/testReport)** for PR 17200 at commit [`bee635a`](https://github.com/apache/spark/commit/bee635a3ebd96fe28e04b0fd95290b6960ea8d22).


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

    https://github.com/apache/spark/pull/17200
  
    **[Test build #74178 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74178/testReport)** for PR 17200 at commit [`5b1dd67`](https://github.com/apache/spark/commit/5b1dd6785014bc8159e5c8b2c22a18ecb673afde).
     * This patch **fails PySpark unit 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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    Thanks @cloud-fan !


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

    https://github.com/apache/spark/pull/17200
  
    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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    **[Test build #74254 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74254/testReport)** for PR 17200 at commit [`bee635a`](https://github.com/apache/spark/commit/bee635a3ebd96fe28e04b0fd95290b6960ea8d22).
     * 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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

    https://github.com/apache/spark/pull/17200
  
    Merged build finished. Test FAILed.


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/74252/
    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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

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


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    thanks, merging to master/2.1!


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r104919956
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -189,7 +189,7 @@ def toInternal(self, dt):
             if dt is not None:
                 seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
    --- End diff --
    
    Agreed.


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    **[Test build #74252 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74252/testReport)** for PR 17200 at commit [`bee635a`](https://github.com/apache/spark/commit/bee635a3ebd96fe28e04b0fd95290b6960ea8d22).
     * 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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

    https://github.com/apache/spark/pull/17200
  
    **[Test build #74239 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/74239/testReport)** for PR 17200 at commit [`a1936af`](https://github.com/apache/spark/commit/a1936afddb5e16f4b8f8954cd07ce78ad3e58ea3).


---
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 #17200: [SPARK-19561][SQL] cast TimestampType.toInternal output ...

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

    https://github.com/apache/spark/pull/17200
  
    LGTM except for a minor comment.


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r104861095
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -189,7 +189,7 @@ def toInternal(self, dt):
             if dt is not None:
                 seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
    --- End diff --
    
    I just tested it. In Python3, even `toInternal` returns Python's `long`, you still can a `java.lang.Integer` in JVM side.
    
    However, in Python2, you can get `java.lang.Long`.


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toInternal outp...

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

    https://github.com/apache/spark/pull/17200
  
    Btw, since it is a change to SQL code. Better to add `[SQL]` to the title.


---
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 #17200: [SPARK-19561][SQL] add int case handling for Time...

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

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


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r104847039
  
    --- Diff: python/pyspark/sql/tests.py ---
    @@ -1435,6 +1435,12 @@ def test_time_with_timezone(self):
             self.assertEqual(now, now1)
             self.assertEqual(now, utcnow1)
     
    +    # regression test for SPARK-19561
    +    def test_datetime_at_epoch(self):
    +        epoch = datetime.datetime.fromtimestamp(0)
    +        df = self.spark.createDataFrame([Row(date=epoch)])
    +        self.assertEqual(df.first()['date'], epoch)
    --- End diff --
    
    Yes, that's the bug this PR is fixing. It shouldn't be `None`.


---
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 #17200: [SPARK-19561][SQL] add int case handling for TimestampTy...

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

    https://github.com/apache/spark/pull/17200
  
    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 pull request #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r105094257
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/python/EvaluatePython.scala ---
    @@ -112,6 +112,7 @@ object EvaluatePython {
         case (c: Int, DateType) => c
     
         case (c: Long, TimestampType) => c
    +    case (c: Int, TimestampType) => c.toLong
    --- End diff --
    
    Can you add a comment for the reason?


---
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 #17200: [SPARK-19561][Python] cast TimestampType.toIntern...

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

    https://github.com/apache/spark/pull/17200#discussion_r104858211
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -189,7 +189,7 @@ def toInternal(self, dt):
             if dt is not None:
                 seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
    --- End diff --
    
    Thanks. Interesting.


---
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