mengw15 commented on code in PR #5149:
URL: https://github.com/apache/texera/pull/5149#discussion_r3290696889
##########
common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/result/iceberg/IcebergDocument.scala:
##########
@@ -125,7 +125,9 @@ private[storage] class IcebergDocument[T >: Null <: AnyRef](
.getOrElse(
return 0
)
- table.newScan().planFiles().iterator().asScala.map(f =>
f.file().recordCount()).sum
+ Using.resource(table.newScan().planFiles()) { tasks =>
Review Comment:
This PR's only addition at this site is wrapping the existing call in
Using.resource to release the parent CloseableIterable. Using.resource(r)(body)
itself doesn't materialize anything — it expands to try body(r) finally
r.close(). Iteration is driven by .sum, which was already on main and would
consume the iterator. So consumption / materialization behavior is identical
before and after this PR; the only delta is that the parent iterable now gets
closed.
--
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]