You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Ben Kietzman (Jira)" <ji...@apache.org> on 2021/05/27 12:51:00 UTC

[jira] [Comment Edited] (ARROW-12890) Implement arrow::Table::clone() -> std::shared_ptr

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

Ben Kietzman edited comment on ARROW-12890 at 5/27/21, 12:50 PM:
-----------------------------------------------------------------

I'm guessing the motivation here is to create an instance of the table whose buffers etc can be safely mutated. Throughout the arrow library, we prefer to consider structures like Arrays and Tables sealed and immutable. So instead of cloning a Table and mutating the clone stylistically it'd be preferable to construct new tables. For example, if you wanted to mutate column "a" of a table by adding a constant to every element the arrow pattern would be to produce the new column, then construct a new Table with the new column "a" (shallow) copies of the previous table's columns "b", "c" 


was (Author: bkietz):
I'm guessing the motivation here is to create an instance of the table whose buffers etc can be safely mutated. Throughout the arrow library, we prefer to consider structures like Arrays and Tables sealed and immutable. So instead of cloning a Table and mutating the clone stylistically it'd be preferable to construct new tables. For example, if you wanted to mutate column "a" of a table by adding a constant to every element the arrow pattern would be to produce the new column, then construct a new Table with the new column "a" (shallow) copies of the previous table's columns "b", "c"  modified column inserted

> Implement arrow::Table::clone() -> std::shared_ptr<arrow::Table>
> ----------------------------------------------------------------
>
>                 Key: ARROW-12890
>                 URL: https://issues.apache.org/jira/browse/ARROW-12890
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>            Reporter: Percy Camilo TriveƱo Aucahuasi
>            Priority: Major
>
> Implement arrow::Table::clone() -> std::shared_ptr<arrow::Table>
> It should return a new instance (deep copy) of the arrow table data



--
This message was sent by Atlassian Jira
(v8.3.4#803005)