feat(isthmus): configurable fallback to dynamic function mapping#647
feat(isthmus): configurable fallback to dynamic function mapping#647ZorinAnton wants to merge 7 commits intosubstrait-io:mainfrom
Conversation
536838d to
ffb5724
Compare
vbarua
left a comment
There was a problem hiding this comment.
I'm working on a PR (#649) to try and make wiring in what you're doing here easier. We're starting to run into the limits of the existing design of the function conversion system, and I'm wary of adding more complexity before cleaning it up.
My big issue is with how we're using the feature flags for this, because we're embedding a ton of conditional configuration logic into constructors all over the codebase, which makes it very difficult to reason about an already difficult part of the system. What I would like to do is separate out the configuration from the constructors. Effectively, can we construct all the function converters we need outside of the SubstraitRelNode and SubstraitRelVisitor, and then inject them in.
9314af1 to
956b447
Compare
|
@ZorinAnton can you rebase one more time and resolve the conflicts? thanks |
a5c465f to
66ed907
Compare
|
High-level question What's the value of having a separate |
|
While they use similar mechanics under the hood, they serve two distinct use cases:
Keeping them separate allows users to opt into custom UDF support, the standard function fallback, or both independently. |
…of conversion config
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Decompose into separate functions to clarify intent. Reduce cognitive completixy. Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
The initial implementation relied on non-obvious method side-effects and lazy initialization of member variables based on those side-effects, which made the logic hard to understand and fragile. This change decomposes the logic into small functions with no side-effects, and initializes all member variable state in the constructor. This has the added benefit of making the class thread safe. Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
0bb65b8 to
2126363
Compare
|
With the current ConverterProvider structure, it is not clear to me how we expect users to opt in to both custom UDF and standard function fallback. Maybe we need some thought on composable ConverterProvider implementations. However, I think any changes to support that should happen in another PR. This one has already been pending for too long. |
bestbeforetoday
left a comment
There was a problem hiding this comment.
@ZorinAnton I had some concerns about:
- The merge commits instead of rebasing of your changes on the latest main branch state, which made the commit history hard to unpick.
- Some implementation details: readability, complexity and fragility.
I have cherry-picked your commits on top of the current main branch content to tidy up the commit history. I also added some additional commits, just to tidy up the implementation slightly. These changes address things I would otherwise have raised as review comments, but I have made the changes myself in the interests of getting this PR merged quickly. The logic and behaviour are unchanged. This is pushed to your PR branch so this PR reflects all of these changes.
Your exact PR branch state before the changes I made above is at bestbeforetoday/anton-fallback-to-dynamic-function-mappings.
I am happy with this PR to be merged as-is so am approving. Another pair of eyes — either yours or another maintainer — might be good as a sanity check before merging.
Potentially, the Composite Pattern can be used. This might cause creation of new class for each combination of features, but at least users could opt in excaclty to what they want.
At first glance I don't any issues, I will take a deeper look over the weekend. |
This PR introduces a new
autoFallbackToDynamicFunctionMappingfeature flag that enables automatic support for all unmapped extension functions (scalar, aggregate, and window functions) in SQL↔Substrait conversions.