LuciferYang commented on code in PR #44639:
URL: https://github.com/apache/spark/pull/44639#discussion_r1446936561
##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -14968,11 +15006,12 @@ def schema_of_csv(csv: Union[Column, str], options:
Optional[Dict[str, str]] = N
return _invoke_function("schema_of_csv", col, _options_to_str(options))
-
+# TODO(SPARK-46654) Re-enable the `Example 2` test after fixing the display
Review Comment:
```
./bin/pyspark --remote "sc://localhost"
Python 3.11.1 (v3.11.1:a7a450f84a, Dec 6 2022, 15:24:06) [Clang 13.0.0
(clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/__ / .__/\_,_/_/ /_/\_\ version 4.0.0.dev0
/_/
Using Python version 3.11.1 (v3.11.1:a7a450f84a, Dec 6 2022 15:24:06)
Client connected to the Spark Connect server at localhost
SparkSession available as 'spark'.
>>> from pyspark.sql import Row, functions as sf
>>> data = [(1, Row(age=2, name='Alice', scores=[100, 200, 300]))]
>>> df = spark.createDataFrame(data, ("key", "value"))
>>> df.select(sf.to_csv(df.value)).show(truncate=False)
+--------------------------------------------------------------------------+
|to_csv(value) |
+--------------------------------------------------------------------------+
|2,Alice,org.apache.spark.sql.catalyst.expressions.UnsafeArrayData@99c5e30f|
+--------------------------------------------------------------------------+
```
--
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]