dbtsai opened a new pull request, #131:
URL: https://github.com/apache/spark-connect-rust/pull/131

   ### What changes were proposed in this pull request?
   
   Fix `DataFrame.printSchema()` calling `show(0)`, which executes a zero-row 
query and emits no schema. Resolve schema metadata instead, render its tree at 
the requested depth, and call Python's `print` so `sys.stdout` capture works. 
Preserve reference behavior for default, nonpositive, false, fractional and 
invalid depth arguments.
   
   The shared tree renderer also needs small correctness fixes for the emitted 
text: reference type names (`integer`/`long`), nested struct/array/map children 
and nullability, field-name control-character escaping, and unlimited 
nonpositive depths. Existing direct `StructType.treeString`/Rust tree consumers 
are covered alongside the binding.
   
   ### Why are the changes needed?
   
   [SPARK-60695](https://issues.apache.org/jira/browse/SPARK-60695). Printing a 
schema should emit schema text and should not send ExecutePlan requests.
   
   ### Does this PR introduce any user-facing change?
   
   `printSchema()` now prints the schema through Python stdout, honors nesting 
depth, and performs schema analysis instead of query execution. Schema tree 
text now uses the reference formatting for nested collection types and scalar 
type names.
   
   ### How was this patch tested?
   
   - Directly-master-based release wheel: **300** passing tests in the existing 
CI-selected `test_dropin_offline.py`, including 26 new exact 
stdout/depth/type/nullability/failure-retry/protocol cases; **392** Rust 
library and **11** type behavior tests pass; all Rust client test targets 
compiled. Formatting and diff checks.
   - The same 26 new cases run against the pinned Python reference. Localhost 
mock gRPC servers run in separate processes; printSchema must issue zero 
ExecutePlan requests. The new regression test fails the unchanged baseline.
   - Unchanged frozen harness/validators, five fresh-process samples per 
case/client: **195/195 passed**, across five printSchema cases and eight 
metadata/show/API/error guards.
   - Both measurement wheels include PR120 
`f87973b1e02fe500e3c4266a8ad3f353244994af`, isolating this change. Repeated 
depth-256 printSchema: **2.607229 ms → 0.001406 ms** (Python reference 
**0.005496 ms**); timed ExecutePlan calls **20 → 0**. First-call depth-256: 
**3.174625 → 2.921541 ms**. All eight unrelated guard sample ranges overlap; 
median changes range from -14.6% to +8.0%, without a statistical equivalence 
claim.
   
   The production patch is based directly on master and has no unmerged 
dependency. PR120 is only a shared benchmark dependency; repeated-call RPC 
elimination relies on its schema cache. No JVM/live Spark server was used. The 
frozen inspection validator does not validate stdout, so independent 
exact-output tests are required in addition to benchmark passes. Setup failures 
and full raw samples/provenance are preserved in the campaign artifacts.
   


-- 
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]

Reply via email to