cuGraph SQL API
DataFusion Nexus exposes NVIDIA RAPIDS cuGraph algorithms as SQL table
functions over its Flight SQL server. Each cugraph_* function reads an edge
relation, builds a GPU graph, runs an algorithm, and returns rows you can
compose with ordinary SQL.
This section is the self-describing contract for discovering and calling those functions — the same metadata an agent reads at runtime, rendered for humans.
The call convention
Every algorithm follows one positional shape:
cugraph_<algorithm>(table_name [, src_col, dst_col [, weight_col [, options_json]]])
table_name— an edge relation (a registered table or view of edges).src_col/dst_col— endpoint columns; default tosrc/dst.weight_col— optional edge weight column. Whether it affects results depends on the algorithm's weight policy (see the cheat sheet below).options_json— a JSON string of algorithm and graph options.
A few functions take extra positional arguments (for example, cugraph_bfs
takes a source vertex); see each function's page for its exact signature.
Algorithm families
- Centrality — importance scores (PageRank, eigenvector, Katz, HITS, betweenness).
- Community Detection — partition vertices into communities (Louvain, Leiden, ECG, spectral).
- Traversal & Paths — BFS and single-source shortest paths.
- Connectivity — connected components and minimum spanning tree.
- Structure — degrees, triangles, core numbers, k-core.
- Layout — 2-D layout coordinates.
Recommended workflow
- List —
cugraph_list_algorithms()to find enabled functions. - Describe —
cugraph_describe_algorithm('<fn>', 'verbose')for arguments, options, schemas, and limitations. - Validate —
cugraph_validate_call('<fn>', '<table>', '<call_json>')to statically check a call. - Execute — run the call once validation returns
valid = true.
See Discovery & validation for details, and Connecting to start a server and client.
All functions at a glance
| Algorithm | SQL function | Family | Source policy | Weight policy | Output kind | Options | Summary |
|---|---|---|---|---|---|---|---|
| Balanced Cut Clustering | cugraph_balanced_cut_clustering | Community Detection | none | ignored | fixed | many | Cluster vertices with balanced-cut spectral clustering. |
| Betweenness Centrality | cugraph_betweenness_centrality | Centrality | none | ignored | fixed | many | Compute exact or explicitly seeded/k-sampled approximate betweenness centrality scores. |
| BFS | cugraph_bfs | Traversal & Paths | required_scalar_or_list_or_relation | ignored | default_mode | rich | Multi-source-capable breadth-first search; source selectors must contain at most one source per connected component. |
| Core Number | cugraph_core_number | Structure | none | ignored | fixed | few | Compute graph core numbers. |
| Degrees All | cugraph_degrees_all | Structure | none | ignored | fixed | none | Compute in-degree and out-degree for every vertex. |
| ECG | cugraph_ecg | Community Detection | none | ignored | fixed | many | Detect communities with ensemble clustering for graphs. |
| Edge Betweenness Centrality | cugraph_edge_betweenness_centrality | Centrality | none | ignored | fixed | few | Compute exact or explicitly seeded/k-sampled approximate edge betweenness centrality scores. |
| Eigenvector Centrality | cugraph_eigenvector_centrality | Centrality | none | ignored | fixed | few | Compute eigenvector centrality scores. |
| ForceAtlas2 | cugraph_force_atlas2 | Layout | none | optional | fixed | many | Compute ForceAtlas2 two-dimensional layout coordinates. |
| HITS | cugraph_hits | Centrality | none | ignored | fixed | few | Compute HITS hub and authority scores. |
| In Degrees All | cugraph_in_degrees_all | Structure | none | ignored | fixed | none | Compute in-degree for every vertex. |
| K-Core | cugraph_k_core | Structure | none | ignored | fixed | few | Return the graph k-core edge set. |
| Katz Centrality | cugraph_katz_centrality | Centrality | none | ignored | fixed | few | Compute Katz centrality scores. |
| Leiden | cugraph_leiden | Community Detection | none | ignored | fixed | few | Detect communities with Leiden optimization. |
| Louvain | cugraph_louvain | Community Detection | none | ignored | fixed | few | Detect communities with Louvain modularity optimization. |
| Minimum Spanning Tree | cugraph_minimum_spanning_tree | Connectivity | none | required | fixed | none | Compute a minimum spanning tree. |
| Out Degrees All | cugraph_out_degrees_all | Structure | none | ignored | fixed | none | Compute out-degree for every vertex. |
| PageRank | cugraph_pagerank | Centrality | none | optional | fixed | few | Compute PageRank scores. |
| Personalized PageRank | cugraph_personalized_pagerank | Centrality | none | optional | fixed | many | Compute personalized PageRank scores. |
| Spectral Modularity Maximization | cugraph_spectral_modularity_maximization | Community Detection | none | ignored | fixed | many | Cluster vertices with spectral modularity maximization. |
| SSSP | cugraph_sssp | Traversal & Paths | required_scalar | optional | fixed | few | Compute single-source shortest paths. |
| Strongly Connected Components | cugraph_strongly_connected_components | Connectivity | none | ignored | fixed | none | Compute strongly connected components. |
| Triangle Count All | cugraph_triangle_count_all | Structure | none | ignored | fixed | none | Compute triangle counts for every vertex. |
| Weakly Connected Components | cugraph_weakly_connected_components | Connectivity | none | ignored | fixed | none | Compute weakly connected components. |