-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Limit results generated by SELECT queries in MSQ #14370
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for including the patch notes too.
return Sequences.simple(retVal); | ||
} | ||
) | ||
.limit(Limits.MAX_SELECT_RESULT_ROWS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the end user, we need to set a flag in the report mentioning the results are truncated.
).collect(Collectors.toList()); | ||
|
||
final List<SqlTypeName> sqlTypeNames = task.getSqlTypeNames(); | ||
final List<Object[]> retVal = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might blow up.
A good test case for this issue is to try to do a select * on a datasource with 1 million rows.
Please add the truncated flag in the read me. |
cc @vogievetsky We now have a new field inside the task report : |
Description
MSQ queries return the results in the query reports. Querying large data sources can generate a lot of rows, all of which will get materialized in the query reports, causing them to grow very large. This PR limits the results of the SELECT queries that we put in the reports.
Note: Only way to fetch the complete result set after this change would be to run the query using the native engine, however, we might add a way to execute long-running queries that post their complete results in a different. Therefore the rows in the reports would serve as a preview to the actual result set.
Release note
SELECT queries executed using MSQ generate only a subset of the results in the query reports.
Key changed/added classes in this PR
ControllerImpl
This PR has: