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(query): add max_query_row_nums #9406

Merged
merged 4 commits into from
Dec 31, 2022
Merged

feat(query): add max_query_row_nums #9406

merged 4 commits into from
Dec 31, 2022

Conversation

FANNG1
Copy link

@FANNG1 FANNG1 commented Dec 29, 2022

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

Summary

user may run a query select * from xx, this may scan too many rows. add a default limiter if user does't specify limit values.

Closes #issue

@vercel
Copy link

vercel bot commented Dec 29, 2022

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

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Dec 31, 2022 at 3:10AM (UTC)

@FANNG1 FANNG1 marked this pull request as draft December 29, 2022 07:12
@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label Dec 29, 2022
@sundy-li
Copy link
Member

better name to max_result_rows .

@BohuTANG
Copy link
Member

@mergify update

@mergify
Copy link
Contributor

mergify bot commented Dec 30, 2022

update

✅ Branch has been successfully updated

@FANNG1 FANNG1 marked this pull request as ready for review December 30, 2022 06:21
@BohuTANG BohuTANG requested a review from sundy-li December 30, 2022 06:48
@BohuTANG
Copy link
Member

@sandflee

It would be great to add a SQL logic test for it so that we can keep the change always working :)

@FANNG1
Copy link
Author

FANNG1 commented Dec 30, 2022

It would be great to add a SQL logic test for it so that we can keep the change always working :)

could u provide a example?

@BohuTANG
Copy link
Member

BohuTANG commented Dec 30, 2022

Sure.
For example:

tests/sqllogictests/suites/base/20+_others/20_0011_setting

statement ok
DROP DATABASE IF EXISTS db1

statement ok
CREATE DATABASE db1

statement ok
USE db1

statement ok
CREATE TABLE IF NOT EXISTS t1(a INT) Engine = fuse

statement ok
INSERT INTO t1 (a) values (1), (2), (3)

query I
SELECT COUNT() FROM (SELECT * FROM t1)
----
3

statement ok
SET max_result_rows=1

query I
SELECT COUNT() FROM (SELECT * FROM t1)
----
1

statement ok
DROP TABLE t1

statement ok
DROP DATABASE db1

Copy link
Member

@BohuTANG BohuTANG left a comment

Choose a reason for hiding this comment

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

2023

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.

3 participants