drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinfengni <...@git.apache.org>
Subject [GitHub] drill issue #819: DRILL-5419: Calculate return string length for literals & ...
Date Fri, 05 May 2017 19:17:53 GMT
Github user jinfengni commented on the issue:

    My understanding is Drill would hit a schema change between column with type of varchar(5)
and varchar(10).  However, the length calculated in this PR is from the query metadeta (function
parameter, string literal), which will not change across different batches. In that sense,
we should not see schema change exception, just because of varchar length.
    The following code shows that varchar(5) is different from varchar(10), also different
from varchar without setting length. 
       TypeProtos.MajorType varchar5 = TypeProtos.MajorType.newBuilder()
        TypeProtos.MajorType varchar10 = TypeProtos.MajorType.newBuilder()
        TypeProtos.MajorType varcharNoLength = TypeProtos.MajorType.newBuilder()
        System.out.println(varchar5.equals(varchar10) ? "varchar5 equals varchr10" : "varchar5
NOT equals varchr10" );
        System.out.println(varchar5.equals(varcharNoLength) ? "varchar5 equals varchrNoLength"
: "varchar5 NOT equals varchrNoLength" );
    varchar5 NOT equals varchr10
    varchar5 NOT equals varchrNoLength

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