Skip to content

Conversation

@RinChanNOWWW
Copy link
Contributor

@RinChanNOWWW RinChanNOWWW commented Mar 8, 2023

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Add a new Expr: Expr::Catch.

case when clause, if, and multi_if's branches will be wrapped in Expr::Catch.

Expr::Catch will catch the error and return Tuple<T, String NULL> which contains evaluation results and the error messages (maybe not exists).

The error will be thrown only if it appears in the activated branch.

Closes #10409

@vercel
Copy link

vercel bot commented Mar 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
databend ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 12, 2023 at 7:02AM (UTC)

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label Mar 8, 2023
@zhang2014
Copy link
Member

What happen panic(select if(1== 1, 1 / 0, 1 / 1))?

@RinChanNOWWW
Copy link
Contributor Author

What happen panic(select if(1== 1, 1 / 0, 1 / 1))?

select if(1 = 1, 1/0, 1/1) will throw an error.

select if(1 = 1, 1/1, 1/0) will not.

@RinChanNOWWW RinChanNOWWW force-pushed the catch branch 2 times, most recently from 2745a7f to 3be3b5a Compare March 9, 2023 01:59
@RinChanNOWWW RinChanNOWWW requested review from andylokandy and sundy-li and removed request for andylokandy March 9, 2023 13:19
@RinChanNOWWW RinChanNOWWW marked this pull request as ready for review March 9, 2023 13:19
@sundy-li
Copy link
Member

@mergify update

@mergify
Copy link
Contributor

mergify bot commented Mar 10, 2023

update

✅ Branch has been successfully updated

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

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: support short-circuit evaluation.

4 participants