Skip to content

Commit

Permalink
fix: Ensure that schema metadata is always present even if empty (#591)
Browse files Browse the repository at this point in the history
An absent Schema.custom_metadata was causing flatcc to produce invalid
flatbuffers on s390x. For now, just populate that field with an empty
vector
  • Loading branch information
bkietz authored Aug 22, 2024
1 parent 67476e9 commit 31feee9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nanoarrow/ipc/encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,13 @@ static ArrowErrorCode ArrowIpcEncodeSchema(flatcc_builder_t* builder,
&ns(Schema_fields_push_end), error));
FLATCC_RETURN_UNLESS_0(Schema_fields_end(builder), error);

FLATCC_RETURN_UNLESS_0(Schema_custom_metadata_start(builder), error);
if (schema->metadata) {
FLATCC_RETURN_UNLESS_0(Schema_custom_metadata_start(builder), error);
NANOARROW_RETURN_NOT_OK(
ArrowIpcEncodeMetadata(builder, schema, &ns(Schema_custom_metadata_push_start),
&ns(Schema_custom_metadata_push_end), error));
FLATCC_RETURN_UNLESS_0(Schema_custom_metadata_end(builder), error);
}
FLATCC_RETURN_UNLESS_0(Schema_custom_metadata_end(builder), error);

FLATCC_RETURN_UNLESS_0(Schema_features_start(builder), error);
FLATCC_RETURN_UNLESS_0(Schema_features_end(builder), error);
Expand Down

0 comments on commit 31feee9

Please sign in to comment.