westonpace commented on issue #38837:
URL: https://github.com/apache/arrow/issues/38837#issuecomment-2125124495
> And just to be clear "up front" means at the start of the stream, not
per-batch, right?
Apologies if I am misunderstanding but, given David's point here, aren't we
talking about two different API calls? For example, from the perspective of
duckdb it is often something like (this is maybe over-simplifying things)...
```
left_stats = get_statistics(left_table.join_id, filter)
right_stats = get_statistics(right_table.join_id, filter)
if left_stats.approx_count_distinct < right_stats.approx_count_distinct:
hashtable = make_hashtable(load_array(left_table.join_id))
probe(hashtable, right_table)
else:
hashtable = make_hashtable(load_array(right_table.join_id))
probe(hashtable, left_table)
```
In other words, first I get the statistics (and no data), then I do some
optimization / calculation with the statistics, and then I might choose to
actually load the data.
If these are two separate API calls then the statistics are just another
record batch. What is the advantage of making a single stream / message that
contains both data and statistics?
--
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]