Skip to main content

cuGraph SQL API

Algeon exposes NVIDIA RAPIDS cuGraph algorithms as GPU UDTFs (user-defined table functions) over DataFusion SQL sessions. The session can run in a Rust process or be served through Flight SQL. Each cugraph_* UDTF reads an edge relation, builds a GPU graph, runs an algorithm, and returns rows you can compose with ordinary SQL. The cuGraph UDTFs index lists every function; Discover & Validate GPU UDTFs and the GPU UDTF Catalog API cover discovery and validation.

Questions to explore​

Each question opens a captured example on its UDTF page. The examples read the demo datasets. The MerRec queries ran over the full 1.27 billion events in native_required mode.

MerRec​

The MerRec investigation turns Mercari US likes and purchases from May through October 2023 into brand graphs:

Citation network​

DBLP / AMiner V12: 4.9M papers linked by 45.6M citations.

EMBER2024​

Win32 malware files from the challenge split, linked to the import symbols they share.

The remaining cuGraph pages, from degree counts to spectral clustering, read the citation network.

Use functions_only execution to keep scans and surrounding SQL on DataFusion CPU while graph algorithms run on GPU. The same page covers backend configuration and host staging limits.

Graph input and call shape​

Every cuGraph call uses named arguments. The required edges argument is a parenthesized relation subquery whose projection supplies canonical src and dst columns. Optional graph and algorithm values use the same named syntax:

SELECT *
FROM cugraph_pagerank(
edges => (SELECT src, dst, weight FROM citation_edges),
alpha => 0.9,
directed => true
);

Algorithms that need additional relations name them explicitly, for example personalization => (SELECT vertex, value FROM ppr_seeds) for personalized PageRank or vertex_pairs => (SELECT first, second FROM candidate_pairs) for similarity UDTFs. BFS source selectors and SSSP's source vertex are named value arguments as well. Each UDTF page gives the complete signature and the canonical columns required for every relation role.

Relation subqueries can read tables, views, CTEs, joins, and filters. Register a derived relation as a temporary view when it must also be checked through gpu_validate_call, because the metadata envelope resolves registered names and does not contain SQL text. See Integration for source and session setup, and Graph Inputs and Construction for vertex-ID contracts, directedness, vertex renumbering, and edge normalization.

The GPU table functions design traces cuDF edge ownership, cuGraph completion and the return to native SQL operators. It distinguishes device copies from host materialization.

Result column names​

Result columns follow one naming convention across UDTFs. The edge input columns (src, dst, weight, edge_id) are separate and keep their names.

ResultColumns
Vertex identityvertex
One score per vertexvalue
Edgesrc, dst, plus value for an edge score
Community assignmentcommunity
Connectivity labelcomponent
Vertex pair similarityfirst, second, similarity

Each UDTF page lists its exact result schema, including algorithm-specific columns such as hub_score and authority_score for HITS.

Reuse in bounded servers​

A bounded Flight SQL server can retain constructed graphs for repeat calls with a strongly identified, eligible input. The current reusable path covers BFS without include_edges, PageRank, Jaccard, Sorensen, Overlap, and Cosine. Other calls bypass the cache. Configure and observe it through Configuration.