drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill issue #517: DRILL-4704 fix
Date Sun, 07 Aug 2016 18:00:56 GMT
Github user paul-rogers commented on the issue:

    As a follow-up, the case we're focusing on is an implicit cast: one created by the system
to convert an integer to a decimal type in order to do an equality check. To avoid the scale
issue, the code that does the explcit cast should check the type of integer and select a target
decimal type that will hold all values of that int type with a scale of 0. Does the code do
that now? It may be that the decimal type must also be cast so that the equality has the same
types. That is, if we compare Dec9 with Integer, we need a scale of 10 for the Int, so we
must cast the Int to Dec18. As a result, we must cast the Dec9 to Dec18.
    The reason for all of this is that the casts are done statically. A more efficient solution
would be for the the run-time code to make a decision based on actual values, but Drill is
not set up that way. Another solution would be to have an in-memory form of a decimal that
caries the precision and scale so we can set the scale per value. But, Drill is not set up
that way either.
    So, the change we've been discussing (setting scale based on int and decimal types, ignoring
overflow for now) seems the only short-term solution for 1.8.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message