Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/448#discussion_r12021763
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SchemaRDD.scala ---
    @@ -313,4 +315,82 @@ class SchemaRDD(
           }
         }
       }
    +
    +  /**
    +   * Creates SchemaRDD by applying own schema to derived RDD. Typically 
used to wrap return value
    +   * of base RDD functions that do not change schema.
    +   *
    +   * @param rdd RDD derived from this one and has same schema
    +   *
    +   * @group schema
    +   */
    +  private def applySchema(rdd: RDD[Row]): SchemaRDD = {
    +    new SchemaRDD(sqlContext, 
SparkLogicalPlan(ExistingRdd(logicalPlan.output, rdd)))
    +  }
    +
    +  // 
=======================================================================
    +  // Base RDD functions that do NOT change schema
    +  // 
=======================================================================
    +
    +  // Common RDD functions
    +
    +  override def cache(): SchemaRDD = {
    --- End diff --
    
    I should have mentioned this before, but we could consider using 
`this.type` instead in the Base RDD class for these methods.  I'm not sure if 
that is breaking API or too much scala magic though. @mateiz ?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to