MartijnVisser commented on code in PR #26817:
URL: https://github.com/apache/flink/pull/26817#discussion_r4782458005
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/stream/table/AsyncCorrelateITCase.java:
##########
@@ -269,6 +271,35 @@ public void testRetries() {
.hasRootCauseMessage("Error 9");
}
+ @Test
+ public void testGroupBy() {
Review Comment:
Passes on master too, so it doesn't cover the change. Could it be a left
join over the GROUP BY? A padded `-U` emitted as `+I` passes every test here.
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/correlate/async/AsyncCorrelateRunner.java:
##########
@@ -102,17 +115,24 @@ private JoinedRowResultFuture(
@Override
public void complete(Collection<Object> result) {
try {
- Collection<RowData> rightRows =
wrapPrimitivesAndConvert(result);
- completeResultFuture(rightRows);
+ completeResultFuture(result);
} catch (Throwable t) {
realOutput.completeExceptionally(t);
}
}
- private void completeResultFuture(Collection<RowData> rightRows) {
+ private void completeResultFuture(Collection<Object> result) {
realOutput.complete(
() -> {
+ Collection<RowData> rightRows =
wrapPrimitivesAndConvert(result);
if (rightRows == null || rightRows.isEmpty()) {
+ if (joinType == FlinkJoinType.LEFT) {
Review Comment:
For LEFT the padded row hides an empty result from the default FIXED_DELAY
retry: a function returning a row on its second call gives `(5, 15)` inner,
`(5, null)` left. Lookup join retries before padding.
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/correlate/async/AsyncCorrelateRunner.java:
##########
@@ -102,17 +115,24 @@ private JoinedRowResultFuture(
@Override
public void complete(Collection<Object> result) {
try {
- Collection<RowData> rightRows =
wrapPrimitivesAndConvert(result);
- completeResultFuture(rightRows);
+ completeResultFuture(result);
} catch (Throwable t) {
realOutput.completeExceptionally(t);
}
}
- private void completeResultFuture(Collection<RowData> rightRows) {
+ private void completeResultFuture(Collection<Object> result) {
realOutput.complete(
() -> {
+ Collection<RowData> rightRows =
wrapPrimitivesAndConvert(result);
Review Comment:
This also fixes a race on master, the shared converter ran on completion
threads: 4,085 to 4,394 of 19,968 `ARRAY<STRING>` rows wrong on master, none
here. Inner joins too, so it needs its own commit, ticket and test.
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/correlate/async/AsyncCorrelateRunner.java:
##########
@@ -102,17 +115,24 @@ private JoinedRowResultFuture(
@Override
public void complete(Collection<Object> result) {
try {
- Collection<RowData> rightRows =
wrapPrimitivesAndConvert(result);
- completeResultFuture(rightRows);
+ completeResultFuture(result);
} catch (Throwable t) {
realOutput.completeExceptionally(t);
}
}
- private void completeResultFuture(Collection<RowData> rightRows) {
+ private void completeResultFuture(Collection<Object> result) {
realOutput.complete(
() -> {
+ Collection<RowData> rightRows =
wrapPrimitivesAndConvert(result);
if (rightRows == null || rightRows.isEmpty()) {
+ if (joinType == FlinkJoinType.LEFT) {
+ GenericRowData nulls =
+ new
GenericRowData(resultType.getFieldCount());
Review Comment:
`AsyncLookupJoinRunner` reuses one `nullRow`, might make sense here too.
--
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]