real-mj-song opened a new issue, #14916:
URL: https://github.com/apache/pinot/issues/14916

   ## Issue Description
   `BadQueryRequestException` is currently used when a bad query is passed by 
client. When we classify `BadQueryRequestException` for `QueryException`, it's 
reported as `QueryException.QUERY_EXECUTION_ERROR` (200). The issue is 
`QueryException.QUERY_EXECUTION_ERROR` code is too generic which doesn't really 
tell much about the nature of this failure.
   
   ### BadQueryRequestException Usage
   [List of BadQueryRequestException 
uses](https://github.com/search?q=repo%3Aapache%2Fpinot+%22throw+new+BadQueryRequestException%22&type=code).
 They are all client side bad queries such as
   > Illegal function name: 
   > Expect 2 arguments for function: 
   > Nested query is not supported without gapfill
   
   ## Examples
   ```sql
   SELECT "job_id" FROM job_board  WHERE "company_id" = 
'___nothing_will_match_this_fake_value___';
   ```
   Assuming company_id is a numeric type, this will error with something like
   ```
   200 QueryExecutionError:
   org.apache.pinot.spi.exception.BadQueryRequestException: 
   java.lang.IllegalArgumentException: Cannot convert value: 
'___nothing_will_match_this_fake_value___' to type: LONG/INT/etc.
   ```
   
   ### How to reproduce
   Pick an integration test like 
[OfflineClusterIntegrationTest](https://github.com/apache/pinot/blob/master/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/OfflineClusterIntegrationTest.java),
 and try a new test case function
   ```java
     @Test()
     public void tempTest()
         throws Exception {
       String sqlQuery =
                 "SELECT AirlineID, COUNT(*) FROM mytable WHERE AirlineID = 
'some_bogus_here' "
               + "GROUP BY AirlineID";
       JsonNode result = postQuery(sqlQuery);
       assertNoError(result);
     }
   ```
   
   ## Suggested Fix
   In 
[org/apache/pinot/core/query/executor/ServerQueryExecutorV1Impl.java](https://github.com/apache/pinot/blob/master/pinot-core/src/main/java/org/apache/pinot/core/query/executor/ServerQueryExecutorV1Impl.java),
 we can classify this as `QueryException.QUERY_VALIDATION_ERROR` instead of 
generic `QueryException.QUERY_EXECUTION_ERROR` to indicate this is a client 
side error.


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