paul-rogers commented on a change in pull request #1997: DRILL-7604: Allow 
session options to be set in HTTP queries
URL: https://github.com/apache/drill/pull/1997#discussion_r384881205
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryWrapper.java
 ##########
 @@ -76,7 +85,11 @@ public QueryResult run(final WorkManager workManager, final 
WebUserConnection we
         .setAutolimitRowcount(autoLimitRowCount)
         .build();
 
-    int defaultMaxRows = 
webUserConnection.getSession().getOptions().getOption(ExecConstants.QUERY_MAX_ROWS).num_val.intValue();
+    applyOptions(webUserConnection);
+
+    SessionOptionManager options = webUserConnection.getSession().getOptions();
+
+    int defaultMaxRows = 
options.getOption(ExecConstants.QUERY_MAX_ROWS).num_val.intValue();
 
 Review comment:
   The modern way to do this is:
   
   ```
   OptionManager options = ...
   int defaultMaxRows = (int) options.getLong(ExecConstants.QUERY_MAX_ROWS);
   ```
   
   Yes, we should have a `getInt()` method...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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