Skip to content

chore: implment write insert logic #93

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

Merged
merged 1 commit into from
Aug 24, 2023
Merged

Conversation

mnorbury
Copy link
Collaborator

refs: #85

@mnorbury mnorbury force-pushed the chore/add-write-insert-logic branch from b46b17e to 3051991 Compare August 24, 2023 07:58
try (ArrowStreamReader reader =
new ArrowStreamReader(byteString.newInput(), bufferAllocator)) {
VectorSchemaRoot vectorSchemaRoot = reader.getVectorSchemaRoot();
reader.loadNextBatch();
Copy link
Member

Choose a reason for hiding this comment

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

I think we would need to loop on loadNextBatch until it returns false, see https://arrow.apache.org/docs/java/reference/org/apache/arrow/vector/ipc/ArrowStreamReader.html#loadNextBatch--

Though maybe not an issue at the moment since we always send a single record batch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently the method signature implies only a single item Resource decodeResource(ByteString byteString), do you think I should generalise this to a list?

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep it as is for now and change it if we run into issues

@@ -61,6 +59,9 @@ public UUIDVector(String name, BufferAllocator allocator, FixedSizeBinaryVector

@Override
public Object getObject(int index) {
if (getUnderlyingVector().isSet(index) == 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Nice

if (description != null) {
tableBuilder.description(description);
}
Table.builder()
Copy link
Member

Choose a reason for hiding this comment

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

Nice 👍

@mnorbury mnorbury marked this pull request as ready for review August 24, 2023 08:10
@mnorbury mnorbury merged commit b2dfcd8 into main Aug 24, 2023
@mnorbury mnorbury deleted the chore/add-write-insert-logic branch August 24, 2023 08:15
@@ -105,6 +105,9 @@ public static Scalar<?> fromArrowType(ArrowType arrowType) {
case Duration -> {
return new Duration();
}
case List -> {
return new JSON();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For now we will map arrow types of List to the JSON extension type.

try (ArrowStreamReader reader =
new ArrowStreamReader(byteString.newInput(), bufferAllocator)) {
VectorSchemaRoot vectorSchemaRoot = reader.getVectorSchemaRoot();
reader.loadNextBatch();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently the method signature implies only a single item Resource decodeResource(ByteString byteString), do you think I should generalise this to a list?

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.

2 participants