-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[poc][multistage][feature] function registry unification #12163
Conversation
f15c394
to
5f65e91
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #12163 +/- ##
============================================
- Coverage 61.53% 61.52% -0.01%
- Complexity 207 1152 +945
============================================
Files 2416 2422 +6
Lines 131177 131512 +335
Branches 20245 20302 +57
============================================
+ Hits 80717 80912 +195
- Misses 44570 44679 +109
- Partials 5890 5921 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
1. FunctionRegistry keeps the old FUNCTION_INFO_MAP only 2. moved Calcite Catalog-based schema.Function registry to its own package; along with a SqlOperator based PinotOperatorTable 3. both CatalogReader and OperatorTable utilizes ground truth function from PinotFunctionRegistry --> will be default once deprecate FunctionRegistry 4. PinotFunctionRegistry provides argument-type based lookup via the same method SqlValidator utilize to lookup routine (and lookup operator overload) 5. clean up multi-stage engine side accordingly
@@ -38,19 +42,14 @@ | |||
|
|||
/** | |||
* Registry for scalar functions. | |||
* <p>TODO: Merge FunctionRegistry and FunctionDefinitionRegistry to provide one single registry for all functions. | |||
*/ | |||
public class FunctionRegistry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer: this class will be maintain until
- all Transform/Scalar functions are unified
- all legacy, arg-count based function resolution logics are deprecated
LOGGER.info("Initialized FunctionRegistry with {} functions: {} in {}ms", FUNCTION_MAP.map().size(), | ||
FUNCTION_MAP.map().keySet(), System.currentTimeMillis() - startTimeMs); | ||
|
||
// REGISTER OPERATORS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer:
this part will be maintain until all Transform function are registered in scalar form via PinotScalarFunction
return argTypes.stream().map(type -> toRelType(typeFactory, type)).collect(Collectors.toList()); | ||
} | ||
|
||
private static RelDataType toRelType(RelDataTypeFactory typeFactory, DataSchema.ColumnDataType dataType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer:
this and several other type conversion utils should be unified, we will follow up in separate PRs
|
||
|
||
/** | ||
* Temporary implementation of all dynamic arg/return type inference operators. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer:
This will be maintained until all operators can be merged into catalog
import org.apache.pinot.common.function.FunctionRegistry; | ||
|
||
|
||
public class PinotSqlStdOperatorTable extends SqlStdOperatorTable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer:
this class now only handles overries against SqlStdOperatorTable. it doesn't handle ANY Pinot special operators/functions
5f65e91
to
89c8335
Compare
closing in favor of #12229 |
working POC for a unified function registry. (extended version from #12144)