clintropolis commented on a change in pull request #6974: sql support for 
dynamic parameters
URL: https://github.com/apache/druid/pull/6974#discussion_r370594282
 
 

 ##########
 File path: sql/src/main/java/org/apache/druid/sql/SqlLifecycle.java
 ##########
 @@ -131,12 +139,28 @@ private String sqlQueryId()
     return (String) this.queryContext.get(PlannerContext.CTX_SQL_QUERY_ID);
   }
 
+  public void setParameters(List<TypedValue> parameters)
+  {
+    this.parameters = parameters;
+  }
+
+  public PrepareResult prepare(AuthenticationResult authenticationResult) 
throws ValidationException, RelConversionException, SqlParseException
+  {
+    synchronized (lock) {
+      try (DruidPlanner planner = plannerFactory.createPlanner(queryContext, 
parameters, authenticationResult)) {
+        this.plannerContext = planner.getPlannerContext();
 
 Review comment:
   It doesn't _need_ to be, but since logging/emitting metrics collects 
information from it, if something goes wrong before it is set it makes the data 
available for that part.

----------------------------------------------------------------
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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to