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_r252684099
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
##########
@@ -135,7 +135,7 @@ private static PhysicalPlan getQueryPlan(QueryContext
context, String sql, Point
final SqlConverter parser = new SqlConverter(context);
injector.injectChecked(context.getExecutionControls(), "sql-parsing",
ForemanSetupException.class);
- final SqlNode sqlNode = parser.parse(sql);
+ final SqlNode sqlNode = wrapWithAutoLimit(parser, context, sql);
Review comment:
Could you replace the line with:
```suggestion
final SqlNode sqlNode = parser.parse(sql);
if (context.isAutoLimitEnabled()) {
boolean applied = applyAutoLimit(sqlNode, sqlNode.getKind(),
context.getAutoLimitRowCount());
if (!applied) {
context.disableAutoLimit();
}
}
```
----------------------------------------------------------------
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