[
https://issues.apache.org/jira/browse/DRILL-7171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16817599#comment-16817599
]
ASF GitHub Bot commented on DRILL-7171:
---------------------------------------
vdiravka commented on pull request #1748: DRILL-7171: Create metadata
directories cache file in the leaf level directories to support
ConvertCountToDirectScan optimization.
URL: https://github.com/apache/drill/pull/1748#discussion_r275222089
##########
File path:
exec/java-exec/src/test/java/org/apache/drill/exec/planner/logical/TestConvertCountToDirectScan.java
##########
@@ -274,4 +274,72 @@ public void testCountsWithWildCard() throws Exception {
test("drop table if exists %s", tableName);
}
}
+
+ @Test
+ public void testCountsForLeafDirectories() throws Exception {
+ test("use dfs.tmp");
+ String tableName = "parquet_table_counts";
+
+ try {
+ test("create table `%s/1` as select * from cp.`tpch/nation.parquet`",
tableName);
+ test("create table `%s/2` as select * from cp.`tpch/nation.parquet`",
tableName);
+ test("create table `%s/3` as select * from cp.`tpch/nation.parquet`",
tableName);
+ test("refresh table metadata %s", tableName);
+
+ String sql = String.format("select\n" +
+ "count(*) as star_count\n" +
+ "from `%s/1`", tableName);
+
+ int expectedNumFiles = 1;
+ String numFilesPattern = "numFiles = " + expectedNumFiles;
+ String usedMetaSummaryPattern = "usedMetadataSummaryFile = true";
+ String recordReaderPattern = "DynamicPojoRecordReader";
+
+ testPlanMatchingPatterns(sql, new String[]{numFilesPattern,
usedMetaSummaryPattern, recordReaderPattern});
+
+ testBuilder()
+ .sqlQuery(sql)
+ .unOrdered()
+ .baselineColumns("star_count")
+ .baselineValues(25L)
+ .go();
+
+ } finally {
+ test("drop table if exists %s", tableName);
+ }
+ }
+
+ @Test
+ public void testcountsForDirWithFilesAndDir() throws Exception {
Review comment:
```suggestion
public void testCountsForDirWithFilesAndDir() throws Exception {
```
----------------------------------------------------------------
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]
> Count(*) query on leaf level directory is not reading summary cache file.
> -------------------------------------------------------------------------
>
> Key: DRILL-7171
> URL: https://issues.apache.org/jira/browse/DRILL-7171
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Venkata Jyothsna Donapati
> Assignee: Venkata Jyothsna Donapati
> Priority: Minor
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Since the leaf level directory doesn't store the metadata directories file,
> while reading summary if the directories cache file is not present, it is
> assumed that the cache is possibly corrupt and reading of the summary cache
> file is skipped. Metadata directories cache file should be created at the
> leaf level.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)