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

    https://github.com/apache/spark/pull/12952#discussion_r62345191
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala 
---
    @@ -463,7 +463,12 @@ class SparkSession private(
        */
       @Experimental
       def range(start: Long, end: Long, step: Long, numPartitions: Int): 
Dataset[java.lang.Long] = {
    -    new Dataset(self, Range(start, end, step, numPartitions), 
Encoders.LONG)
    +    val encoder = {
    +      val schema = StructType(Seq(StructField("id", LongType, nullable = 
false)))
    +      ExpressionEncoder[java.lang.Long]().copy[java.lang.Long](schema = 
schema)
    +    }
    +
    +    new Dataset(self, Range(start, end, step, numPartitions), encoder)
    --- End diff --
    
    We are now using the encoder schema as Dataset schema, thus we need to 
rename the default primitive encoder column name "value" to the desired name.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to