LakshSingla commented on code in PR #14534:
URL: https://github.com/apache/druid/pull/14534#discussion_r1257794178


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskSqlEngine.java:
##########
@@ -125,17 +125,20 @@ public boolean featureAvailable(EngineFeature feature, 
PlannerContext plannerCon
       case SCAN_NEEDS_SIGNATURE:
         return true;
       default:
-        throw new IAE("Unrecognized feature: %s", feature);
+        throw DruidException
+            .forPersona(DruidException.Persona.DEVELOPER)
+            .ofCategory(DruidException.Category.DEFENSIVE)
+            .build("Unrecognized feature: %s", feature);

Review Comment:
   These features are intended to be hidden from the user/admin/operator and 
are an implementation detail of Druid's planner. 
   They are the properties of whatever the `SqlEngine` can or cannot support, 
which allows the different engines (Native and MSQ) to co-exist, and instruct 
the planner to plan a query in a specific way. For example, the MSQ engine 
doesn't support TopN queries, so by not supporting this feature, we instruct 
the planner to plan those as GroupBy queries.
   
   As such, the only way we would ever encounter this is if we add a new 
`EngineFeature`, and we don't mention it's support in the `MSQTaskSqlEngine` or 
`NativeSqlEngine`, which is a developer's oversight and should have been 
flagged in the first place. Therefore it is a defensive exception.   



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