vvysotskyi commented on a change in pull request #1387: DRILL-6603: Set 
num_nulls for parquet statistics to -1 when actual number is not defined.
URL: https://github.com/apache/drill/pull/1387#discussion_r203641624
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/planner/logical/TestConvertCountToDirectScan.java
 ##########
 @@ -159,4 +159,30 @@ public void ensureConvertForSeveralColumns() throws 
Exception {
     }
   }
 
+  @Test
+  public void ensureCorrectCountWithMissingStatistics() throws Exception {
+    dirTestWatcher.copyResourceToRoot(Paths.get("parquet", 
"wide_string.parquet"));
+
+    test("use dfs.tmp");
+    String tableName = "wide_str_table";
+    try {
+      // table will contain two partitions: one - with null value, second - 
with non null value
+      test("create table %s partition by (col_str) as select * from 
dfs.`parquet/wide_string.parquet`", tableName);
+
+      String query = String.format("select count(col_str) as cnt_str, count(*) 
as cnt_total from %s", tableName);
+
+      // direct scan should not be applied since we don't have statistics
+      testPlanMatchingPatterns(query, new String[]{}, new 
String[]{"DynamicPojoRecordReader"});
 
 Review comment:
   No need to create an empty array `new String[]{}`, just null may be passed, 
since this method has a check for nulls.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to