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

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

cgivre commented on code in PR #3000:
URL: https://github.com/apache/drill/pull/3000#discussion_r2203097759


##########
contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseRecordReader.java:
##########
@@ -84,13 +84,15 @@ public class HBaseRecordReader extends AbstractRecordReader 
implements DrillHBas
 
   private final Connection connection;
 
-  public HBaseRecordReader(Connection connection, 
HBaseSubScan.HBaseSubScanSpec subScanSpec, List<SchemaPath> projectedColumns) {
+  public HBaseRecordReader(Connection connection, 
HBaseSubScan.HBaseSubScanSpec subScanSpec, List<SchemaPath> projectedColumns, 
int maxRecords) {
     this.connection = connection;
     hbaseTableName = TableName.valueOf(
         Preconditions.checkNotNull(subScanSpec, "HBase reader needs a sub-scan 
spec").getTableName());
     hbaseScan = new Scan(subScanSpec.getStartRow(), subScanSpec.getStopRow());
     hbaseScanColumnsOnly = new Scan();
+    // Set the limit of rows for this scan. We will terminate the scan if the 
number of returned rows reaches this value.
     hbaseScan
+        .setLimit(maxRecords)

Review Comment:
   I saw that you removed the logic to test whether the `maxRecords` is 
defined.   Does this still work if `maxRecords` is `0` or `null`?





> Hbase Limit PushDown
> --------------------
>
>                 Key: DRILL-8528
>                 URL: https://issues.apache.org/jira/browse/DRILL-8528
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Storage - HBase
>    Affects Versions: 1.23.0
>            Reporter: shihuafeng
>            Priority: Major
>             Fix For: 1.23.0
>
>
> Hbase limit pushdown



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to