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

[core] fix after compactioned the array elements are duplicated #2364

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

zhuangchong
Copy link
Contributor

Purpose

Linked issue: close #2353

Tests

API and Format

Documentation

@@ -43,7 +43,8 @@ public OrcRowColumnVector(StructColumnVector hiveVector, RowType type) {

@Override
public ColumnarRow getRow(int i) {
this.columnarRow.setRowId(i);
return this.columnarRow;
ColumnarRow copy = this.columnarRow.copy();
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't need to introduce this copy, just:

    private final VectorizedColumnBatch batch;

    public OrcRowColumnVector(StructColumnVector hiveVector, RowType type) {
        super(hiveVector);
        int len = hiveVector.fields.length;
        ColumnVector[] paimonVectors = new ColumnVector[len];
        for (int i = 0; i < len; i++) {
            paimonVectors[i] = createPaimonVector(hiveVector.fields[i], type.getTypeAt(i));
        }
        this.batch = new VectorizedColumnBatch(paimonVectors);
    }

    @Override
    public ColumnarRow getRow(int i) {
        return new ColumnarRow(batch, i);
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @JingsongLi .

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit 5f90cc9 into apache:master Nov 22, 2023
@zhuangchong zhuangchong deleted the fix-columnar-array branch November 22, 2023 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] after compactioned the array elements are duplicated
2 participants