Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/821#discussion_r113791308
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctionHelpers.java
---
@@ -169,7 +169,7 @@ public static void initCap(int start, int end, DrillBuf
inBuf, DrillBuf outBuf)
if (currentByte >= 0x30 && currentByte <= 0x39) { // 0-9
// noop
} else if (currentByte >= 0x41 && currentByte <= 0x5A) { // A-Z
- currentByte -= 0x20; // Lowercase this character
+ currentByte += 0x20; // Lowercase this character
--- End diff --
currentByte = Character.toLowerCase( currentByte )
The above handles all the Unicode complexity -- no need for us to
reimplement it here.
A concern might be performance. Try calling the above 10K times in a loop
and this function 10K times. Is there a difference in cost?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---