Skip to content

[feature](function) support any type in SQL function - #18392

Merged
xy720 merged 6 commits into
apache:masterfrom
xy720:support-deduce-function-in-fe
Apr 11, 2023
Merged

[feature](function) support any type in SQL function#18392
xy720 merged 6 commits into
apache:masterfrom
xy720:support-deduce-function-in-fe

Conversation

@xy720

@xy720xy720 commented Apr 4, 2023

Copy link
Copy Markdown
Member

Proposed changes

In #17344 , we support template and variadic template function.

e.g.

[['element_at', '%element_extract%'], 'V', ['MAP<K, V>', 'K'], 'ALWAYS_NULLABLE', ['K', 'V']],

Then it raises a new issue, as some functions has unpredictable return type.
e.g.

[['element_at', '%element_extract%'], '???', ['STRUCT<TYPES>', 'VARCHAR'], 'ALWAYS_NULLABLE', ['TYPES...']],

This commit support ANY_TYPE.

If a function has ANY_TYPE as return type, then this function is an inference function.

e.g.

[['element_at', '%element_extract%'], 'ANY_TYPE', ['STRUCT<TYPES>', 'VARCHAR'], 'ALWAYS_NULLABLE', ['TYPES...']],

An inference function's return type will be analyze to actual type at runtime in FE.

Problem summary

Describe your changes.

Checklist(Required)

  • Does it affect the original behavior
  • Has unit tests been added
  • Has document been added or modified
  • Does it need to update dependencies
  • Is this PR support rollback (If NO, please explain WHY)

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...

@github-actionsgithub-actionsBot added the area/sql/function Issues or PRs related to the SQL functions label Apr 4, 2023
@github-actionsgithub-actionsBot added area/planner Issues or PRs related to the query planner area/vectorization labels Apr 6, 2023
@xy720
xy720force-pushed the support-deduce-function-in-fe branch from cf6524d to 1e6a8a5CompareApril 6, 2023 08:12
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@xy720

xy720 commented Apr 6, 2023

Copy link
Copy Markdown
MemberAuthor

run buildall

@xy720
xy720force-pushed the support-deduce-function-in-fe branch from c87bf42 to bf61059CompareApril 7, 2023 05:00
@xy720

xy720 commented Apr 7, 2023

Copy link
Copy Markdown
MemberAuthor

run buildall

@xy720

xy720 commented Apr 7, 2023

Copy link
Copy Markdown
MemberAuthor

run p0

@xy720
xy720force-pushed the support-deduce-function-in-fe branch from bf61059 to 10dc471CompareApril 7, 2023 10:28
@xy720

xy720 commented Apr 7, 2023

Copy link
Copy Markdown
MemberAuthor

run buildall

@xy720
xy720force-pushed the support-deduce-function-in-fe branch from 10dc471 to 6f6f19cCompareApril 11, 2023 04:28
@xy720

Copy link
Copy Markdown
MemberAuthor

run buildall

@xy720

Copy link
Copy Markdown
MemberAuthor

run compile

@xy720

Copy link
Copy Markdown
MemberAuthor

run p0

@cambyzjucambyzju left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Apr 11, 2023
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@xy720
xy720 merged commit cb644d5 into apache:masterApr 11, 2023
gnehil pushed a commit to gnehil/doris that referenced this pull request Apr 21, 2023
Add AnyType to Doris.
Support Inference function in fe SQL function.
Reminiscent pushed a commit to Reminiscent/doris that referenced this pull request May 15, 2023
Add AnyType to Doris.
Support Inference function in fe SQL function.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.area/plannerIssues or PRs related to the query plannerarea/sql/functionIssues or PRs related to the SQL functionsarea/vectorizationreviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xy720@cambyzju