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

[C] SchemaSetType(MAP) should set entries/keys as non-nullable #106

Closed
lidavidm opened this issue Feb 13, 2023 · 0 comments · Fixed by #107
Closed

[C] SchemaSetType(MAP) should set entries/keys as non-nullable #106

lidavidm opened this issue Feb 13, 2023 · 0 comments · Fixed by #107
Assignees

Comments

@lidavidm
Copy link
Member

From apache/arrow-adbc#453

We should set it here (since the default is to make things nullable):

case NANOARROW_TYPE_MAP:
NANOARROW_RETURN_NOT_OK(ArrowSchemaAllocateChildren(schema, 1));
NANOARROW_RETURN_NOT_OK(
ArrowSchemaInitFromType(schema->children[0], NANOARROW_TYPE_STRUCT));
NANOARROW_RETURN_NOT_OK(ArrowSchemaSetName(schema->children[0], "entries"));
NANOARROW_RETURN_NOT_OK(ArrowSchemaAllocateChildren(schema->children[0], 2));
ArrowSchemaInit(schema->children[0]->children[0]);
ArrowSchemaInit(schema->children[0]->children[1]);
NANOARROW_RETURN_NOT_OK(
ArrowSchemaSetName(schema->children[0]->children[0], "key"));
NANOARROW_RETURN_NOT_OK(
ArrowSchemaSetName(schema->children[0]->children[1], "value"));
break;

SchemaViewValidateMap should also validate this

@lidavidm lidavidm self-assigned this Feb 13, 2023
lidavidm added a commit to lidavidm/arrow-nanoarrow that referenced this issue Feb 13, 2023
paleolimbot pushed a commit that referenced this issue Feb 14, 2023
@paleolimbot paleolimbot added this to the nanoarrow 0.1.0 milestone Feb 23, 2023
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 a pull request may close this issue.

2 participants