-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
b46b17e
to
3051991
Compare
try (ArrowStreamReader reader = | ||
new ArrowStreamReader(byteString.newInput(), bufferAllocator)) { | ||
VectorSchemaRoot vectorSchemaRoot = reader.getVectorSchemaRoot(); | ||
reader.loadNextBatch(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
@@ -105,6 +105,9 @@ public static Scalar<?> fromArrowType(ArrowType arrowType) { | |||
case Duration -> { | |||
return new Duration(); | |||
} | |||
case List -> { | |||
return new JSON(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?
refs: #85