zhangshenghang commented on code in PR #10318:
URL: https://github.com/apache/seatunnel/pull/10318#discussion_r2681909746
##########
seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/client/HbaseClient.java:
##########
@@ -377,9 +389,22 @@ public ResultScanner scan(
String[] columnNameSplit = columnName.split(":");
scan.addColumn(Bytes.toBytes(columnNameSplit[0]),
Bytes.toBytes(columnNameSplit[1]));
}
- return this.connection
- .getTable(TableName.valueOf(hbaseParameters.getTable()))
- .getScanner(scan);
+ return scan;
+ }
+
+ private static void applyTimeRange(Scan scan, HbaseParameters
hbaseParameters)
+ throws IOException {
+ Long minTimestamp = hbaseParameters.getMinTimestamp();
+ Long maxTimestamp = hbaseParameters.getMaxTimestamp();
+ if (minTimestamp != null || maxTimestamp != null) {
+ long min = minTimestamp == null ? 0L : minTimestamp;
+ long max = maxTimestamp == null ? Long.MAX_VALUE : maxTimestamp;
+ if (min > max) {
+ throw new IllegalArgumentException(
+ "min_timestamp can't be larger than max_timestamp");
+ }
+ scan.setTimeRange(min, max);
Review Comment:
Let's add some more validations. If the configuration is less than 0,
directly report an error. Additionally, there's another issue I need you to
confirm: if min == max, is it meaningful in the HBase API?
--
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]