Define operand type checkers for all PPL built-in functions#5214
Define operand type checkers for all PPL built-in functions#5214yuancu wants to merge 1 commit intoopensearch-project:feature/validationfrom
Conversation
PR Reviewer Guide 🔍(Review updated until commit 7ba97fb)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 7ba97fb Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 63b01b3
Suggestions up to commit bc59f3a
Suggestions up to commit bc59f3a
|
|
Persistent review updated to latest commit 3f5398a |
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 081f077.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Persistent review updated to latest commit 081f077 |
e4efe64 to
bc59f3a
Compare
|
Persistent review updated to latest commit bc59f3a |
1 similar comment
|
Persistent review updated to latest commit bc59f3a |
|
Persistent review updated to latest commit 63b01b3 |
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
|
Persistent review updated to latest commit 7ba97fb |
Summary
Sub-PR 2/4 for #4892 — splitting the large PR into reviewable pieces targeting
feature/validation.This PR adds operand type definitions for all PPL built-in functions, simplifies the function registry, and migrates operator declarations from
SqlOperatortoSqlFunction. Validation is not yet enabled, so existing tests pass unchanged.What's included
Operand Type Registry:
PPLOperandTypes— Shared operand type checker constants (NUMERIC, STRING, DATETIME_OPTIONAL_INTEGER, etc.)Operator Table Changes (
PPLBuiltinOperators):SqlOperator→SqlFunctionfor all UDFs (enables Calcite's type validation)ADDoperator override for string concatenation vs numeric additionATANfunction overloading (1-arg vs 2-arg)COUNT()→COUNT(*)rewriting for type inferenceDIVIDEandMODSqlKind definitions for coercionFunction Registry Simplification (
PPLFuncImpTable):CalciteFuncSignaturefrom function registry (type checking now deferred to validation phase)Pair<CalciteFuncSignature, FunctionImp>→FunctionImpUDF Operand Type Annotations (65+ files):
getOperandMetadata()with proper type checkersUDFOperandMetadata— Newwrap()factory methodUserDefinedFunctionBuilder—@NonNullannotation forgetOperandMetadata()Notable function changes:
TransformFunctionImpl/ReduceFunctionImpl: Lambda return type inferenceJsonSetFunctionImpl: Thread-safe validation improvementsGeoIpFunction: String override for UDT erasure during validationTests
CalcitePPLFunctionTypeTest,CalcitePPLAggregateFunctionTypeTest,CalcitePPLEventstatsTypeTest— Validate operand types for all function categoriesDependency
Signed-off-by: Yuanchun Shen yuanchu@amazon.com