-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Java] MapVector cannot be loaded via IPC #42218
Comments
It seems that the validity buffer of the key is not properly written. It is all null. |
@llama90 this is a very older issue which I am trying to solve. |
@lidavidm a question: Field keyField = new Field("id", FieldType.notNullable(new ArrowType.Int(64, true)),
Collections.emptyList());
Field valueField = new Field("value", FieldType.nullable(new ArrowType.Int(64, true)), Collections.emptyList());
Field structField =
new Field("entry", FieldType.notNullable(ArrowType.Struct.INSTANCE), List.of(keyField, valueField));
Field mapIntToIntField = new Field("mapFieldIntToInt", FieldType.notNullable(new ArrowType.Map(false)), List.of(structField)); After debugging this is what I think is happening. We have given the key field a name But when we go for writing data
This is the regular check we have, and these In the reading part, it has an incorrect schema. Worse case is, we can get the schema from the vector itself, let's say. Then again we have 2 idle vectors in case users use different names. Shouldn't we update the |
We should get it from the vector, yes. They are recommended to be "key" and "value" but it is not meant to be required Lines 126 to 129 in d28078d
|
So fix it? Or enforce the key,value usage? |
Fix it, the spec says explicitly not to enforce key/value |
"this is not enforced" doesn't mean it's not assumed in a lot of places. It's one of these cases where in theory you can use any name, but in practice, there is a de-facto standard. Postel's Law applies, so we should advise users to avoid using different names while also making the official Arrow implementations robust (i.e. accepting of custom names). |
Describe the bug, including details regarding any error messages, version, and platform.
Referring to the stackoverflow filed issue: https://stackoverflow.com/questions/77878272/apache-arrow-not-all-nodes-and-buffers-were-consumed-error-when-writing-a-map
The following code would yield an error;
Error
Component(s)
Java
The text was updated successfully, but these errors were encountered: