rdblue commented on a change in pull request #750: Add time-travel methods
(asOfTime,useSnapshot) in IcebergGenerics
URL: https://github.com/apache/incubator-iceberg/pull/750#discussion_r371374679
##########
File path: data/src/main/java/org/apache/iceberg/data/IcebergGenerics.java
##########
@@ -56,27 +61,33 @@ public ScanBuilder reuseContainers() {
}
public ScanBuilder where(Expression rowFilter) {
- this.where = Expressions.and(where, rowFilter);
+ this.tableScan = this.tableScan.filter(Expressions.and(defaultWhere,
rowFilter));
return this;
}
public ScanBuilder caseInsensitive() {
- this.caseSensitive = false;
+ this.tableScan = this.tableScan.caseSensitive(false);
return this;
}
public ScanBuilder select(String... selectedColumns) {
- this.columns = ImmutableList.copyOf(selectedColumns);
+ this.tableScan =
this.tableScan.select(ImmutableList.copyOf(selectedColumns));
+ return this;
+ }
+
+ public ScanBuilder useSnapshot(long scanSnapshotId) {
+ this.tableScan = this.tableScan.useSnapshot(scanSnapshotId);
+ return this;
+ }
+
+ public ScanBuilder asOfTime(long scanTimestampMillis) {
+ this.tableScan = this.tableScan.asOfTime(scanTimestampMillis);
return this;
}
public Iterable<Record> build() {
return new TableScanIterable(
- table
- .newScan()
- .filter(where)
- .caseSensitive(caseSensitive)
- .select(columns),
+ this.tableScan,
Review comment:
We only use `this.` when assigning to an instance field, so that it is clear
from that line that the assignment is not to a local variable. We don't use
`this.` when accessing the variable. Can you remove those?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]