amogh-jahagirdar commented on code in PR #15646:
URL: https://github.com/apache/iceberg/pull/15646#discussion_r2944326228
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -129,10 +130,12 @@ protected TableScan newRefinedScan(
}
@Override
- public FileIO io() {
- Preconditions.checkState(
- null != scanFileIO, "FileIO is not available: planFiles() must be
called first");
- return scanFileIO;
+ public Supplier<FileIO> fileIO() {
+ return () -> {
+ Preconditions.checkState(
Review Comment:
I do feel like there's an argument that we should still keep the check. The
Supplier return type indicates to a caller that they need to think about when
to invoke `get` but if the caller does invoke get prematurely, I think it's
best to throw rather than return null.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]