vaijosh commented on code in PR #7988:
URL: https://github.com/apache/hbase/pull/7988#discussion_r2999124752
##########
hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestScan.java:
##########
@@ -254,6 +256,36 @@ public void testScanCopyConstructor() throws Exception {
"Make sure copy constructor adds all the fields in the copied object");
}
+ @Test(expected = IncompatibleFilterException.class)
+ public void testSetFilterWithBatchThrows() {
+ Scan scan = new Scan();
+ scan.setBatch(5);
+ scan.setFilter(new PageFilter(10));
+ }
+
+ @Test
+ public void testSetFilterWithoutBatchDoesNotThrow() {
+ Scan scan = new Scan();
+ scan.setFilter(new PageFilter(10));
+ // no exception expected
+ }
+
+ @Test
+ public void testSetFilterWithBatchAndNonFilterRowFilter() {
+ Scan scan = new Scan();
+ scan.setBatch(5);
+ scan.setFilter(new FilterList());
+ // FilterList.hasFilterRow() returns false, so no exception expected
+ }
+
+ @Test
+ public void testSetFilterWithBatchAndNullFilter() {
+ Scan scan = new Scan();
+ scan.setBatch(5);
+ scan.setFilter(null);
+ // null filter should not throw
Review Comment:
@mini666,
I'd add test to cover "filter == null" path.
@Test
public void testSetFilterNullWithBatchDoesNotThrow() {
Scan scan = new Scan();
scan.setBatch(5);
scan.setFilter(null); // should not throw
}
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]