[
https://issues.apache.org/jira/browse/DRILL-4905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15526958#comment-15526958
]
ASF GitHub Bot commented on DRILL-4905:
---------------------------------------
Github user ppadma commented on a diff in the pull request:
https://github.com/apache/drill/pull/597#discussion_r80756694
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScan.java
---
@@ -926,16 +944,22 @@ public GroupScan applyLimit(long maxRecords) {
fileNames.add(rowGroupInfo.getPath());
}
- if (fileNames.size() == fileSet.size() ) {
+ // If there is no change in fileSet and maxRecords is >= batchSize, no
need to create new groupScan.
+ if (fileNames.size() == fileSet.size() && (maxRecords >= batchSize) ) {
// There is no reduction of rowGroups. Return the original groupScan.
logger.debug("applyLimit() does not apply!");
return null;
}
+ // If limit maxRecords is less than batchSize, update batchSize to the
limit size.
+ if (maxRecords < batchSize) {
+ batchSize = (int) maxRecords;
--- End diff --
I tried to avoid this casting. To fix this, have to change code in bunch
of places. I was trying to keep code changes minimal so no new regressions are
introduced.
> Push down the LIMIT to the parquet reader scan to limit the numbers of
> records read
> -----------------------------------------------------------------------------------
>
> Key: DRILL-4905
> URL: https://issues.apache.org/jira/browse/DRILL-4905
> Project: Apache Drill
> Issue Type: Bug
> Components: Storage - Parquet
> Affects Versions: 1.8.0
> Reporter: Padma Penumarthy
> Assignee: Padma Penumarthy
> Fix For: 1.9.0
>
>
> Limit the number of records read from disk by pushing down the limit to
> parquet reader.
> For queries like
> select * from <table> limit N;
> where N < size of Parquet row group, we are reading 32K/64k rows or entire
> row group. This needs to be optimized to read only N rows.
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)