[
https://issues.apache.org/jira/browse/DRILL-6588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539399#comment-16539399
]
ASF GitHub Bot commented on DRILL-6588:
---------------------------------------
paul-rogers commented on a change in pull request #1371: DRILL-6588: Make Sys
tables of nullable datatypes
URL: https://github.com/apache/drill/pull/1371#discussion_r201533730
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/RecordDataType.java
##########
@@ -49,15 +55,25 @@
public final RelDataType getRowType(RelDataTypeFactory factory) {
final List<SqlTypeName> types = getFieldSqlTypeNames();
final List<String> names = getFieldNames();
+ final List<Boolean> nullables = getFieldNullability();
final List<RelDataType> fields = Lists.newArrayList();
- for (final SqlTypeName typeName : types) {
+ Iterator<SqlTypeName> typesIter = types.listIterator();
+ Iterator<Boolean> nullabilityIter = nullables.listIterator();
Review comment:
This is, in fact, the gist of the comment. While it is understandable to
want to leave he existing code as-is, adding more lists to the existing
parallel lists is not an improvement: it has caused a semi-wrong initial
implementation to become overly cumbersome.
If the implementation is local to this class or module, then leaving the
code cleaner after your change than when you found it is generally a good thing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> System table columns incorrectly marked as non-nullable
> --------------------------------------------------------
>
> Key: DRILL-6588
> URL: https://issues.apache.org/jira/browse/DRILL-6588
> Project: Apache Drill
> Issue Type: Bug
> Components: Metadata
> Affects Versions: 1.13.0
> Reporter: Aman Sinha
> Assignee: Kunal Khatua
> Priority: Major
> Fix For: 1.14.0
>
>
> System table columns can contain null values but they are incorrectly marked
> as non-nullable as shown in example table below:
> {noformat}
> 0: jdbc:drill:drillbit=10.10.10.191> describe sys.boot;
> +-------------------+--------------------+--------------+
> | COLUMN_NAME | DATA_TYPE | IS_NULLABLE |
> +-------------------+--------------------+--------------+
> | name | CHARACTER VARYING | NO |
> | kind | CHARACTER VARYING | NO |
> | accessibleScopes | CHARACTER VARYING | NO |
> | optionScope | CHARACTER VARYING | NO |
> | status | CHARACTER VARYING | NO |
> | num_val | BIGINT | NO |
> | string_val | CHARACTER VARYING | NO |
> | bool_val | BOOLEAN | NO |
> | float_val | DOUBLE | NO |
> +-------------------+--------------------+--------------+{noformat}
>
> Note that several columns are nulls:
> {noformat}
> +---------------------------------------------------+----------+------------------+-------------+--------+---------+------------+----------+-----------+
> | name | kind |
> accessibleScopes | optionScope | status | num_val | string_val | bool_val |
> float_val |
> +---------------------------------------------------+----------+------------------+-------------+--------+---------+------------+----------+-----------+
> drill.exec.options.exec.udf.enable_dynamic_support | BOOLEAN | BOOT | BOOT |
> BOOT | null | null | true | null |{noformat}
>
> Because of the not-null metadata, the predicates on these tables such as
> `WHERE <column> IS NULL` evaluate to FALSE which is incorrect.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)