NVIDIA / NVIDIA/cudf

[FEA] Enable join algorithm selection and expose OO join APIs in pylibcudf

Open
#19,172 4 comments 0 reactions 0 assignees View on GitHub
feature request libcudf pylibcudf Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

## Description: ##

With the recent addition of **sort-merge inner join** support in `libcudf` (see #18318), it would be useful for the Python API (`pylibcudf`) to expose an option allowing users to explicitly select the join algorithm—either **hash join** or **sort-merge join**—in applicable functions under the `pylibcudf.join` module.

Currently, the join algorithm is selected implicitly, and users have no control over which implementation is used.

---

## Proposed Enhancement: ##

Add a keyword argument such as `join_algorithm="hash"` or `join_algorithm="sort"` to `pylibcudf.join` functions. The default should preserve current behavior (which is assumed to be hash join).

---

## Motivation: ##

Providing algorithm selection is important for performance-sensitive workloads where one strategy may outperform the other based on data characteristics. For example:

- **Sort-merge join** can benefit from pre-sorted or partially sorted input data and is far more practical than **hash join** for range-based join conditions.

- **Hash join** is often faster for lower cardinality or high selectivity joins.

Though currently only inner sort-merge joins are supported, exposing the option now would align with future support for additional sort-merge join types (left, right, outer, etc.), ensuring a consistent and extensible API.

---

## Benefits: ##

- Enables reproducible benchmarks across join strategies.

- Offers fine-grained control to advanced users.

- Encourages broader adoption for performance-critical or research workflows.

---

### Related Issues: ###

Sort-merge join addition: #18318

Sort-merge join tracking/extension: #18533

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.