You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "thisisnic (via GitHub)" <gi...@apache.org> on 2023/04/11 10:34:25 UTC

[GitHub] [arrow] thisisnic opened a new issue, #35035: [R] Implement `names<-` for Schemas

thisisnic opened a new issue, #35035:
URL: https://github.com/apache/arrow/issues/35035

   ### Describe the enhancement requested
   
   We occasionally have requests relating to updating schemas and we could make them easier to work with.  We could implement the S3 method `names<-` for Schema object, to enable users to be able to do something like:
   
   ```
   my_schema <- schema(x = int8(), y = string())
   names(my_schema) <- c("y", "x")
   ```
   The specific use-case I'm thinking about here is when a user wants to read a schema from a source, update it, and then re-use it to read/write.
   
   ### Component(s)
   
   R


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] nealrichardson commented on issue #35035: [R] Implement `names<-` for Schemas

Posted by "nealrichardson (via GitHub)" <gi...@apache.org>.
nealrichardson commented on issue #35035:
URL: https://github.com/apache/arrow/issues/35035#issuecomment-1503577443

   There is a `Schema->WithNames()` method you could add bindings for: https://github.com/apache/arrow/blob/main/cpp/src/arrow/type.h#L2003
   
   Note that the C++ function doesn't seem to preserve schema metadata: https://github.com/apache/arrow/blob/main/cpp/src/arrow/type.cc#L1741-L1754
   
   So you will either need to modify the function there to forward the metadata, or handle it yourself. (And for `metadata$r`, you may want to update column names referenced in that to point to the new names, so it may just be something to handle on the R side anyway.)


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic closed issue #35035: [R] Implement `names<-` for Schemas

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic closed issue #35035: [R] Implement `names<-` for Schemas
URL: https://github.com/apache/arrow/issues/35035


-- 
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: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org