Skip to content
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

function: pivot and unpivot #20520

Closed
wangsimo0 opened this issue Mar 29, 2023 · 3 comments · Fixed by #42231
Closed

function: pivot and unpivot #20520

wangsimo0 opened this issue Mar 29, 2023 · 3 comments · Fixed by #42231

Comments

@wangsimo0
Copy link
Contributor

Feature request

It's better to have pivot function to support more flexible scenario. By now, we can only use case when to do pivot, and it has bad performance. for unpivot, we can use unnest, but still need an aggregation.
https://learn.microsoft.com/en-us/sql/t-sql/queries/from-using-pivot-and-unpivot?view=sql-server-ver15

@hongism
Copy link

hongism commented May 22, 2023

Can I have a try?

@kateshaowanjou
Copy link
Contributor

Hi @hongism, I've noticed that you are new to the StarRocks community.
If you have any questions, feel free to join WeChat for discussion, the community will assist you with the function task: https://853921.ma3you.cn/articles/b12e90J/

@hongism hongism removed their assignment Sep 15, 2023
@macroguo-ghy
Copy link
Contributor

Hi, I am interested in PIVOT syntax.
I think we have two ways to implement it:

  • See PIVOT as a syntax sugar, we can transform pivot to agg(case ... when ...)
  • Add a new PIVOT operator

what do you think? @wangsimo0 @kateshaowanjou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants