You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by rxin <gi...@git.apache.org> on 2015/04/23 07:08:51 UTC

[GitHub] spark pull request: [SPARK-7068][SQL] Remove PrimitiveType

GitHub user rxin opened a pull request:

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

    [SPARK-7068][SQL] Remove PrimitiveType

    

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

    $ git pull https://github.com/rxin/spark remove-primitive-type

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

    https://github.com/apache/spark/pull/5646.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 #5646
    
----
commit 01b673d17048b0727a83ca3f86be327a2a6e1365
Author: Reynold Xin <rx...@databricks.com>
Date:   2015-04-23T05:07:58Z

    [SPARK-7068][SQL] Remove PrimitiveType

----


---
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-7068][SQL] Remove PrimitiveType

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

    https://github.com/apache/spark/pull/5646#discussion_r28937000
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/dataTypes.scala ---
    @@ -190,13 +205,11 @@ object DataType {
             equalsIgnoreNullability(leftKeyType, rightKeyType) &&
             equalsIgnoreNullability(leftValueType, rightValueType)
           case (StructType(leftFields), StructType(rightFields)) =>
    -        leftFields.size == rightFields.size &&
    -        leftFields.zip(rightFields)
    -          .forall{
    -            case (left, right) =>
    -              left.name == right.name && equalsIgnoreNullability(left.dataType, right.dataType)
    -          }
    -      case (left, right) => left == right
    +        leftFields.length == rightFields.length &&
    --- End diff --
    
    left / right were shadowing outer scope variables so i renamed them l, r 


---
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-7068][SQL] Remove PrimitiveType

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

    https://github.com/apache/spark/pull/5646#issuecomment-95435210
  
      [Test build #30810 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/30810/consoleFull) for   PR 5646 at commit [`01b673d`](https://github.com/apache/spark/commit/01b673d17048b0727a83ca3f86be327a2a6e1365).


---
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-7068][SQL] Remove PrimitiveType

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

    https://github.com/apache/spark/pull/5646#issuecomment-95464699
  
      [Test build #30810 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/30810/consoleFull) for   PR 5646 at commit [`01b673d`](https://github.com/apache/spark/commit/01b673d17048b0727a83ca3f86be327a2a6e1365).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `protected[sql] abstract class NativeType extends DataType `
      * `abstract class NumericType extends NativeType `
    
     * This patch does not change any dependencies.


---
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-7068][SQL] Remove PrimitiveType

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

    https://github.com/apache/spark/pull/5646#issuecomment-95464709
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/30810/
    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-7068][SQL] Remove PrimitiveType

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

    https://github.com/apache/spark/pull/5646#discussion_r28936992
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/dataTypes.scala ---
    @@ -41,6 +41,21 @@ import org.apache.spark.util.Utils
     object DataType {
       def fromJson(json: String): DataType = parseDataType(parse(json))
     
    +  private val nonDecimalNameToType = {
    --- End diff --
    
    this is just copied from down below (originally in PrimitiveType)


---
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-7068][SQL] Remove PrimitiveType

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

    https://github.com/apache/spark/pull/5646#discussion_r28937072
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetTypes.scala ---
    @@ -48,8 +48,10 @@ private[parquet] case class ParquetTypeInfo(
       length: Option[Int] = None)
     
     private[parquet] object ParquetTypesConverter extends Logging {
    -  def isPrimitiveType(ctype: DataType): Boolean =
    -    classOf[PrimitiveType] isAssignableFrom ctype.getClass
    +  def isPrimitiveType(ctype: DataType): Boolean = ctype match {
    +    case _: NumericType | BooleanType | StringType | BinaryType => true
    --- End diff --
    
    We need to put all types other than `MapType`, `ArrayType`, and `StructType` here. Parquet uses this function to create record converters [here] [1].
    
    [1]: https://github.com/apache/spark/blob/03e85b4a11899f37424cd6e1f8d71f1d704c90bb/sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetConverter.scala#L161-L165


---
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-7068][SQL] Remove PrimitiveType

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

    https://github.com/apache/spark/pull/5646#issuecomment-95442354
  
    LGTM pending Jenkins.


---
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-7068][SQL] Remove PrimitiveType

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

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


---
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-7068][SQL] Remove PrimitiveType

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

    https://github.com/apache/spark/pull/5646#discussion_r28937160
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetTypes.scala ---
    @@ -48,8 +48,10 @@ private[parquet] case class ParquetTypeInfo(
       length: Option[Int] = None)
     
     private[parquet] object ParquetTypesConverter extends Logging {
    -  def isPrimitiveType(ctype: DataType): Boolean =
    -    classOf[PrimitiveType] isAssignableFrom ctype.getClass
    +  def isPrimitiveType(ctype: DataType): Boolean = ctype match {
    +    case _: NumericType | BooleanType | StringType | BinaryType => true
    --- End diff --
    
    My bad. `CatalystGroupConverter` actually can handle all types properly. Thought it only handles complex types at first.


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