asereda-gs commented on a change in pull request #1119: [CALCITE-2937] Linq4j:
implement LazyEnumerable
URL: https://github.com/apache/calcite/pull/1119#discussion_r267502605
##########
File path: linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java
##########
@@ -524,6 +525,39 @@ public void close() {
}
}
+ /**
+ * Returns an {@link Enumerable} whose computation (via a {@link Supplier})
will be
+ * postponed until it is actually required
+ *
+ * @param supplier Enumerable supplier
+ * @param <E> Element type
+ *
+ * @return Lazy enumerable
+ */
+ public static <E> Enumerable<E> lazyEnumerable(Supplier<Enumerable<E>>
supplier) {
Review comment:
I'm not sure if `linq4j` package can now depend directly on Java8 (calcite
does).
If not, there is linq4j equivalent of `Supplier` :
[Function0](https://github.com/apache/calcite/blob/master/linq4j/src/main/java/org/apache/calcite/linq4j/function/Function0.java)
----------------------------------------------------------------
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