cudf-cxx 0.3.1

cxx-based FFI bridge between Rust and NVIDIA libcudf C++ API
Documentation
//! Bridge definitions for libcudf join operations.
//!
//! Join functions return gather maps (index columns) that can be used
//! to construct the joined table via `gather()`.

#[cxx::bridge(namespace = "cudf_shims")]
pub mod ffi {
    unsafe extern "C++" {
        include!("join_shim.h");
        include!("table_shim.h");

        type OwnedTable = crate::table::ffi::OwnedTable;

        /// Inner join: returns a 2-column table [left_indices, right_indices].
        fn inner_join(
            left_keys: &OwnedTable,
            right_keys: &OwnedTable,
        ) -> Result<UniquePtr<OwnedTable>>;

        /// Left join: returns a 2-column table [left_indices, right_indices].
        fn left_join(
            left_keys: &OwnedTable,
            right_keys: &OwnedTable,
        ) -> Result<UniquePtr<OwnedTable>>;

        /// Full outer join: returns a 2-column table [left_indices, right_indices].
        fn full_join(
            left_keys: &OwnedTable,
            right_keys: &OwnedTable,
        ) -> Result<UniquePtr<OwnedTable>>;

        /// Cross join: cartesian product of two tables.
        fn cross_join(left: &OwnedTable, right: &OwnedTable) -> Result<UniquePtr<OwnedTable>>;

        /// Left semi join: returns a 1-column table [left_indices].
        /// Only left rows with a match in right are included.
        fn left_semi_join(
            left_keys: &OwnedTable,
            right_keys: &OwnedTable,
        ) -> Result<UniquePtr<OwnedTable>>;

        /// Left anti join: returns a 1-column table [left_indices].
        /// Only left rows with NO match in right are included.
        fn left_anti_join(
            left_keys: &OwnedTable,
            right_keys: &OwnedTable,
        ) -> Result<UniquePtr<OwnedTable>>;

        /// Mark semi join: returns a 1-column table [left_indices].
        /// The underlying libcudf mark_join builds from the left table.
        fn mark_semi_join(
            left_keys: &OwnedTable,
            right_keys: &OwnedTable,
        ) -> Result<UniquePtr<OwnedTable>>;

        /// Mark anti join: returns a 1-column table [left_indices].
        /// The underlying libcudf mark_join builds from the left table.
        fn mark_anti_join(
            left_keys: &OwnedTable,
            right_keys: &OwnedTable,
        ) -> Result<UniquePtr<OwnedTable>>;

        // ── Hash Join ─────────────────────────────────────────────

        /// Opaque hash join object (pre-hashed build table).
        type OwnedHashJoin;

        /// Create a hash join from the build (right) table keys.
        fn hash_join_create(build: &OwnedTable) -> Result<UniquePtr<OwnedHashJoin>>;

        /// Inner join via hash join, returning gather maps.
        fn hash_join_inner(hj: &OwnedHashJoin, probe: &OwnedTable)
        -> Result<UniquePtr<OwnedTable>>;

        /// Left join via hash join, returning gather maps.
        fn hash_join_left(hj: &OwnedHashJoin, probe: &OwnedTable) -> Result<UniquePtr<OwnedTable>>;

        /// Full outer join via hash join, returning gather maps.
        fn hash_join_full(hj: &OwnedHashJoin, probe: &OwnedTable) -> Result<UniquePtr<OwnedTable>>;

        /// Estimated output size for inner join.
        fn hash_join_inner_size(hj: &OwnedHashJoin, probe: &OwnedTable) -> Result<i64>;

        /// Estimated output size for left join.
        fn hash_join_left_size(hj: &OwnedHashJoin, probe: &OwnedTable) -> Result<i64>;

        /// Estimated output size for full join.
        fn hash_join_full_size(hj: &OwnedHashJoin, probe: &OwnedTable) -> Result<i64>;
    }
}