[
https://issues.apache.org/jira/browse/DRILL-3477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14619751#comment-14619751
]
ASF GitHub Bot commented on DRILL-3477:
---------------------------------------
GitHub user StevenMPhillips opened a pull request:
https://github.com/apache/drill/pull/84
DRILL-3477: Use varbinary for null vectors
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/StevenMPhillips/incubator-drill drill-3477
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/drill/pull/84.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #84
----
commit 5dc85777fa9826a9e72a428f9abfda1e8d066123
Author: Steven Phillips <[email protected]>
Date: 2015-07-09T00:39:32Z
DRILL-3477: Use varbinary for null vectors
----
> Using IntVector for null expressions causes problems with implicit cast
> -----------------------------------------------------------------------
>
> Key: DRILL-3477
> URL: https://issues.apache.org/jira/browse/DRILL-3477
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Steven Phillips
> Assignee: Steven Phillips
>
> See DRILL-3353, for example.
> A simple example is this:
> {code}
> select * from t where a = 's';
> {code}
> If the first batch scanned from table t does not contain the column a, the
> expression materializer in Project defaults to Nullable Int as the type. The
> Filter then sees an Equals expression between a VarChar and an Int type, so
> it does an implicit cast. Implicit cast rules give Int higher precedence, so
> the literal 's' is cast to Int, which ends up throwing a
> NumberFormatException.
> In the class ResolverTypePrecedence, we see that Null type has the lowest
> precedence, which makes sense. But since we don't actually currently have an
> implementation for NullVector, we should materialize the Null type as the
> Vector with the lowest possible precedence, which is VarBinary.
> My suggestion is that we should use VarBinary as the default type in
> ExpressionMaterializer instead of Int.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)