[ 
https://issues.apache.org/jira/browse/DRILL-7238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16834202#comment-16834202
 ] 

ASF GitHub Bot commented on DRILL-7238:
---------------------------------------

amansinha100 commented on pull request #1781: DRILL-7238: Fixed 
ConvertCountToDirectScan to handle non-existent columns
URL: https://github.com/apache/drill/pull/1781#discussion_r281363696
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/ConvertCountToDirectScanRule.java
 ##########
 @@ -288,7 +288,10 @@ public void onMatch(RelOptRuleCall call) {
 
           Metadata_V4.ColumnTypeMetadata_v4 columnMetadata = 
metadataSummary.getColumnTypeInfo(new 
Metadata_V4.ColumnTypeMetadata_v4.Key(simplePath));
 
-         if (columnMetadata == null || columnMetadata.totalNullCount == 
Statistic.NO_COLUMN_STATS) {
+          if (columnMetadata == null) {
+            // If the column doesn't exist in the table, row count is set to 0
 
 Review comment:
   Also update the Javadoc for this method by adding this information for 
non-existing column
 
----------------------------------------------------------------
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:
[email protected]


> Drill does not use DirectScan for non-existent columns
> ------------------------------------------------------
>
>                 Key: DRILL-7238
>                 URL: https://issues.apache.org/jira/browse/DRILL-7238
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Metadata
>            Reporter: Venkata Jyothsna Donapati
>            Assignee: Venkata Jyothsna Donapati
>            Priority: Major
>             Fix For: 1.17.0
>
>
> This query does not use the summary metadata cache file:
> select count(int_nulls_id), count(int_id), count(ss_ticket_number), 
> count(extra) from store_sales_null_blocks_int;
> In this query, extra is a column that does not exist (non-existent column).
> Here is the explain plan:
> {noformat}
> | 00-00    Screen
> 00-01      Project(EXPR$0=[$0], EXPR$1=[$1], EXPR$2=[$2], EXPR$3=[$3])
> 00-02        StreamAgg(group=[{}], EXPR$0=[$SUM0($0)], EXPR$1=[$SUM0($1)], 
> EXPR$2=[$SUM0($2)], EXPR$3=[$SUM0($3)])
> 00-03          UnionExchange
> 01-01            StreamAgg(group=[{}], EXPR$0=[COUNT($0)], 
> EXPR$1=[COUNT($1)], EXPR$2=[COUNT($2)], EXPR$3=[COUNT($3)])
> 01-02              Scan(table=[[dfs, parquet_metadata_cache, 
> store_sales_null_blocks_int]], groupscan=[ParquetGroupScan 
> [entries=[ReadEntryWithPath 
> [path=/drill/testdata/metadata_cache/store_sales_null_blocks_int]], 
> selectionRoot=/drill/testdata/metadata_cache/store_sales_null_blocks_int, 
> numFiles=1, numRowGroups=11, usedMetadataFile=true, 
> cacheFileRoot=/drill/testdata/metadata_cache/store_sales_null_blocks_int, 
> columns=[`int_nulls_id`, `int_id`, `ss_ticket_number`, `extra`]]])
> {noformat}
> This is a regression from Drill 1.15.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to