weiqingy commented on code in PR #2415:
URL: https://github.com/apache/auron/pull/2415#discussion_r3627648012


##########
auron-flink-extension/auron-flink-planner/src/test/java/org/apache/auron/flink/table/kafka/AuronKafkaSourceMergeITCase.java:
##########
@@ -140,4 +140,41 @@ public void 
testSharedSourceUnionAllDoesNotFuseUnderDefaultReuse() {
         rows.sort(Comparator.comparingInt(o -> (int) o.getField(0)));
         assertThat(rows).isEqualTo(Arrays.asList(Row.of(21), Row.of(21), 
Row.of(22), Row.of(22), Row.of(23)));
     }
+
+    /**
+     * The same shared-source {@code UNION ALL} as {@link
+     * #testSharedSourceUnionAllDoesNotFuseUnderDefaultReuse}, but with object 
reuse enabled. Under
+     * object reuse Flink hands the <em>same</em> {@code AuronColumnarRowData} 
reference to both
+     * standalone Calc consumers with no defensive copy in between (the 
sibling test runs with reuse
+     * off, where Flink deep-copies the row to heap per consumer). The fan-out 
still produces the
+     * correct row set because each Calc eagerly copies every column out of 
the shared columnar view
+     * into its own Arrow batch before returning, so neither consumer retains 
a reference to the
+     * reused row. If the consumers instead aliased the shared row id or read 
the batch after it was
+     * recycled, the row set would collapse or corrupt (all rows folding onto 
the last row of a
+     * batch) or fault on freed off-heap buffers.

Review Comment:
   Good catch. You're right that the assertions pin non-fusion (`count == 2`) 
and the row set, not that the standalone Calcs run through the native path.
   
   Reworded in c12805bb: the Arrow-batch copy is now framed as the native Auron 
Calc behavior the projections and filters convert to, and the comment names the 
row-set assertion as the empirical guarantee for that path instead of stating 
the copy as an unconditional fact.



-- 
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]

Reply via email to