Skip to content

Joins segfault when by not specified and not found in both #371

@otsaw

Description

@otsaw

Impossible joins fail gracefully if by is specified (although something like "Column not found" would be a better error message)

> left_join(data.frame(x=1:5), data.frame(y=1:5), by="x")
Error: index out of bounds
> left_join(data.frame(x=1:5), data.frame(y=1:5), by="y")
Error: index out of bounds

but segfault when it needs to be guessed.

> left_join(data.frame(x=1:5), data.frame(y=1:5))
Joining by: character(0)

 *** caught segfault ***
address (nil), cause 'memory not mapped'

Traceback:
 1: .Call("dplyr_left_join_impl", PACKAGE = "dplyr", x, y, by)
 2: left_join_impl(x, y, by)
 3: left_join.tbl_df(tbl_df(x), y, by = by, copy = copy, ...)
 4: left_join(tbl_df(x), y, by = by, copy = copy, ...)
 5: as.data.frame(left_join(tbl_df(x), y, by = by, copy = copy, ...))
 6: left_join.data.frame(data.frame(x = 1:5), data.frame(y = 1:5))
 7: left_join(data.frame(x = 1:5), data.frame(y = 1:5))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions