ankitsultana commented on code in PR #17081:
URL: https://github.com/apache/pinot/pull/17081#discussion_r2467171327


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/TimeSeriesRequestHandler.java:
##########
@@ -238,6 +250,70 @@ private void 
firstStageAccessControlCheck(RequesterIdentity requesterIdentity) {
     }
   }
 
+  private void validatePhysicalPlan(HttpHeaders httpHeaders, 
TimeSeriesDispatchablePlan dispatchablePlan) {
+    // check authorization for table
+    tableLevelAccessControlCheck(httpHeaders, 
dispatchablePlan.getTableNames());
+    // validate column names for all LeafTimeSeriesPlanNode in the physical 
plan
+    for (BaseTimeSeriesPlanNode currNode : 
dispatchablePlan.getServerFragments()) {
+      if (currNode instanceof LeafTimeSeriesPlanNode) {
+        validateColumnNames((LeafTimeSeriesPlanNode)currNode);
+      }
+    }
+    if (dispatchablePlan.getBrokerFragment() instanceof  
LeafTimeSeriesPlanNode) {
+      validateColumnNames((LeafTimeSeriesPlanNode) 
dispatchablePlan.getBrokerFragment());
+    }
+  }
+
+  /**
+   * Helper function that takes a @Code{LeafTimeSeriesPlanNode} and validates 
the column names used
+   * in the filter, groupBy, value etc. expressions
+   * @param leafNode
+   */
+  private void validateColumnNames(LeafTimeSeriesPlanNode leafNode) {

Review Comment:
   I'd also recommend adding some unit-tests by making this method 
static/protected.



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