Skip to content

Conversation

@ViggoC
Copy link
Contributor

@ViggoC ViggoC commented Oct 15, 2025

What's Changed

Implement Vector Validators for StringView.

Closes #109.

@github-actions

This comment has been minimized.

@lidavidm lidavidm added the enhancement PRs that add or improve features. label Oct 15, 2025
@github-actions github-actions bot added this to the 18.4.0 milestone Oct 15, 2025
Comment on lines 162 to 165
validateOrThrow(
vector.getValueCount() >= 0,
"Vector valueCount %s is negative.",
vector.getValueCapacity());
Copy link
Member

Choose a reason for hiding this comment

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

Can we use validateVectorCommon?

The comment in validateVectorCommon points back to #109. So I feel like figuring that out should be part of resolving the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do you think validateVectorCommon should be modified to support StringView? My idea is

if (vector instanceof BaseVariableWidthViewVector) {
      int typeBufferCount = TypeLayout.getTypeBufferCount(arrowType);
      validateOrThrow(
          fieldVector.getFieldBuffers().size() >= typeBufferCount,
          "Expected at least %s buffers in vector of type %s, got %s.",
          typeBufferCount,
          vector.getField().getType().toString(),
          fieldVector.getFieldBuffers().size());
} 

Copy link
Member

Choose a reason for hiding this comment

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

Roughly yes but I would prefer adding a TypeLayout.isVariableBuffer instead of hardcoding a type check

@lidavidm lidavidm merged commit c4d3c9e into apache:main Oct 29, 2025
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that add or improve features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Java] Implement Vector Validators for StringView

2 participants