Skip to content

feat: custom limit sqllab #33204

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Abhishek-kumar-samsung
Copy link
Contributor

Earlier in SQL lab we had limited options to use as limit of number of rows in sql results. These options were only [10,100,1000, 10000, 100000]

Earlier it used to look like :
107 99 237 104_8013_sqllab_ (3)

I have added an option to put your custom limit while fetching sql query results as below :
107 99 237 104_8013_sqllab_
107 99 237 104_8013_sqllab_ (1)
107 99 237 104_8013_sqllab_ (2)

One can put their custom limit in input text and hit enter, and that limit will be applied while fetching number of rows in sql results.

Use cases:
Actually earlier once for me requirement came to fetch 700 results, so i had two options to complete the task i.e (put limit 700 in query itself, but in that case this limit feature does not makes any sense, it becomes useless), and second way is fetch 1000 results, then download csv and then remove 300 rows(but this results in lot of overhead)
-> To resolve above drawbacks this feature of custom limit is helpfull.

@dosubot dosubot bot added the sqllab Namespace | Anything related to the SQL Lab label Apr 22, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Error Handling Missing NaN check in number parsing ▹ view ✅ Fix detected
Files scanned
File Path Reviewed
superset-frontend/src/SqlLab/components/QueryLimitSelect/index.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@rusackas
Copy link
Member

LGTM, but I wonder if we should replace the existing component with a Select (configured to let you add custom values) rather than adding an input to the current component (which looks like a bit of a design system outlier). @geido or @kasiazjc might have additional opinions here.

@Abhishek-kumar-samsung
Copy link
Contributor Author

LGTM, but I wonder if we should replace the existing component with a Select (configured to let you add custom values) rather than adding an input to the current component (which looks like a bit of a design system outlier). @geido or @kasiazjc might have additional opinions here.

In select too, i would have implemented in same fashion because rest options in dropdown are just clickable and this one is customized to take input, thats why i didn't changed existing implementation of dropdown from Menu to Select, just added a new Input field as a new menu item in current Menu.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Apr 23, 2025
@Abhishek-kumar-samsung
Copy link
Contributor Author

@rusackas i did few more changes,
earlier on clicking enter the dropdown was not closing automatically, so i moved input to Menu.Item
And then testcases was having issue because number of items in menu increased, so then did some changes in menu items.

@Abhishek-kumar-samsung
Copy link
Contributor Author

Pls check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M sqllab Namespace | Anything related to the SQL Lab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants