Skip to content

[FEA] Add overloads for row comparator that automatically handle comparisons between rows of a table with a scalar #10892

Open

Description

@ttnghia

Sometimes, we want to compare rows of a table with a single element given as a scalar. In order to do that, at the caller site, we have to convert the scalar into a column of one row, then convert that column into a table, then pass both tables into the comparator. This is repetitive and tedious.

We should add overloads for the row comparator that can automatically do this. The caller just needs to pass in the input table and input scalar.

Activity

  1. added
    feature request
    Needs Triage
    on May 19, 2022
  2. ttnghia commented on May 19, 2022

    @ttnghia
    ContributorAuthor

    Reference: #10883 (comment)

  3. added
    libcudf
    on May 19, 2022
  4. ttnghia commented on May 19, 2022

    @ttnghia
    ContributorAuthor

    This issue depends on #10893

  5. github-actions commented on Jun 18, 2022

    @github-actions

    This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

  6. removed
    Needs Triage
    on Jun 29, 2022
  7. bdice commented on Aug 16, 2022

    @bdice
    Contributor

    This should be worked on. Without a comparator for tables/columns and scalars, lifetime management of a column derived from the scalar gets very awkward. https://github.com/rapidsai/cudf/blob/ee15d1c10b51169abe26b1fa052ae568296696d5/cpp/src/lists/contains.cu#L251-L268

    I commented here:
    https://github.com/rapidsai/cudf/pull/10548/files#r946174668

    Upon further investigation: the current state is quite yucky, with lifetime management for one code path but not the other. We should be able to handle this a different way, by making a comparator that accepts a scalar, owns the temporary column, and accepts one index (for the column/table input). Centralizing lifetime management in the comparator has been part of our existing designs, so that's probably good to continue.
    There aren't a lot of alternatives I can see without improving this at the comparator level, but it's pretty gross in the current state.

  8. ttnghia commented on Aug 16, 2022

    @ttnghia
    ContributorAuthor

    Note that this issue is relevant not just for equality comparison but for lexicographic comparison. Usage of that case can be binary searching or many other comparison cases involving scalar.

  9. github-actions commented on Sep 16, 2022

    @github-actions

    This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestlibcudf

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions