CODERNSINGH commented on code in PR #60222:
URL: https://github.com/apache/spark/pull/60222#discussion_r4525211565
##########
python/pyspark/sql/classic/column.py:
##########
@@ -445,11 +445,18 @@ def contains(
def startswith(
self, other: Union[ParentColumn, "LiteralType", "DecimalLiteral",
"DateTimeLiteral"]
) -> ParentColumn:
+ # The JVM `startsWith` is overloaded for `Column` and `String`. Always
pass a `Column` so
+ # that Py4J does not pick the `Column` overload with a null argument
for `None`.
+ if not isinstance(other, ParentColumn):
Review Comment:
ok. Fixed in abd3ea2: `str` (and str-valued Enum) arguments now go directly
to the JVM `String` overload as before, and only `None` and other non-string
literals are converted to a literal `Column`. I also checked that
`col("s").startswith("a")` builds a Column after `spark.stop()`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]