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/06/08 03:28:13 UTC
[GitHub] [spark] zhengruifeng commented on a diff in pull request #41505: [SPARK-43938][CONNECT][PYTHON] Add to_* functions to Scala and Python
zhengruifeng commented on code in PR #41505:
URL: https://github.com/apache/spark/pull/41505#discussion_r1222409417
##########
python/pyspark/sql/functions.py:
##########
@@ -9929,6 +10078,26 @@ def map_zip_with(
return _invoke_higher_order_function("MapZipWith", [col1, col2], [f])
+def str_to_map(
+ col1: "ColumnOrName",
+ col2: Union["ColumnOrName", str],
+ col3: Union["ColumnOrName", str],
+) -> Column:
Review Comment:
thank you so much! @panbingkun
since `ColumnOrName = Union[Column, str]` https://github.com/apache/spark/blob/32ab341071aa69917f820baf5f61668c2455f1db/python/pyspark/sql/_typing.pyi#L37
we will always treat a str var as a column name in this case, if user want to provide a literal string, he will have to use `lit(some_string)`
--
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