clintropolis opened a new pull request #12145:
URL: https://github.com/apache/druid/pull/12145


   ### Description
   Follow-up to #11949, this PR splits explicit time column functions into 
standalone `EARLIEST_BY` and `LATEST_BY` SQL functions to avoid the method 
signatures being ambiguous and dependent on the column types of the inputs.
   
   Prior to this PR, something like `latest(x, 10)` could either translate to 
"latest" value of x with max bytes of 10 if a string, but if x was a number it 
would treat the `10` as a timestamp, so instead of a validation exception like 
would happen prior to #11949, it would allow it but then explode with strange 
cast exceptions due to unintended behavior on the users part.
   
   Splitting this out into separate functions makes it much less likely for the 
user to issue the incorrect query.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added documentation for new or modified features or behaviors.
   - [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.
   


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