kentkwu opened a new issue, #333:
URL: https://github.com/apache/arrow-js/issues/333

   ### Describe the enhancement requested
   
   Manipulating field and schema metadata in the JS bindings currently requires 
manually constructing Map<string, string> instances and re-instantiating 
Field/Objects objects.
   
   Other Arrow implementations:
   
   - C++ 
[Field](https://github.com/apache/arrow/blob/main/cpp/src/arrow/type.cc#L308-L311)
 + 
[Schema](https://github.com/apache/arrow/blob/main/cpp/src/arrow/type.cc#L2465-L2468)
   
   - Rust 
[Field](https://docs.rs/arrow-schema/57.0.0/src/arrow_schema/field.rs.html#366-369)
 + 
[Schema](https://docs.rs/arrow-schema/57.0.0/src/arrow_schema/schema.rs.html#244-246))
   
   expose a helper that replaces a field/schema’s metadata map (and accepts 
null/None to clear it).
   
   **Request**
   
   Add a `Field.withMetadata()`, and `Schema.withMetadata()` method that:
   
     - Accepts a `Map<string, string>`, a plain object `Record<string, 
string>`, or `null` (to clear metadata).
     - Returns a new Field with the supplied metadata (replacement semantics, 
not merging).
   
   This brings the JavaScript bindings in line with the existing 
C++/PyArrow/Rust APIs and makes metadata updates more ergonomic (and less 
error-prone).
   


-- 
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]

Reply via email to