Hyukjin Kwon created SPARK-60991:
------------------------------------
Summary: Show a DataFrame as the server formats it, with truncate
and vertical, in Spark Connect Rust as PySpark does
Key: SPARK-60991
URL: https://issues.apache.org/jira/browse/SPARK-60991
Project: Spark
Issue Type: Bug
Components: Connect
Affects Versions: connect-rust-4.3.0
Reporter: Hyukjin Kwon
In PySpark Connect, {{DataFrame.show(n=20, truncate=True, vertical=False)}}
sends a {{ShowString}} relation with the number of rows, the truncation and the
vertical flag, and prints the table that the server formats:
{noformat}
+---+
| id|
+---+
| 0|
| 1|
+---+
{noformat}
It raises {{PySparkTypeError}} {{NOT_EXPECTED_TYPE}} for an {{n}} that is not
an int, a {{vertical}} that is not a bool, and a {{truncate}} that is neither.
The Rust-backed Python client collects the first {{n}} rows and prints each
with Rust's {{println!}}, as {{[0]}} and {{[1]}}, ignoring {{truncate}} and
{{vertical}} and writing past Python's {{sys.stdout}}, so a notebook or
{{contextlib.redirect_stdout}} does not get the output. The Rust
{{DataFrame::show}} prints the same. Show the DataFrame as PySpark does.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]