bit2swaz commented on issue #10679: URL: https://github.com/apache/arrow-rs/issues/10679#issuecomment-5338296121
the difference is what the spec says about each field. [`metadata`](https://arrow.apache.org/docs/format/CDataInterface.html#c.ArrowSchema.metadata) has a defined byte layout the producer must write, so `metadata()`https://github.com/apache/arrow-rs/blob/505afcbfd2c27897f747916e782d41e1593b7007/arrow-schema/src/ffi.rs#L403-L465 reading it is honoring the contract. it only breaks if the producer already broke the spec, like any ffi pointer [`private_data`](https://arrow.apache.org/docs/format/CDataInterface.html#c.ArrowSchema.private_data) is spec-defined as opaque to the consumer. `with_metadata` casts it to `SchemaPrivateData` and writes thru it which only holds for schemas arrow-rs built. thats UB on a well formed foreign schema with no bad producer needed bounding the length reads in `metadata()` is still worth doing, just separate from this do you see `metadata()` as the same bucket or does that line hold? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
