Skip to content

Keyed join with empty data.table and roll='nearest' segfaults #4499

@tlapak

Description

@tlapak

Somewhat related to #4060 in appearance but crashes on all versions of R. Different mechanism, similar appearance. Found this while working on amending #4272. I'll submit a fix soon (hopefully). Should I put it in with #4272 or submit a separate PR? These are all related in that they are triggered by passing zero length icols/xcols to Cbmerge.

I'm not a hundred percent on what this should do, but I'd suggest to have it behave the same way for all values of roll.

DT = data.table(A="a", key="A")
DT[data.table(), roll = 'nearest']  # Will segfault
# Proposed return Value == DT[0]:
# Empty data.table (0 rows and 1 cols): A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions