LakshSingla commented on code in PR #14886:
URL: https://github.com/apache/druid/pull/14886#discussion_r1327591629
##########
sql/src/main/java/org/apache/druid/sql/calcite/rule/DruidRules.java:
##########
@@ -123,6 +124,7 @@ public static List<RelOptRule> rules(PlannerContext
plannerContext)
retVal.add(DruidFilterUnnestRule.DruidProjectOnUnnestRule.instance());
}
+
Review Comment:
nit: Unnecessary
```suggestion
```
##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java:
##########
@@ -527,13 +522,9 @@ public boolean featureAvailable(final EngineFeature
feature)
// Short-circuit: feature requires context flag.
return false;
}
-
- if (feature == EngineFeature.UNNEST &&
- !QueryContexts.getAsBoolean(CTX_ENABLE_UNNEST,
queryContext.get(CTX_ENABLE_UNNEST), false)) {
- // Short-circuit: feature requires context flag.
+ if (engine == null) {
return false;
}
Review Comment:
```suggestion
```
##########
sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java:
##########
@@ -3052,6 +3066,7 @@ public void
testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations()
{
cannotVectorize();
skipVectorize();
+ notMsqCompatible();
Review Comment:
Adding this should be easy:
https://github.com/apache/druid/blob/39d95955f5508143b4fd2352baa3fe60a4920357/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteMSQTestsHelper.java#L182
You can make the changes here. We should enable this in the PR itself unless
it requires some other refactor.
##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java:
##########
@@ -527,13 +522,9 @@ public boolean featureAvailable(final EngineFeature
feature)
// Short-circuit: feature requires context flag.
return false;
}
-
- if (feature == EngineFeature.UNNEST &&
- !QueryContexts.getAsBoolean(CTX_ENABLE_UNNEST,
queryContext.get(CTX_ENABLE_UNNEST), false)) {
- // Short-circuit: feature requires context flag.
+ if (engine == null) {
Review Comment:
Is this required anywhere in the main code?
I think `EngineFeature` is `null` in one of the test cases. We should
provide any implementation in that test case instead of making the change in
the main code. This can hide bugs, if we unintentionally pass EngineFeature as
`null` in the main code.
--
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]