Skip to content

Commit

Permalink
[core] optimize the binlog table read performance (apache#4773)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitozi authored Dec 25, 2024
1 parent 9ac36bb commit 274ed05
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,25 +110,22 @@ public InnerTableRead withReadType(RowType readType) {
@Override
public RecordReader<InternalRow> createReader(Split split) throws IOException {
DataSplit dataSplit = (DataSplit) split;
InternalRow.FieldGetter[] fieldGetters = wrapped.rowType().fieldGetters();

if (dataSplit.isStreaming()) {
return new PackChangelogReader(
dataRead.createReader(split),
(row1, row2) ->
new AuditLogRow(
readProjection,
convertToArray(
row1, row2, wrapped.rowType().fieldGetters())),
readProjection, convertToArray(row1, row2, fieldGetters)),
wrapped.rowType());
} else {
return dataRead.createReader(split)
.transform(
(row) ->
new AuditLogRow(
readProjection,
convertToArray(
row,
null,
wrapped.rowType().fieldGetters())));
convertToArray(row, null, fieldGetters)));
}
}

Expand Down

0 comments on commit 274ed05

Please sign in to comment.