You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by davies <gi...@git.apache.org> on 2015/02/27 08:31:15 UTC

[GitHub] spark pull request: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

GitHub user davies opened a pull request:

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

    [SPARK-6055] [PySpark] fix incorrect __eq__ of DataType

    The _eq_ of DataType is not correct, class cache is not use correctly (created class can not be find by dataType), then it will create lots of classes (saved in _cached_cls), never released.
    
    Also, all same DataType have same hash code, there will be many object in a dict with the same hash code, end with hash attach, it's very slow to access this dict (depends on the implementation of CPython).
    
    This PR also improve the performance of inferSchema (avoid the unnecessary converter of object). 
    
    cc @pwendell  @JoshRosen 

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

    $ git pull https://github.com/davies/spark leak

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

    https://github.com/apache/spark/pull/4808.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 #4808
    
----
commit d9ae973ecf2f5171f521da1d898c9f3c13ca8255
Author: Davies Liu <da...@databricks.com>
Date:   2015-02-27T07:17:05Z

    fix memory leak in sql

----


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76440483
  
      [Test build #28072 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/28072/consoleFull) for   PR 4808 at commit [`46999dc`](https://github.com/apache/spark/commit/46999dc429269b90b69235b90fa10f6833ce19e9).
     * 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 pull request: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25541056
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -64,6 +64,8 @@ def json(self):
                               sort_keys=True)
     
     
    +# This singleton pattern does not work with pickle, you will get
    --- End diff --
    
    Would it be possible to have singletons that pickled properly if we implemented a custom `__reduce__()` method?  Was the old `__eq__` behavior an important performance optimization?


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

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


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76355317
  
      [Test build #28053 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/28053/consoleFull) for   PR 4808 at commit [`d9ae973`](https://github.com/apache/spark/commit/d9ae973ecf2f5171f521da1d898c9f3c13ca8255).
     * 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 pull request: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/4808#issuecomment-76477158
  
    It looks like `_restore_object` still tries to use DataType instance `id`s as `_cached_cls` dictionary keys during unpickling; is this still necessary if the DataTypes aren't singletons after unpickling?


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76440495
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/28072/
    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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76490134
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/28094/
    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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25491455
  
    --- Diff: python/pyspark/sql/context.py ---
    @@ -620,93 +619,6 @@ def _get_hive_ctx(self):
             return self._jvm.HiveContext(self._jsc.sc())
     
     
    -def _create_row(fields, values):
    --- End diff --
    
    These are duplicated, also in types.py.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76424926
  
      [Test build #28072 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/28072/consoleFull) for   PR 4808 at commit [`46999dc`](https://github.com/apache/spark/commit/46999dc429269b90b69235b90fa10f6833ce19e9).
     * This patch merges cleanly.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/4808#issuecomment-76478827
  
    Makes sense; LGTM.  I'll take a look at the backport patches, 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 pull request: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25538900
  
    --- Diff: python/pyspark/sql/context.py ---
    @@ -620,93 +619,6 @@ def _get_hive_ctx(self):
             return self._jvm.HiveContext(self._jsc.sc())
     
     
    -def _create_row(fields, values):
    --- End diff --
    
    Yep, good catch.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76472673
  
      [Test build #28084 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/28084/consoleFull) for   PR 4808 at commit [`3da44fc`](https://github.com/apache/spark/commit/3da44fc88dbbff0bd2b12e5950a13d1f92129dbd).
     * This patch **fails Spark 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 pull request: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25541695
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -64,6 +64,8 @@ def json(self):
                               sort_keys=True)
     
     
    +# This singleton pattern does not work with pickle, you will get
    --- End diff --
    
    We discussed this, the old implementation is a bit of over optimization, I think.
    
    For PrimitiveTypeSingleton, the __dict__ is empty, so the new implementation is not so heavy, so there will be no much performance difference.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76456279
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/28079/
    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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25539940
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -505,6 +508,9 @@ def __eq__(self, other):
     
     def _parse_datatype_json_string(json_string):
         """Parses the given data type JSON string.
    +    >>> import pickle
    --- End diff --
    
    It looks like this is a regression test for the singleton `__eq__` issue.  It feels a little odd to have this as a doctest as opposed to a dedicated `unittest` regression test.  Maybe we could move this into a new test case and add a comment referencing this JIRA?


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

Posted by davies <gi...@git.apache.org>.
Github user davies commented on the pull request:

    https://github.com/apache/spark/pull/4808#issuecomment-76478450
  
    @JoshRosen Because we serialized the objects in batch, and pickle memorize the multiple occurrences of same object  in the batch, finally we will get single DataType object (even for StructType), we can benefits from this optimization, no `__hash__` and `__eq__` for later row in the batch.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76490120
  
      [Test build #28094 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/28094/consoleFull) for   PR 4808 at commit [`6a322a4`](https://github.com/apache/spark/commit/6a322a40e036d50baadb636ed804a40b7f600a47).
     * 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 pull request: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25540375
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -786,8 +792,24 @@ def _merge_type(a, b):
             return a
     
     
    +def _need_converter(dataType):
    +    if isinstance(dataType, StructType):
    +        return True
    +    elif isinstance(dataType, ArrayType):
    +        return _need_converter(dataType.elementType)
    +    elif isinstance(dataType, MapType):
    +        return _need_converter(dataType.keyType) or _need_converter(dataType.valueType)
    +    elif isinstance(dataType, NullType):
    +        return True
    +    else:
    +        return False
    +
    +
     def _create_converter(dataType):
         """Create an converter to drop the names of fields in obj """
    +    if not _need_converter(dataType):
    --- End diff --
    
    Is this particular call to `_need_converter()` acting as an optimization?  It performs the same sequence of `isinstance` checks as the code below, so don't know if it's actually saving any work in this case.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25539749
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -242,11 +240,12 @@ def __init__(self, elementType, containsNull=True):
             :param elementType: the data type of elements.
             :param containsNull: indicates whether the list contains None values.
     
    -        >>> ArrayType(StringType) == ArrayType(StringType, True)
    +        >>> ArrayType(StringType()) == ArrayType(StringType(), True)
    --- End diff --
    
    Old tests are incorrect. 


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25541610
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -786,8 +792,24 @@ def _merge_type(a, b):
             return a
     
     
    +def _need_converter(dataType):
    +    if isinstance(dataType, StructType):
    +        return True
    +    elif isinstance(dataType, ArrayType):
    +        return _need_converter(dataType.elementType)
    +    elif isinstance(dataType, MapType):
    +        return _need_converter(dataType.keyType) or _need_converter(dataType.valueType)
    +    elif isinstance(dataType, NullType):
    +        return True
    +    else:
    +        return False
    +
    +
     def _create_converter(dataType):
         """Create an converter to drop the names of fields in obj """
    +    if not _need_converter(dataType):
    --- End diff --
    
    Ah, right; I overlooked that.  Makes sense.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76478760
  
      [Test build #28094 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/28094/consoleFull) for   PR 4808 at commit [`6a322a4`](https://github.com/apache/spark/commit/6a322a40e036d50baadb636ed804a40b7f600a47).
     * This patch merges cleanly.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76355323
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/28053/
    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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76456268
  
      [Test build #28079 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/28079/consoleFull) for   PR 4808 at commit [`534ac90`](https://github.com/apache/spark/commit/534ac90c4c1c5aee5910db10492147a6baae0613).
     * 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 pull request: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76350623
  
      [Test build #28053 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/28053/consoleFull) for   PR 4808 at commit [`d9ae973`](https://github.com/apache/spark/commit/d9ae973ecf2f5171f521da1d898c9f3c13ca8255).
     * This patch merges cleanly.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76472679
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/28084/
    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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25541539
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -786,8 +792,24 @@ def _merge_type(a, b):
             return a
     
     
    +def _need_converter(dataType):
    +    if isinstance(dataType, StructType):
    +        return True
    +    elif isinstance(dataType, ArrayType):
    +        return _need_converter(dataType.elementType)
    +    elif isinstance(dataType, MapType):
    +        return _need_converter(dataType.keyType) or _need_converter(dataType.valueType)
    +    elif isinstance(dataType, NullType):
    +        return True
    +    else:
    +        return False
    +
    +
     def _create_converter(dataType):
         """Create an converter to drop the names of fields in obj """
    +    if not _need_converter(dataType):
    --- End diff --
    
    It's useful for ArrayType and MapType, can it didnot can `lambda x:x` on all the objects in 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 pull request: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25539993
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -505,6 +508,9 @@ def __eq__(self, other):
     
     def _parse_datatype_json_string(json_string):
         """Parses the given data type JSON string.
    +    >>> import pickle
    --- End diff --
    
    e.g. maybe put it in `sql/tests.py`?


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25539648
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -242,11 +240,12 @@ def __init__(self, elementType, containsNull=True):
             :param elementType: the data type of elements.
             :param containsNull: indicates whether the list contains None values.
     
    -        >>> ArrayType(StringType) == ArrayType(StringType, True)
    +        >>> ArrayType(StringType()) == ArrayType(StringType(), True)
    --- End diff --
    
    Is this a breaking API change?  Or were the old doctests showing incorrect usage of the API?


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#discussion_r25540054
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -505,6 +508,9 @@ def __eq__(self, other):
     
     def _parse_datatype_json_string(json_string):
         """Parses the given data type JSON string.
    +    >>> import pickle
    --- End diff --
    
    make sense, will do.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/4808#issuecomment-76510949
  
    LGTM, so I've merged this into `branch-1.3` (1.3.0) and `master` (1.4.0).  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 pull request: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76445822
  
      [Test build #28079 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/28079/consoleFull) for   PR 4808 at commit [`534ac90`](https://github.com/apache/spark/commit/534ac90c4c1c5aee5910db10492147a6baae0613).
     * This patch merges cleanly.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

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

    https://github.com/apache/spark/pull/4808#issuecomment-76464338
  
      [Test build #28084 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/28084/consoleFull) for   PR 4808 at commit [`3da44fc`](https://github.com/apache/spark/commit/3da44fc88dbbff0bd2b12e5950a13d1f92129dbd).
     * This patch merges cleanly.


---
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: [SPARK-6055] [PySpark] fix incorrect __eq__ of...

Posted by davies <gi...@git.apache.org>.
Github user davies commented on the pull request:

    https://github.com/apache/spark/pull/4808#issuecomment-76350548
  
    will create another PR for 1.2 and 1.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