paul-rogers commented on a change in pull request #2043: DRILL-7673: View set
query fails with NPE for non-existing option
URL: https://github.com/apache/drill/pull/2043#discussion_r399613716
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/SetOptionHandler.java
##########
@@ -63,9 +64,10 @@ public final PhysicalPlan getPlan(SqlNode sqlNode) throws
ForemanSetupException
SqlNode optionValue = statement.getValue();
if (optionValue == null) {
+ OptionDefinition optionDefinition =
optionManager.getOptionDefinition(optionName);
String value =
String.valueOf(optionManager.getOption(optionName).getValue());
- return DirectPlan.createDirectPlan(context, new
SetOptionViewResult(optionName, value));
+ return DirectPlan.createDirectPlan(context, new
SetOptionViewResult(optionDefinition.getValidator().getOptionName(), value));
Review comment:
The naive reader (that would be me) would wonder why not use the
`optionName` rather than using this indirect approach. Maybe a brief comment
saying that we're doing it this way to use the name as defined in the option,
rather than what the user provided.
----------------------------------------------------------------
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