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
Adds and registers LPAD and RPAD with String and BinaryString overloads.
Uses Unicode code-point lengths for truncation and padding.
Keeps the existing Calcite TRIM operator instead of registering a duplicate UDF.
Adds unit and runtime SQL coverage for TRIM, LPAD, and RPAD.
Fixes the failing runtime test by using the repository's actual ascii2str(int) function name instead of the nonexistent ascii2string(int) signature.
MySQL behavior comparison
Case
Result
Any argument is NULL
NULL
Target length is negative
NULL
Target length is zero
empty string
Target length is shorter than the input
input truncated by characters
Pad string is empty and padding is needed
original input
Multibyte/emoji input
counted by Unicode code point
Verification
JDK 8: mvn -B -e -Pjdk8 -Dtest=PadTest,TrimTest -Dmaven.javadoc.skip=true install - 5 tests passed; Checkstyle and RAT passed.
JDK 11: mvn -B -e clean test -Pjdk11 -Dtest=PadTest,TrimTest - clean compilation of 250 main and 47 test sources; 5 tests passed; Checkstyle and RAT passed.
The corrected TRIM SQL query passes Calcite planning locally. Full runtime execution is covered by the Linux CI because the local Windows BRPC shutdown selects a VPN adapter address.
I rechecked both failed CI runs and found the actual cause: the new TRIM runtime test called ascii2string(9), but GeaFlow registers this function as ascii2str(int). Both JDK 8 and JDK 11 therefore failed during Calcite function resolution before TRIM executed.
Commit abd591a7 corrects the SQL test. I also removed the duplicate TRIM UDF registration because GeaFlow already supports TRIM through SqlStdOperatorTable.TRIM, and aligned negative LPAD/RPAD lengths with MySQL by returning NULL.
Local verification:
JDK 8: PadTest/TrimTest, 5 tests passed; Checkstyle and RAT passed.
JDK 11: clean compile of 250 main and 47 test sources; 5 tests passed; Checkstyle and RAT passed.
The new upstream runs are waiting for maintainer approval (they are action_required, not test failures):
Please approve these workflow runs when convenient. After they complete, the PR will still require one approving review from a reviewer with write access.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #789.
What changed
LPADandRPADwithStringandBinaryStringoverloads.TRIMoperator instead of registering a duplicate UDF.TRIM,LPAD, andRPAD.ascii2str(int)function name instead of the nonexistentascii2string(int)signature.MySQL behavior comparison
NULLNULLNULLVerification
mvn -B -e -Pjdk8 -Dtest=PadTest,TrimTest -Dmaven.javadoc.skip=true install- 5 tests passed; Checkstyle and RAT passed.mvn -B -e clean test -Pjdk11 -Dtest=PadTest,TrimTest- clean compilation of 250 main and 47 test sources; 5 tests passed; Checkstyle and RAT passed.TRIMSQL query passes Calcite planning locally. Full runtime execution is covered by the Linux CI because the local Windows BRPC shutdown selects a VPN adapter address.