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_r252707066
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
##########
@@ -46,15 +46,21 @@
private static final double HEAP_MEMORY_FAILURE_THRESHOLD = 0.85;
private final String query;
-
private final String queryType;
+ private final Integer autoLimitRowCount;
private static MemoryMXBean memMXBean = ManagementFactory.getMemoryMXBean();
@JsonCreator
- public QueryWrapper(@JsonProperty("query") String query,
@JsonProperty("queryType") String queryType) {
+ public QueryWrapper(@JsonProperty("query") String query,
@JsonProperty("queryType") String queryType, @JsonProperty("autoLimit") String
autoLimit) {
this.query = query;
this.queryType = queryType.toUpperCase();
+ this.autoLimitRowCount = autoLimit.matches("[0-9]+") ? new
Integer(autoLimit) : null;
Review comment:
As suggested in previous comment :
```suggestion
this.autoLimitRowCount = autoLimit != null && autoLimit.matches("[0-9]+")
? new Integer(autoLimit) : null;
```
----------------------------------------------------------------
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