Copilot commented on code in PR #2415:
URL: https://github.com/apache/auron/pull/2415#discussion_r3627607815
##########
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:
This test comment explains the fan-out safety in terms of each Calc copying
columns into its own Arrow batch, but the test does not assert that the UNION
ALL Calcs actually run via the standalone *native* Calc path (it only asserts
they remain standalone Calcs). To avoid baking in an unconditional native-copy
explanation, reword this to be conditional on the native Calc conversion path.
--
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]