You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2023/03/04 06:37:19 UTC

[GitHub] [spark] zhengruifeng commented on a diff in pull request #40270: [SPARK-42662][CONNECT][PYTHON][PS] Support `withSequenceColumn` as PySpark DataFrame internal function.

zhengruifeng commented on code in PR #40270:
URL: https://github.com/apache/spark/pull/40270#discussion_r1125387144


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -509,6 +511,13 @@ class SparkConnectPlanner(val session: SparkSession) {
       .logicalPlan
   }
 
+  private def transformWithSequenceColumn(rel: proto.WithSequenceColumn): LogicalPlan = {
+    Dataset
+      .ofRows(session, transformRelation(rel.getInput))
+      .withSequenceColumn(rel.getName)
+      .logicalPlan

Review Comment:
   you could directly build the plan:
   ```
         AttachDistributedSequence(
           AttributeReference(rel.getName, LongType, nullable = false)(),
           transformRelation(rel.getInput))
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org