You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "David Li (Jira)" <ji...@apache.org> on 2021/09/17 18:50:00 UTC

[jira] [Commented] (ARROW-14027) [R] Allow me to group_by + summarise() with partitioning fields

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

David Li commented on ARROW-14027:
----------------------------------

Here's the back of the traceback, which confirms it is an issue with a hash aggregate kernel not accounting for scalar inputs:
{noformat}
/home/lidavidm/Code/upstream/arrow-14027/cpp/src/arrow/util/variant.h:383:10: runtime error: reference binding to null pointer of type 'const struct shared_ptr'
    #0 0x7f37f2a3a792 in std::shared_ptr<arrow::ArrayData> const& arrow::util::get<std::shared_ptr<arrow::ArrayData>, arrow::Datum::Empty, std::shared_ptr<arrow::Scalar>, std::shared_ptr<arrow::ArrayData>, std::shared_ptr<arrow::ChunkedArray>, std::shared_ptr<arrow::RecordBatch>, std::shared_ptr<arrow::Table>, std::vector<arrow::Datum, std::allocator<arrow::Datum> > >(arrow::util::Variant<arrow::Datum::Empty, std::shared_ptr<arrow::Scalar>, std::shared_ptr<arrow::ArrayData>, std::shared_ptr<arrow::ChunkedArray>, std::shared_ptr<arrow::RecordBatch>, std::shared_ptr<arrow::Table>, std::vector<arrow::Datum, std::allocator<arrow::Datum> > > const&) (/home/lidavidm/Code/upstream/arrow-14027/install/lib/libarrow.so.600+0x45b0792)
    #1 0x7f37f2eea8cd in arrow::Datum::array() const /home/lidavidm/Code/upstream/arrow-14027/cpp/src/arrow/datum.h:191
    #2 0x7f37f369d2d3 in Consume /home/lidavidm/Code/upstream/arrow-14027/cpp/src/arrow/compute/kernels/hash_aggregate.cc:570
    #3 0x7f37f3381c35 in Consume /home/lidavidm/Code/upstream/arrow-14027/cpp/src/arrow/compute/exec/aggregate_node.cc:406
    #4 0x7f37f338517a in InputReceived /home/lidavidm/Code/upstream/arrow-14027/cpp/src/arrow/compute/exec/aggregate_node.cc:518
 {noformat}

> [R] Allow me to group_by + summarise() with partitioning fields 
> ----------------------------------------------------------------
>
>                 Key: ARROW-14027
>                 URL: https://issues.apache.org/jira/browse/ARROW-14027
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: R
>            Reporter: Jonathan Keane
>            Priority: Blocker
>             Fix For: 6.0.0
>
>
> If one puts a field that is one of the partitioning variables in {{group_by()}} and then summarises, we get a segfault:
> {code:r}
> library(arrow)
> library(dplyr)
> temp <- tempfile()
> write_dataset(mtcars, path = temp, partitioning = "cyl")
> ds <- open_dataset(temp)
> # this works just fine
> ds %>% 
>   group_by(gear) %>% 
>   summarise(
>     sum(mpg)
>   ) %>% 
>   collect()
> # however this segfaults (regardless of the aggregation, even simply n()) 
> #  *** caught segfault ***
> # address 0x0, cause 'memory not mapped'
> ds %>% 
>   group_by(cyl) %>% 
>   summarise(
>     sum(mpg)
>   ) %>% 
>   collect()
> {code}



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