Akshat-Jain commented on code in PR #16358:
URL: https://github.com/apache/druid/pull/16358#discussion_r1587511564


##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/SqlResourceCollectorShuttle.java:
##########
@@ -87,13 +88,21 @@ public SqlNode visit(SqlIdentifier id)
         if (qualifiedNameParts.size() == 2) {
           final String schema = qualifiedNameParts.get(0);
           final String resourceName = qualifiedNameParts.get(1);
+
+          // Put the lookup names in the query context to facilitate selective 
loading of lookups.
+          if (schema.equals(NamedLookupSchema.NAME)) {
+            
plannerContext.queryContextMap().putIfAbsent(PlannerContext.CTX_LOOKUPS_TO_LOAD,
 new HashSet<>());
+            Set<String> lookupsToLoad = (Set<String>) 
plannerContext.queryContextMap().get(PlannerContext.CTX_LOOKUPS_TO_LOAD);
+            lookupsToLoad.add(resourceName);

Review Comment:
   I'm not sure I follow. There can be multiple lookup names which have to be 
added to the context map. So we have to put value in the context map even if 
`PlannerContext.CTX_LOOKUPS_TO_LOAD` key is already present.
   
   Please let me know if I'm misunderstanding something. Thanks!



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to