Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1731124 Arrow batches fields #1925

Open
wants to merge 41 commits into
base: SNOW-873466-arrow-batches
Choose a base branch
from

Conversation

sfc-gh-astachowski
Copy link
Collaborator

Overview

Added creation of Fields matching original vectors' fields. This concerns mainly nullability of vectors.

…e-types

# Conflicts:
#	src/main/java/net/snowflake/client/core/arrow/fullvectorconverters/SimpleArrowFullVectorConverter.java
…e-types

# Conflicts:
#	src/main/java/net/snowflake/client/core/arrow/fullvectorconverters/ArrowFullVectorConverter.java
#	src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java
…stamps

# Conflicts:
#	src/main/java/net/snowflake/client/core/arrow/fullvectorconverters/ArrowFullVectorConverter.java
# Conflicts:
#	src/main/java/net/snowflake/client/core/arrow/fullvectorconverters/ArrowFullVectorConverterUtil.java
#	src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java
#	src/test/java/net/snowflake/client/jdbc/ArrowBatchesIT.java
# Conflicts:
#	src/main/java/net/snowflake/client/core/arrow/fullvectorconverters/ArrowFullVectorConverterUtil.java
#	src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java
#	src/test/java/net/snowflake/client/jdbc/ArrowBatchesIT.java
@@ -58,8 +65,7 @@ protected FieldVector convertVector()
FieldVector convertedDataVector =
ArrowFullVectorConverterUtil.convert(
allocator, dataVector, context, session, timeZoneToUse, 0, valueTargetType);
// TODO: change to convertedDataVector and make all necessary changes to make it work
ListVector convertedListVector = initVector(vector.getName(), dataVector.getField());
ListVector convertedListVector = initVector(vector.getName(), convertedDataVector.getField());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the line that required the whole change - if we don't keep nullability properly, mapVector will complain about it's grandchildren being nullable. As the grandchildren may be of any type, all converters were affected.

Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add some tests to show the improvement

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a unit test checking if FieldTypes behave as expected when converting a MapVector

@sfc-gh-astachowski sfc-gh-astachowski marked this pull request as ready for review October 22, 2024 04:57
@sfc-gh-astachowski sfc-gh-astachowski requested a review from a team as a code owner October 22, 2024 04:57
@@ -58,8 +65,7 @@ protected FieldVector convertVector()
FieldVector convertedDataVector =
ArrowFullVectorConverterUtil.convert(
allocator, dataVector, context, session, timeZoneToUse, 0, valueTargetType);
// TODO: change to convertedDataVector and make all necessary changes to make it work
ListVector convertedListVector = initVector(vector.getName(), dataVector.getField());
ListVector convertedListVector = initVector(vector.getName(), convertedDataVector.getField());
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add some tests to show the improvement

@sfc-gh-astachowski sfc-gh-astachowski changed the title Arrow batches fields SNOW-1731124 Arrow batches fields Nov 4, 2024
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.

3 participants