abhishekrb19 opened a new pull request, #16626:
URL: https://github.com/apache/druid/pull/16626

   @amaechler found out that when an invalid period is specified to the 
`TIME_FLOOR` function, the `DruidException` thrown by the Calcite planner 
targets the `ADMIN` persona rather than `USER`. This is easy to reproduce by 
running: `"SELECT TIME_FLOOR(CURRENT_TIMESTAMP, 'PT1Y')"` in the web-console.
   
   This PR fixes the persona by explicitly handling the 
`IllegalArgumentException` thrown during the Joda Time period instantiation, 
and make the exception user-facing. Also, the error message is now decorated 
with more context.
   
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [x] been tested in a test Druid cluster.
   


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