dobesv 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_r391083173
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/QueryResources.java
##########
@@ -110,6 +118,50 @@ public Viewable submitQuery(@FormParam("query") String
query,
}
}
+ private Map<String, Object> readOptionsFromForm(Form form) {
+ Map<String, Object> options = new HashMap<>();
+ SessionOptionManager sessionOptionManager =
webUserConnection.getSession().getOptions();
+ for (Map.Entry<String, List<String>> pair : form.asMap().entrySet()) {
+ String name = pair.getKey();
+ OptionDefinition definition =
sessionOptionManager.getOptionDefinition(name);
+ if (definition != null) {
+ String valueStr = pair.getValue().get(0);
Review comment:
I can't really think of a circumstance where the form parser insert a key
with zero values, it doesn't make any sense to me that it would do that, since
it only inserts keys for values it finds in the Form and thus there should be
at least one value for each key.
----------------------------------------------------------------
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