Added coercion rules and placeholder UDF to handle VARBINARY#5443
Conversation
PR Reviewer Guide 🔍(Review updated until commit 0c4b263)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 0c4b263 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit d3157be
Suggestions up to commit 43b460e
Suggestions up to commit 43b460e
Suggestions up to commit da004e3
Suggestions up to commit e135281
|
75bd163 to
e135281
Compare
|
Persistent review updated to latest commit e135281 |
penghuo
left a comment
There was a problem hiding this comment.
Code looks good. Please failed Fix IT/UT.
|
Persistent review updated to latest commit da004e3 |
dai-chen
left a comment
There was a problem hiding this comment.
The CI is failing due to spotless check. Please fix it. Thanks!
|
Persistent review updated to latest commit 43b460e |
|
Persistent review updated to latest commit 43b460e |
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
43b460e to
d3157be
Compare
|
Persistent review updated to latest commit d3157be |
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
|
Persistent review updated to latest commit 0c4b263 |
Description
Adds coercion support so PPL queries can compare a
VARBINARYcolumn with aVARCHARliteral.eg:
source=logs | where client_ip = '192.168.1.1'For
ipandbinaryfields types OpenSearchSchemaBuilder.java maps toSqlTypeName.VARBINARY.The change introduces a
BINARY(varchar)placeholder UDF and threads VARBINARY through the type/coercion pipeline so that:VARCHARliteral compared to aVARBINARYcolumn is recognized as coercible toBINARY.CoercionUtils.casttriggersExtendedRexBuilder.makeCast, which emitsBINARY(varchar)instead of a generic Calcite CAST. the on-disk encoding ofip/binaryfields.BINARY(varchar)RexCallis intended to be rewritten by a backend adapter (OpenSearch repo, separate PR) into aVARBINARYRexLiteralwhose bytes match the on-disk format.