Skip to content

Conversation

@davisusanibar
Copy link
Contributor

To close #319

Due to the use of JShell to run cookbook, it is not possible to create packages to access package-private objects, such as the org.apache.arrow.vector.util package. Therefore, I am only adding the recipe as a code block.

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

If the utility is package-private, then it's not usable! File a PR upstream first to make it public and add tests.

@davisusanibar
Copy link
Contributor Author

If the utility is package-private, then it's not usable! File a PR upstream first to make it public and add tests.

Changed

@davisusanibar davisusanibar requested a review from lidavidm August 28, 2023 22:36
toAppend.setValueCount(4);
System.out.println("IntVector to Append: " + toAppend);
VectorAppender appenderUtil = new VectorAppender(initialValues);
ValueVector resultOfVectorsAppended = toAppend.accept(appenderUtil, null);
Copy link
Member

Choose a reason for hiding this comment

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

We don't need to close this? If it mutates the original vector, we should write it in a way that makes that clear

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have any ideas why the leak wasn't caught? Maybe this ValueVector is also deleted after the dependencies were closed?

Copy link
Member

Choose a reason for hiding this comment

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

probably because it mutates the original vector instead of allocating a new one...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added more detail

Copy link
Member

Choose a reason for hiding this comment

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

Just...don't use the return value.

Copy link
Member

Choose a reason for hiding this comment

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

Also given this was a private API before, I would prefer fixing upstream to just not return the vector

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated the recipe to not use the return value. It is necessary to analyze the change upstream to not return value since it is part of the Value Vector.

@lidavidm
Copy link
Member

lidavidm commented Sep 4, 2023

Can you rebase here?

@lidavidm

This comment was marked as resolved.

@lidavidm
Copy link
Member

lidavidm commented Sep 6, 2023

Oh, hmm, never mind that.

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.

[Java] Create a recipe for how to append field vectors as one

2 participants