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

Tiny: allow CaseExpression with operand and else clause #16726

Merged
merged 1 commit into from
Jul 24, 2019
Merged

Conversation

roji
Copy link
Member

@roji roji commented Jul 24, 2019

No description provided.

@roji roji requested a review from smitpatel July 24, 2019 16:50
@smitpatel
Copy link
Member

It does not make sense. What is the Sql expression tree you are constructing?

@roji
Copy link
Member Author

roji commented Jul 24, 2019

It's supported in SQL both by SQL Server (the "simple case expression") and PostgreSQL (again "simple form").

The specific translation where I could use this is to return a number, but to translate 0 into 7 (this actually happens in PostgreSQL when translating DayOfWeek which returns an enum). I could generate CASE value WHEN 0 THEN 7 ELSE value END.

Copy link
Member

@smitpatel smitpatel left a comment

Choose a reason for hiding this comment

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

Just a minor error.
Everything else looks fine.

@roji roji merged commit 1d27fd8 into master Jul 24, 2019
@ghost ghost deleted the CaseOperandElse branch July 24, 2019 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants