Github user ortutay commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/298#discussion_r211785713
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/execute/HashJoinPlan.java ---
@@ -241,8 +251,35 @@ public TaskExecutionMetricsHolder
getTaskExecutionMetric() {
if (statement.getInnerSelectStatement() != null && postFilter !=
null) {
iterator = new FilterResultIterator(iterator, postFilter);
}
-
- return iterator;
+
+ if (hasSubPlansWithPersistentCache) {
+ return peekForPersistentCache(iterator, scanGrouper, scan);
+ } else {
+ return iterator;
+ }
+ }
+
+ private ResultIterator peekForPersistentCache(ResultIterator iterator,
ParallelScanGrouper scanGrouper, Scan scan) throws SQLException {
--- End diff --
It is not explicitly tested, however it is tested from
`HashJoinPersistentCacheIT`. Basically, this code path handles the first,
optimistic query which assumes the cache already exists, and then does the
second query which generates the cache. It only does the second one when needed.
The rethrow for this part:
``` if
(delegate.getContext().getDisablePersistentCache(cacheId)) {
throw e2;
}
``` is not tested, I think
---