You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/30 02:30:48 UTC
[GitHub] [spark] zhengruifeng commented on a diff in pull request #39296: [SPARK-41757][CONNECT] Fixing String representation for Column class
zhengruifeng commented on code in PR #39296:
URL: https://github.com/apache/spark/pull/39296#discussion_r1059218456
##########
python/pyspark/sql/connect/expressions.py:
##########
@@ -420,6 +420,12 @@ def __repr__(self) -> str:
return f"{self._name}({', '.join([str(arg) for arg in self._args])})"
+class UnresolvedBinaryFunction(UnresolvedFunction):
Review Comment:
I think this issue is a bit complicated, since not all binary ops have this type of string repr, for example:
```
In [11]: df.name + 1
Out[11]: Column<'(name + 1)'>
In [12]: df.name + df.age
Out[12]: Column<'(name + age)'>
In [13]: df.name.startswith("n")
Out[13]: Column<'startswith(name, n)'>
In [14]: df.name.startswith(df.age)
Out[14]: Column<'startswith(name, age)'>
```
we may also need to take unary ops into account.
I guess we need to keep a list to control which function can be represented in this way.
--
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