vvysotskyi commented on a change in pull request #1763: DRILL-6974: Add possibility to view option value via SET command URL: https://github.com/apache/drill/pull/1763#discussion_r277778188
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/SetOptionHandler.java ########## @@ -20,108 +20,68 @@ import java.math.BigDecimal; import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.tools.ValidationException; - import org.apache.calcite.util.NlsString; import org.apache.drill.common.exceptions.UserException; -import org.apache.drill.exec.ExecConstants; import org.apache.drill.exec.ops.QueryContext; import org.apache.drill.exec.physical.PhysicalPlan; import org.apache.drill.exec.planner.sql.DirectPlan; +import org.apache.drill.exec.planner.sql.parser.DrillSqlSetOption; import org.apache.drill.exec.server.options.OptionManager; import org.apache.drill.exec.server.options.OptionValue; import org.apache.drill.exec.server.options.OptionValue.OptionScope; -import org.apache.drill.exec.server.options.QueryOptionManager; -import org.apache.drill.exec.util.ImpersonationUtil; import org.apache.drill.exec.work.foreman.ForemanSetupException; import org.apache.calcite.sql.SqlLiteral; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.SqlSetOption; /** - * Converts a {@link SqlNode} representing "ALTER .. SET option = value" and "ALTER ... RESET ..." statements to a - * {@link PhysicalPlan}. See {@link SqlSetOption}. These statements have side effects i.e. the options within the - * system context or the session context are modified. The resulting {@link DirectPlan} returns to the client a string - * that is the name of the option that was updated. + * Converts a {@link SqlNode} representing: "ALTER .. SET option = value" or "ALTER ... SET option" + * statement to a {@link PhysicalPlan}. See {@link DrillSqlSetOption} + * <p> + * These statements have side effects i.e. the options within the system context or the session context are modified. + * The resulting {@link DirectPlan} returns to the client a string that is the name of the option that was updated + * or a value of the property */ -public class SetOptionHandler extends AbstractSqlHandler { - private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SetOptionHandler.class); - - private final QueryContext context; +public class SetOptionHandler extends AbstractSqlSetHandler { + private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(SetOptionHandler.class); public SetOptionHandler(QueryContext context) { - this.context = context; + super(context); } + /** + * {@inheritDoc} Review comment: The same as for `ResetOptionHandler` ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services