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

feat: support intdiv operator // #11527

Merged
merged 4 commits into from
May 21, 2023
Merged

feat: support intdiv operator // #11527

merged 4 commits into from
May 21, 2023

Conversation

gitccl
Copy link
Contributor

@gitccl gitccl commented May 20, 2023

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

Summary

Support intdiv operator //.

Closes #11516

@vercel
Copy link

vercel bot commented May 20, 2023

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

Name Status Preview Comments Updated (UTC)
databend ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2023 11:41pm

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label May 20, 2023
@sundy-li sundy-li requested review from jun0315 and TCeason May 20, 2023 12:27
@jun0315
Copy link
Contributor

jun0315 commented May 20, 2023

@gitccl Thanks for your contribution. There are some errors in workflow, please try fixing them first.It seems that there is no actual calculated code.

Here are some links that may be helpful:
#10444
https://my.oschina.net/u/5489811/blog/7554715

@gitccl
Copy link
Contributor Author

gitccl commented May 20, 2023

It seems that there is no actual calculated code.

The // operator will be resolved as intdiv function in https://github.com/datafuselabs/databend/blob/e64908558f141d77a8b6bff93d8a6d4a99547a9f/src/query/sql/src/planner/semantic/type_check.rs#L1391-L1394
, so I think there is no extra calculate logic.

@jun0315
Copy link
Contributor

jun0315 commented May 20, 2023

, so I think there is no extra calculate logic.

Yes, you're right, it's already registered as an alias, so there's no need to rewrite the calculation logic.
https://github.com/datafuselabs/databend/blob/e64908558f141d77a8b6bff93d8a6d4a99547a9f/src/query/functions/src/scalars/arithmetic.rs#L79

@sundy-li
Copy link
Member

env REGENERATE_GOLDENFILES=1 cargo test

to regenerate the golden files.

@mergify mergify bot merged commit 8ea4183 into databendlabs:main May 21, 2023
@gitccl gitccl deleted the intdiv branch May 21, 2023 03:07
andylokandy pushed a commit to andylokandy/databend that referenced this pull request Nov 27, 2023
* feat: support `intdiv` operator `//`

* docs: add intdiv operator

* fix: fix unit test

---------

Co-authored-by: sundyli <543950155@qq.com>
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 intdiv operator //
4 participants