Support MySQL LENGTH, BIT_LENGTH and LOCATE functions in SQL Federation#38704
Open
Phixsura wants to merge 1 commit into
Open
Support MySQL LENGTH, BIT_LENGTH and LOCATE functions in SQL Federation#38704Phixsura wants to merge 1 commit into
Phixsura wants to merge 1 commit into
Conversation
0a307e6 to
e8bfdc6
Compare
Author
|
Rebased onto latest master (now at
Workflows are awaiting committer approval again after the rebase. Could a maintainer kindly approve them? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background
SQL Federation rejects three common MySQL string functions because they are not registered in
MySQLOperatorTable, producingNo match found for function signature LENGTH/BIT_LENGTH/LOCATE(...). Reported in #31897, #31898, #31899.Changes
MySQLLengthFunction,MySQLBitLengthFunction,MySQLLocateFunctionasSqlUserDefinedFunctionsubclasses with operand metadata matching MySQL semantics (UTF-8 byte count for character values, raw length forbyte[], 1-based positions with the optional start position respected and clamped).LENGTH,BIT_LENGTH,LOCATE, andLOCATE_WITH_POSITIONinMySQLOperatorTable.SqlLibraryOperators.LENGTHlives in HIVE / POSTGRESQL / BIG_QUERY libraries and uses character-count semantics, so a MySQL-specific implementation is required.Verification
byte[], and LOCATE position boundaries.federation-query-sql-cases.xmlpinning the generated Calcite plan;SQLStatementCompilerIT111 / 111 (107 baseline + 4 new).spotless:check,checkstyle:check,apache-rat:checkall green onkernel/sql-federation/compiler.Closes #31897
Closes #31898
Closes #31899