Skip to content

GH-40933: [Java] Enhance the copyFrom* functionality in StringView - #41752

Merged
lidavidm merged 7 commits into
apache:mainfrom
vibhatha:stringview-copy
May 25, 2024
Merged

lidavidm merged 7 commits into
apache:mainfrom
vibhatha:stringview-copy

Conversation

@vibhatha

@vibhatha vibhatha commented May 21, 2024 •

Copy link
Copy Markdown
Contributor

Rationale for this change

Initial implementation of StringView doesn't contain copy functionality. This PR adds that feature.

What changes are included in this PR?

This PR adds copyFrom and copyFromSafe functions to BaseVariableWidthViewVector.

Are these changes tested?

Yes

Are there any user-facing changes?

No

@vibhatha

Copy link
Copy Markdown
Contributor Author

@lidavidm should we also include test cases for ViewVarBinary ? Though the copy functions are implemented in the base class.

@lidavidm

Copy link
Copy Markdown
Member

We should test both types yes

@vibhatha
vibhatha marked this pull request as ready for review May 22, 2024 00:32
@vibhatha
vibhatha requested a review from lidavidm as a code owner May 22, 2024 00:32
@vibhatha

Copy link
Copy Markdown
Contributor Author

@lidavidm this PR is ready for review.

Comment on lines 1558 to 1565

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.

Can we avoid reflection and just parameterize with the instance instead of the class?

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.

Yes definitely. It looks cool, but unreadable at the same time ;)

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels May 22, 2024

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.

typo fixed here.

@github-actions github-actions Bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels May 22, 2024

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.

@lidavidm If we take instances, then we have a bit of a hard time deallocating memory. Rather I used the types, is this okay?

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.

Just use factory functions?

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.

I updated. Is it as expected?

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.

No, you want something like Function<BufferAllocator, BaseVariableWidthViewVector>.

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.

I updated. Does it look okay?

@vibhatha
vibhatha requested a review from lidavidm May 22, 2024 08:18
@github-actions github-actions Bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting change review Awaiting change review awaiting changes Awaiting changes labels May 23, 2024

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.

No, so: why not just directly have the Function be the parameter? Instead of bouncing through the type? We never use type in the actual tests.

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.

Ah right. I updated.

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.

Resolving conflicts...

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.

Done!

@vibhatha
vibhatha requested a review from lidavidm May 24, 2024 08:14
@lidavidm
lidavidm merged commit 54dfb82 into apache:main May 25, 2024
@lidavidm lidavidm removed the awaiting change review Awaiting change review label May 25, 2024
@github-actions github-actions Bot added the awaiting merge Awaiting merge label May 25, 2024
vibhatha added a commit to vibhatha/arrow that referenced this pull request May 25, 2024
…iew (apache#41752)

### Rationale for this change

Initial implementation of StringView doesn't contain `copy` functionality. This PR adds that feature. 

### What changes are included in this PR?

This PR adds `copyFrom` and `copyFromSafe` functions to `BaseVariableWidthViewVector`. 

### Are these changes tested?

Yes

### Are there any user-facing changes?

No
* GitHub Issue: apache#40933

Lead-authored-by: Vibhatha Abeykoon <vibhatha@gmail.com>
Co-authored-by: Vibhatha Lakmal Abeykoon <vibhatha@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 54dfb82.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 11 possible false positives for unstable benchmarks that are known to sometimes produce them.

pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
…iew (apache#41752)

### Rationale for this change

Initial implementation of StringView doesn't contain `copy` functionality. This PR adds that feature. 

### What changes are included in this PR?

This PR adds `copyFrom` and `copyFromSafe` functions to `BaseVariableWidthViewVector`. 

### Are these changes tested?

Yes

### Are there any user-facing changes?

No
* GitHub Issue: apache#40933

Lead-authored-by: Vibhatha Abeykoon <vibhatha@gmail.com>
Co-authored-by: Vibhatha Lakmal Abeykoon <vibhatha@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
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.

2 participants