ccaominh commented on a change in pull request #6974: sql support for dynamic 
parameters
URL: https://github.com/apache/incubator-druid/pull/6974#discussion_r309813099
 
 

 ##########
 File path: 
sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java
 ##########
 @@ -191,6 +204,17 @@ public DataContext createDataContext(final 
JavaTypeFactory typeFactory)
           DataContext.Variable.TIME_ZONE.camelName, 
localNow.getZone().toTimeZone().clone(),
           DATA_CTX_AUTHENTICATION_RESULT, authenticationResult
       );
+      private final Map<String, Object> context;
+
+      DruidDataContext()
+      {
+        ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
+        builder.putAll(base_context);
+        for (int i = 0; i < parameters.size(); i++) {
 
 Review comment:
   Depending on the implementation and size of the list, it may be more 
efficient to iterate directly over the list values, e.g.:
   ```java
   int i = 0;
   for (TypedValue parameter : parameters) {
       builder.put("?" + i, parameter.value);
       i++;
   }
   ```

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