zhengruifeng commented on code in PR #41505:
URL: https://github.com/apache/spark/pull/41505#discussion_r1222413891
##########
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:
I checked
`to_char` :
https://github.com/apache/spark/blob/3433f2a77d3dd665f42aa3d558152cf4c912c54c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/numberFormatExpressions.scala#L227-L234
`to_binary`:
https://github.com/apache/spark/blob/f718b025d87ae3726210c60ff71cb34917b32f51/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala#L2727-L2734
the format should be a literal string, so on the python side, the augment
type should be `Union[Column, str]`, when the input is a `str`, convert it to
`lit(...)`
also cc @HyukjinKwon
--
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]