ihuzenko commented on a change in pull request #1608: DRILL-6960: Auto Limit
Wrapping should not apply to non-select query
URL: https://github.com/apache/drill/pull/1608#discussion_r252694100
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
##########
@@ -69,14 +75,24 @@ public QueryType getType() {
return QueryType.valueOf(queryType);
}
+ public Integer getAutoLimitRowCount() {
+ return autoLimitRowCount;
+ }
+
+ public boolean isAutoLimitEnabled() {
+ return getAutoLimitRowCount() != null;
+ }
+
public QueryResult run(final WorkManager workManager, final
WebUserConnection webUserConnection) throws Exception {
final RunQuery runQuery = RunQuery.newBuilder().setType(getType())
.setPlan(getQuery())
.setResultsMode(QueryResultsMode.STREAM_FULL)
.build();
// Submit user query to Drillbit work queue.
- final QueryId queryId =
workManager.getUserWorker().submitWork(webUserConnection, runQuery);
+ final QueryId queryId = isAutoLimitEnabled() ?
Review comment:
I think this check is redundant here, because when deciding to apply limit
you're using method from ```QueryContext``` . Here you can just invoke
``` workManager.getUserWorker().submitWork(webUserConnection, runQuery,
autoLimitRowCount)``` .
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services