Uh oh!
There was an error while loading. Please reload this page.
[feature](function) support variadic template type in SQL function - #17985
Merged
Conversation
xy720
commented
Mar 21, 2023
MemberAuthor
run buildall |
Contributor
TeamCity pipeline, clickbench performance test result: |
xy720
commented
Mar 24, 2023
MemberAuthor
run buildall |
xy720
commented
Mar 24, 2023
MemberAuthor
run buildall |
Contributor
PR approved by at least one committer and no changes requested. |
Contributor
PR approved by anyone and no changes requested. |
xy720
commented
Mar 28, 2023
MemberAuthor
run p0 |
gnehil pushed a commit
to gnehil/doris
that referenced
this pull request
Apr 21, 2023
…pache#17985) Inspired by c++ function `std::vector::emplace_back()`, we can use variadic template for this issue. e.g. ``` [['struct'], 'STRUCT<TYPES>', ['TYPES'], 'ALWAYS_NOT_NULLABLE', ['TYPES...']] ``` `...TYPES` in template_types defines a variadic template `TYPE`. Then the variadic template will be expanded to multiple normal templates based on actual input arguments at runtime in FE. But make sure `TYPES...` is placed on the last position in all template type arguments. BTW, the origin template function logic is not affected.
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 freeto 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.
Proposed changes
In pr #17344, we already support template type in SQL function.
e.g.
Then it raises a new issue, as some functions require variable length template types.
e.g.
Inspired by c++ function
std::vector::emplace_back(), we can use variadic template for this issue.e.g.
...TYPESin template_types defines a variadic templateTYPE. Then the variadic template will be expanded to multiple normal templates based on actual input arguments at runtime in FE.But make sure
TYPES...is placed on the last position in all template type arguments.BTW, the origin template function logic is not affected.
Problem summary
Describe your changes.
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...