You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/09/04 04:16:41 UTC

[GitHub] [druid] clintropolis opened a new pull request #10355: consolidate ValueType and ExprType

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis closed pull request #10355: consolidate ValueType and ExprType

Posted by GitBox <gi...@apache.org>.
clintropolis closed pull request #10355:
URL: https://github.com/apache/druid/pull/10355


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] gianm commented on pull request #10355: consolidate ValueType and ExprType

Posted by GitBox <gi...@apache.org>.
gianm commented on pull request #10355:
URL: https://github.com/apache/druid/pull/10355#issuecomment-687443737


   Because the expression system doesn't support all of the normal Druid ValueTypes, it might actually be better to keep them separate, since it makes things more type-safe. (We know that if we have an ExprType, then that represents a ValueType that the expression system can handle.)


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] clintropolis commented on pull request #10355: consolidate ValueType and ExprType

Posted by GitBox <gi...@apache.org>.
clintropolis commented on pull request #10355:
URL: https://github.com/apache/druid/pull/10355#issuecomment-689241906


   >Because the expression system doesn't support all of the normal Druid ValueTypes, it might actually be better to keep them separate, since it makes things more type-safe. (We know that if we have an ExprType, then that represents a ValueType that the expression system can handle.)
   
   Yeah, I think long term we definitely do want to consolidate these, but maybe I am jumping ahead a bit and we should wait until `Expr` can handle all `ValueType`. I will close this PR for now.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org