Skip to content

[row] improve test on VectorizedColumnBatch#1049

Merged
wuchong merged 1 commit into
apache:mainfrom
gyang94:issue-1048
Jun 14, 2025
Merged

[row] improve test on VectorizedColumnBatch#1049
wuchong merged 1 commit into
apache:mainfrom
gyang94:issue-1048

Conversation

@gyang94

@gyang94 gyang94 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #1048

Brief change log

Tests

API and Format

Documentation

@gyang94

gyang94 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor Author

@wuchong A quick question:
It will throw an exception when get the value in ColumnVector if the data is null. In my test I have to added if (!row.isNullAt(3)) to pre-check the null value. Is it the right way? suppose user should be able get the "null" value instead of an exception.
e.g. In the test case, the value of IntColumnVector is [3, null]. It throws an exception when calling IntColumnVector.getInt().

@wuchong

wuchong commented Jun 12, 2025

Copy link
Copy Markdown
Member

@gyang94 yes, it's by design. It's invalid to call getXxx(n) if it's null isNullAt(n), because many getXxx returns primitive types for better performance, avoiding boxing.

assertThat(row.getDouble(6)).isEqualTo(rowData.getDouble(6));
assertThat(row.getDecimal(7, 10, 3)).isEqualTo(rowData.getDecimal(7, 10, 3));
assertThat(row.getChar(8, 3)).isEqualTo(rowData.getChar(8, 3));
if (!row.isNullAt(9)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should check it's null for this position in rowData, if it's null in row.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please fix other nullable checks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

resolved

@wuchong wuchong merged commit 7f0292e into apache:main Jun 14, 2025
4 checks passed
ZmmBigdata pushed a commit to ZmmBigdata/fluss that referenced this pull request Jun 20, 2025
polyzos pushed a commit to polyzos/fluss that referenced this pull request Aug 30, 2025
polyzos pushed a commit to HZY-Wade/fluss that referenced this pull request Aug 31, 2025
Ugbot pushed a commit to Ugbot/fluss that referenced this pull request Apr 26, 2026
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.

Improve test coverage on VectorizedColumnBatch

2 participants