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


##########
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:
   1.you can see as following unit test for maxRecords is 0. 
   
   
"org.apache.drill.hbase.TestHBaseFilterPushDown#testLimitPushDownWithSpecial".
   
     2.The default value of maxRecords  is -1, Perhaps I will add the following 
test cases
   ```
        final String sql = "SELECT\n"
           + "  *\n"
           + "FROM\n"
           + "  hbase.`[TABLE_NAME]` tableName\n"
   ```
   



##########
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:
   1.you can see as following unit test for maxRecords is 0. 
   
   
`"org.apache.drill.hbase.TestHBaseFilterPushDown#testLimitPushDownWithSpecial".`
   
     2.The default value of maxRecords  is -1, Perhaps I will add the following 
test cases
   ```
        final String sql = "SELECT\n"
           + "  *\n"
           + "FROM\n"
           + "  hbase.`[TABLE_NAME]` tableName\n"
   ```
   



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

To unsubscribe, e-mail: dev-unsubscr...@drill.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to