n0r0shi opened a new pull request, #12324:
URL: https://github.com/apache/gluten/pull/12324
## What changes were proposed in this pull request?
Spark 4.0+ introduced `spark.sql.binaryOutputStyle` to control how binary
values are rendered. Velox's `to_pretty_string` previously only supported the
default `HEX_DISCRETE` style. This change wires the Spark config through Gluten
to Velox so all 5 styles (`HEX_DISCRETE`, `HEX`, `BASE64`, `UTF-8`, `BASIC`)
are honored.
- Add `kSparkBinaryOutputStyle = "spark.sql.binaryOutputStyle"` constant.
- Forward it via `setIfExists` in `WholeStageResultIterator`, mapping to
Velox's `SparkQueryConfig::kBinaryOutputStyle` (`binary_output_style`).
- Expand `GlutenDataFrameSuite.getRows: binary` in spark40 and spark41 to
cover all 5 styles, mirroring the upstream Spark `DataFrameSuite` test.
## Depends on
Velox PR: https://github.com/facebookincubator/velox/pull/17884
(adds `SparkQueryConfig::kBinaryOutputStyle` + 5 styles in
`ToPrettyStringVarbinaryFunction`).
Once that lands, this PR's behavior fully kicks in. With only this Gluten PR
(and the Velox PR not yet merged), the existing `HEX_DISCRETE` behavior is
preserved, but `HEX`/`BASE64`/`UTF-8`/`BASIC` will not take effect.
## How was this patch tested?
`GlutenDataFrameSuite.getRows: binary` in spark40 and spark41; this test
covers all 5 styles using `withSQLConf(SQLConf.BINARY_OUTPUT_STYLE.key ->
...)`, mirroring the upstream Spark `DataFrameSuite.getRows: binary` test.
Fixes #11570
--
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]