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/24 08:09:11 UTC

[GitHub] [spark] zhengruifeng commented on a diff in pull request #40540: [SPARK-42914][PYTHON] Reuse `transformUnregisteredFunction` for `DistributedSequenceID`.

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


##########
python/pyspark/sql/connect/expressions.py:
##########
@@ -974,13 +974,3 @@ def to_plan(self, session: "SparkConnectClient") -> proto.Expression:
 
     def __repr__(self) -> str:
         return f"WindowExpression({str(self._windowFunction)}, ({str(self._windowSpec)}))"
-

Review Comment:
   I think maybe we can just modify the `to_plan` method in `class DistributedSequenceID`
   
   ```
       def to_plan(self, session: "SparkConnectClient") -> proto.Expression:
           unresolved_function = UnresolvedFunction(name="distributed_sequence_id", args=[])
           return unresolved_function.to_plan(session)
   ```
   
   then we don't need to add `def _distributed_sequence_id ` and change the python tests



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