FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-816: Presize JsonStringArrayList vector results by schlosna · Pull Request #817 · apache/arrow-java · GitHub

GH-816: Presize JsonStringArrayList vector results - #817

Merged
lidavidm merged 3 commits into
apache:mainfrom
schlosna:ds/presize-JsonStringArrayList
Aug 13, 2025
Merged

GH-816: Presize JsonStringArrayList vector results#817
lidavidm merged 3 commits into
apache:mainfrom
schlosna:ds/presize-JsonStringArrayList

Conversation

Copy link
Copy Markdown
Contributor

What's Changed

Presize JsonStringArrayLists when constructing them as part of ValueVector#getObject conversions.

FixedSizeListVector#getObject already performs this optimization; however, ListVector, ListViewVector, LargeListVector, and LargeListViewVector do not yet presize the result JsonStringArrayList requiring dynamic reallocations as elements are converted & added. This can become a scalability bottleneck when using these types.

Closes #816.

lidavidm changed the title Presize JsonStringArrayList vector results GH-816: Presize JsonStringArrayList vector results Aug 11, 2025

Copy link
Copy Markdown
Member

Looks like the formatter isn't happy:

 Error:  Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.4:check (spotless-check) on project arrow-vector: The following files had format violations:
Error:      src/main/java/org/apache/arrow/vector/complex/LargeListVector.java
Error:          @@ -865,7 +865,8 @@
Error:           ····final·long·start·=·offsetBuffer.getLong((long)·index·*·OFFSET_WIDTH);
Error:           ····final·long·end·=·offsetBuffer.getLong(((long)·index·+·1L)·*·OFFSET_WIDTH);
Error:           ····final·ValueVector·vv·=·getDataVector();
Error:          -····final·List<Object>·vals·=·new·JsonStringArrayList<>(LargeMemoryUtil.checkedCastToInt(end·-·start));
Error:          +····final·List<Object>·vals·=
Error:          +········new·JsonStringArrayList<>(LargeMemoryUtil.checkedCastToInt(end·-·start));
Error:           ····for·(long·i·=·start;·i·<·end;·i++)·{
Error:           ······vals.add(vv.getObject(checkedCastToInt(i)));
Error:           ····}
Error:  Run 'mvn spotless:apply' to fix these violations.

Copy link
Copy Markdown
Member

There's more formatting errors than just that. Can you mvn spotless:apply?

Copy link
Copy Markdown
Contributor Author

There's more formatting errors than just that. Can you mvn spotless:apply?

Thanks for the quick review. Apologies about the format issue, I had tried to fix up while mobile. I've run mvn spotless:apply & pushed.

lidavidm merged commit 52f7a86 into apache:main Aug 13, 2025
30 of 36 checks passed
schlosna deleted the ds/presize-JsonStringArrayList branch August 15, 2025 22:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Performance: Presize JsonStringArrayList vector results

2 participants


Back | FazBrowse Home | New Git URL