Vyrham opened a new pull request, #453:
URL: https://github.com/apache/datafusion-spark/pull/453
Closes #208.
Implements Spark-compatible `initcap(str)`, the hardest of the batch: Rust
has no titlecase, so the mapping is an explicit table of the 135 code points
whose Unicode titlecase differs from uppercase (digraphs, Georgian, Greek with
ypogegrammeni, expansions like `ß` -> `Ss`), with `char::to_uppercase` as the
fallback. Words start only after an ASCII space, so `initcap('a.b,c')` is
`A.b,c`; a capital sigma becomes `ς` at the end of a word and `σ` elsewhere. No
new dependency. Includes Rust unit tests and sqllogictest coverage
(`string/initcap.slt`) with the issue's examples, and updates the function docs.
Notes for reviewers:
- Only the ICU-on behaviour (Spark 4.0+, the default) is implemented; the
Spark 3.x ICU-off values differ and there is no mode switch yet. Should a
switch for `spark.sql.icu.caseMappings.enabled` be added?
- The 135-code-point table was enumerated from Python unicodedata 15.0.0; is
a hand-maintained table acceptable, or would you prefer a
`unicode-case-mapping` / `icu` dependency?
- The docs in `docs/functions/` were updated by hand following the docgen
format; please let me know if `dev/update_function_docs.sh` produces anything
different and I will align them.
--
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]