Jackie-Jiang commented on pull request #6361: URL: https://github.com/apache/incubator-pinot/pull/6361#issuecomment-828099160
> > High level question: why do we perform this check on server side? We should be able to perform the check in `BrokerRequestHandler` using `PinotQuery` and `Schema`, and directly reject the query without populating the query to the servers. > > You can implement the logic within the `BaseBrokerRequestHandler.validateRequest()` > > Good question. In fact, that's the first thing I tried by putting the validation logic in broker (#6066). While this approach has a drawback that in order to get the column names appeared in the query, we have to parse the query from broker side. By doing so, the query would be parsed two times, one in broker and one in server. Given the fact that the query has to be parsed in server, we can just reuse the same queryContext object to provide the column names from the query. The problem in #6066 is the logic is not implemented in the correct function. The query is already parsed on broker side, we just need to collect all the identifiers. There are several similar operations on broker, and the overhead is very small. Routing the query to the server and adding a new metric on server side will add much more overhead. Long term wise, we will add more validations on broker side before even sending the query, and that's the reason why we made schema available on broker side. -- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
