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

Weston Pace commented on ARROW-12873:
-------------------------------------

If we want strings would it be sufficient to be able to index node inputs / 
function inputs by name?  For example:

{code:cpp}
// In a node, retrieving inputs
auto group_ids = inputs_["group_ids_in"]
auto batch = inputs_["batch_in"]
{code}

{code:cpp}
// In a node, sending outputs
outputs["group_ids_out"]->InputReceived(this, seq, group_ids);
outputs["batch_out"]->InputReceived(this, seq, batch);
{code}

{code:cpp}
// Building the graph
// First argument is a vector of (input_name, node, output_name) for each input 
parameter
compute::MakeAggregateSumNode({{"group_ids_in", grouper, "group_ids_out"}, 
{"batch_in", grouper, "batch_out"}}, ...);
{code}

Then for compute functions you could do something like...

{code:cpp}
CallFunction("aggregate_sum", {{"batch", batch}, {"group_ids": group_ids}}, 
&options, ctx);
{code}

 

> [C++][Compute] Support tagging ExecBatches with arbitrary extra information
> ---------------------------------------------------------------------------
>
>                 Key: ARROW-12873
>                 URL: https://issues.apache.org/jira/browse/ARROW-12873
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Ben Kietzman
>            Priority: Major
>
> Ideally, ExecBatches could be tagged with arbitrary optional objects for 
> tracing purposes and to transmit execution hints from one ExecNode to another.
> These should *not* be explicit members like ExecBatch::selection_vector is, 
> since they may not originate from the arrow library. For an example within 
> the arrow project: {{libarrow_dataset}} will be used to produce ScanNodes and 
> a WriteNodes and it's useful to tag scanned batches with their {{Fragment}} 
> of origin. However adding {{ExecBatch::fragment}} would result in a cyclic 
> dependency.
> To facilitate this tagging capability, we would need a type erased container 
> something like
> {code}
> struct AnySet {
>   void* Get(tag_t tag);
>   void Set(tag_t tag, void* value, FnOnce<void(void*)> destructor);
> };
> {code}



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

Reply via email to