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


   ### Description
   Follow-up to #9638, this PR changes the expression system to operate on 
`ValueType` instead of `ExprType`. There should be no side-effects from this 
change, even though `ExprType` was missing `FLOAT` and `COMPLEX`, because  
`ExprType` was typically used to control explicitly supported types and 
otherwise explode. Input types are currently detected from the type of object 
when resolving identifiers, so there isn't risk of these unhandled types 
leaking into the expression system. A method `toExpressionType` has been added 
to convert a `ValueType` into the types which the expression system does 
understand (float into double, complex into an exception), for the SQL planning 
layer to use, (this was pushed down from `Expressions` utility class).
   
   The only strange-ness introduced in this PR is that when implementing 
expressions we should ignore these unhandled types, but it seems worth it for 
having a single type system enum to use in all layers, as well as being able to 
share the utility methods available on `ValueType`.
   
   <hr>
   
   This PR has:
   - [ ] been self-reviewed.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [ ] 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.
   - [ ] added integration tests.
   - [ ] 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.

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