Skip to content

Conversation

@loustler
Copy link
Contributor

@loustler loustler commented Sep 6, 2024

Purpose of this pull request

A logic of a transformRow(SeaTunnelRow) from FilteredFieldTransform is equals to a copy(int) from SeaTunnelRow.
So I think we no need to keep this duplicated code.

public SeaTunnelRow copy(int[] indexMapping) {
Object[] newFields = new Object[indexMapping.length];
for (int i = 0; i < indexMapping.length; i++) {
newFields[i] = this.fields[indexMapping[i]];
}
SeaTunnelRow newRow = new SeaTunnelRow(newFields);
newRow.setRowKind(this.getRowKind());
newRow.setTableId(this.getTableId());
return newRow;
}

Does this PR introduce any user-facing change?

NO

How was this patch tested?

NO

Check list

Copy link
Contributor

@zhilinli123 zhilinli123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @loustler

@Hisoka-X Hisoka-X merged commit 2916bd7 into apache:dev Sep 9, 2024
@loustler loustler deleted the refactor/filter-field-transform branch September 9, 2024 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants