You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Initcap behaves differently in Spark and in DataFusion (also Comet) #1052
DataFusion's initcap behaves differently than Spark's. While both do "upper-case the first letter of each word and lowercase others", Spark considers as words anything separated by whitespace (' '), while DataFusion considers anything separated by non-ascii-alphanumeric as words. (DF's code would also fail to uppercase or lowercase non-ascii chars, but that doesn't materialize as a separate issue as it considers them separators already in the first place.)
#1051 shows the problem by adding two cases to the test, one using a dash and one using non-ascii letters (from Finnish).
But reg to DF SQL policy apache/datafusion#13706 DF supports a builtin functions to be in sync with PG which returns Robert Rose-Smith and Comet likely need to implement own UDF function to cover this case
Activity
viirya commentedon Nov 4, 2024
Thanks for reporting this bug.
comphead commentedon Dec 13, 2024
DataFusion InitCap doesn't support nonASCII
Tracked in apache/datafusion#13711
comphead commentedon Dec 13, 2024
already fixed in latest DF
UPD: Spark returns
But reg to DF SQL policy apache/datafusion#13706 DF supports a builtin functions to be in sync with PG which returns
Robert Rose-Smithand Comet likely need to implement own UDF function to cover this caseBlizzara commentedon Dec 13, 2024
How is that fixed? :) The diff I showed is exactly the same as the diff you meantion below, no?
comphead commentedon Dec 13, 2024
Please refer to message update above
kazuyukitanimura commentedon Dec 16, 2024
Looks like unicode init cap is getting fixed in DF apache/datafusion#13752
kazuyukitanimura commentedon Jan 9, 2025
The fix is already included in https://github.com/apache/datafusion/commits/branch-44/
andygrove commentedon Feb 4, 2025
Removing from 0.6.0 since this expression is disabled by default
andygrove commentedon Sep 12, 2025
This expression is now documented as incompatible and disabled by default, but users can opt it. I will close this issue.
kazuyukitanimura commentedon Sep 12, 2025
@andygrove I thought this is fixed in DF44 with this commit apache/datafusion@a267784 but did you mean that the fix is not sufficient?
andygrove commentedon Sep 12, 2025
@kazuyukitanimura The unicode issue
maybeis fixed, but there are other incompatibilities still.