-
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
Add query context parameter to control limiting select rows #14476
Conversation
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java
Show resolved
Hide resolved
...s-core/multi-stage-query/src/main/java/org/apache/druid/msq/util/MultiStageQueryContext.java
Outdated
Show resolved
Hide resolved
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.
Taken another pass at the PR. Thanks for making the change. Left a few line-level comments, the overall PR LGTM. Will approve once these get addressed
...core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQSelectDestination.java
Outdated
Show resolved
Hide resolved
...core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQSelectDestination.java
Outdated
Show resolved
Hide resolved
...core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/MSQSelectDestination.java
Outdated
Show resolved
Hide resolved
@@ -204,6 +211,16 @@ public static int getRowsPerSegment(final QueryContext queryContext) | |||
); | |||
} | |||
|
|||
public static MSQSelectDestination getSelectDestination(final QueryContext queryContext) | |||
{ | |||
return MSQSelectDestination.valueOf( |
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.
What happens if this isn't a valid destination? If this errors out with a cryptic error message, we should present a user-friendly message and list out the possible options for the destination. (Presence of DURABLE_STORAGE/S3 as an option should only be if durable storage is configured)
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.
It would currently return an IAE with "value not found in enum", but the error message could be improved here. I think that's a good point, that we should make it more user friendly. This is true for all other enum query context parameters (workerAssignementStrategy, clusterStatisticsMergeMode etc). I'll make this change in a separate PR and include all other query context parameters as well.
One thought, maybe DURABLE_STORAGE should be present always so that the user knows that it is an option and can configure durable storage if needed. If it is not enabled, we would throw an exception accordingly from wherever it is writing the results anyway. WDYT?
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.
Sure, makes sense
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.
Changes LGTM.
Thanks @adarshsanjeev for the contribution. |
…4476) * Add query context parameter to control limiting select rows * Add unit tests * Address review comments * Address review comments * Address review comments
This PR adds a new query context parameter for MSQ to decide if the result of an MSQ select query needs to be limited. This will help maintain backward compatibility and help people not be surprised by truncated results.
This parameter has been documented in
MultiStageQueryContext
This PR has: