kfaraz commented on code in PR #16358:
URL: https://github.com/apache/druid/pull/16358#discussion_r1587523222
##########
sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/QueryLookupOperatorConversion.java:
##########
@@ -81,12 +83,18 @@ public DruidExpression toDruidExpression(
final DruidExpression arg = inputExpressions.get(0);
final Expr lookupNameExpr =
plannerContext.parseExpression(inputExpressions.get(1).getExpression());
final String replaceMissingValueWith =
getReplaceMissingValueWith(inputExpressions, plannerContext);
+ String lookupName = (String) lookupNameExpr.getLiteralValue();
+
+ // Put the lookup names in the query context to facilitate selective
loading of lookups.
+
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(lookupName);
Review Comment:
Yes, the suggested code will do just that. If the key is already present, it
will add to the existing set. If the key is absent, it will create a new set
and add the lookup to it.
--
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]