amaliujia commented on code in PR #38586:
URL: https://github.com/apache/spark/pull/38586#discussion_r1018704727


##########
python/pyspark/sql/connect/column.py:
##########
@@ -30,8 +30,8 @@
 
 def _bin_op(
     name: str, doc: str = "binary function", reverse: bool = False
-) -> Callable[["ColumnRef", Any], "Expression"]:
-    def _(self: "ColumnRef", other: Any) -> "Expression":
+) -> Callable[["Column", Any], "Expression"]:
+    def _(self: "Column", other: Any) -> "Expression":

Review Comment:
   I am sure the current `Column` (or `ColumnRef`) is a concept of reference 
attribute based on its `to_plan` impl:
   
   ```
       def to_plan(self, session: Optional["RemoteSparkSession"]) -> 
proto.Expression:
           """Returns the Proto representation of the expression."""
           expr = proto.Expression()
           expr.unresolved_attribute.unparsed_identifier = 
self._unparsed_identifier
           return expr
   ``` 
   
   Probably the `class Expression` is the true Expression abstraction.
   
   In this case, maybe we should rename `ColumnRef` to `AttributeReference`.



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to