Conversation
ashishjayamohan
commented
Oct 3, 2024
- Addresses Send a proper response when user queries a disabled table #14087
- Added check for enabled tables for realtime and offline
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #14154 +/- ##
============================================
- Coverage 61.75% 55.54% -6.21%
- Complexity 207 791 +584
============================================
Files 2436 2065 -371
Lines 133233 108946 -24287
Branches 20636 17255 -3381
============================================
- Hits 82274 60512 -21762
+ Misses 44911 43607 -1304
+ Partials 6048 4827 -1221
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| throw QueryException.getException(QueryException.SQL_PARSING_ERROR, ex); | ||
| } | ||
|
|
||
| String tableName = CalciteSqlParser.compileToPinotQuery(sqlQuery).getDataSource().getTableName(); |
There was a problem hiding this comment.
This will only work if the user issues a query via the controller query API. The recommended way of querying Pinot is via the broker query API (https://docs.pinot.apache.org/users/api/querying-pinot-using-standard-sql) which is also what the controller API delegates to -
Ideally, we'd want this check in the broker request handler, since all external REST API based queries will always go through there.
There was a problem hiding this comment.
@yashmayya Gotcha. I'm looking at the isTableEnabled function in the PinotHelixResourceManager, but can't quite figure out how to use that in the broker request handler. Is there something else I should use instead?
There was a problem hiding this comment.
The BaseBrokerStarter which instantiates the single-stage broker request handler and the multi-stage broker request handler also has a HelixAdmin that can be used to check the table's ideal state in ZK (which has the enabled / disabled information). So you could inject this admin (and the cluster name) as a dependency into the broker request handlers from the BaseBrokerStarter and use it to check whether the tables in a request are disabled.