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_r252707385
 
 

 ##########
 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;
+  }
+
+  @JsonCreator
+  public QueryWrapper(@JsonProperty("query") String query, 
@JsonProperty("queryType") String queryType) {
+    this(query, queryType, "");
 
 Review comment:
   to avoid redundant pattern check : 
   ```suggestion
       this(query, queryType, 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

Reply via email to