You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Todd Farmer (Jira)" <ji...@apache.org> on 2022/09/28 16:51:00 UTC

[jira] [Commented] (ARROW-14138) [R] update metadata when casting a record batch column

    [ https://issues.apache.org/jira/browse/ARROW-14138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17610654#comment-17610654 ] 

Todd Farmer commented on ARROW-14138:
-------------------------------------

This issue was last updated over 90 days ago, which may be an indication it is no longer being actively worked. To better reflect the current state, the issue is being unassigned per [project policy|https://arrow.apache.org/docs/dev/developers/bug_reports.html#issue-assignment]. Please feel free to re-take assignment of the issue if it is being actively worked, or if you plan to start that work soon.

> [R] update metadata when casting a record batch column
> ------------------------------------------------------
>
>                 Key: ARROW-14138
>                 URL: https://issues.apache.org/jira/browse/ARROW-14138
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: R
>            Reporter: Romain Francois
>            Assignee: Romain Francois
>            Priority: Minor
>             Fix For: 10.0.0
>
>
> library(arrow, warn.conflicts = FALSE)
> #> See arrow_info() for available features
> raws <- structure(list(
>   as.raw(c(0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e))
> ), class = c("arrow_binary", "vctrs_vctr", "list"))
> batch <- record_batch(b = raws)
> batch$metadata$r
> #>  'arrow_r_metadata' chr "A\n3\n262147\n197888\n5\nUTF-8\n531\n1\n531\n1\n531\n2\n531\n1\n16\n3\n262153\n12\narrow_binary\n262153\n10\nvc"| __truncated__
> #> List of 1
> #>  $ columns:List of 1
> #>   ..$ b:List of 2
> #>   .. ..$ attributes:List of 1
> #>   .. .. ..$ class: chr [1:3] "arrow_binary" "vctrs_vctr" "list"
> #>   .. ..$ columns   : NULL
> # when casting `b` to a string column, the metadata is kept
> batch$b <- batch$b$cast(utf8())
> batch$metadata$r
> #>  'arrow_r_metadata' chr "A\n3\n262147\n197888\n5\nUTF-8\n531\n1\n531\n1\n531\n2\n531\n1\n16\n3\n262153\n12\narrow_binary\n262153\n10\nvc"| __truncated__
> #> List of 1
> #>  $ columns:List of 1
> #>   ..$ b:List of 2
> #>   .. ..$ attributes:List of 1
> #>   .. .. ..$ class: chr [1:3] "arrow_binary" "vctrs_vctr" "list"
> #>   .. ..$ columns   : NULL
> # but it should not have
> batch2 <- record_batch(b = "string")
> batch2$metadata$r
> #> NULL



--
This message was sent by Atlassian Jira
(v8.20.10#820010)