Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improve][Transform-v2] Refactor a transformRow from FilterFieldTransform #7598

Merged
merged 1 commit into from
Sep 9, 2024

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
6 checks passed
@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