Skip to main content

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 to src / 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.
  1. Listcugraph_list_algorithms() to find enabled functions.
  2. Describecugraph_describe_algorithm('<fn>', 'verbose') for arguments, options, schemas, and limitations.
  3. Validatecugraph_validate_call('<fn>', '<table>', '<call_json>') to statically check a call.
  4. 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

AlgorithmSQL functionFamilySource policyWeight policyOutput kindOptionsSummary
Balanced Cut Clusteringcugraph_balanced_cut_clusteringCommunity DetectionnoneignoredfixedmanyCluster vertices with balanced-cut spectral clustering.
Betweenness Centralitycugraph_betweenness_centralityCentralitynoneignoredfixedmanyCompute exact or explicitly seeded/k-sampled approximate betweenness centrality scores.
BFScugraph_bfsTraversal & Pathsrequired_scalar_or_list_or_relationignoreddefault_moderichMulti-source-capable breadth-first search; source selectors must contain at most one source per connected component.
Core Numbercugraph_core_numberStructurenoneignoredfixedfewCompute graph core numbers.
Degrees Allcugraph_degrees_allStructurenoneignoredfixednoneCompute in-degree and out-degree for every vertex.
ECGcugraph_ecgCommunity DetectionnoneignoredfixedmanyDetect communities with ensemble clustering for graphs.
Edge Betweenness Centralitycugraph_edge_betweenness_centralityCentralitynoneignoredfixedfewCompute exact or explicitly seeded/k-sampled approximate edge betweenness centrality scores.
Eigenvector Centralitycugraph_eigenvector_centralityCentralitynoneignoredfixedfewCompute eigenvector centrality scores.
ForceAtlas2cugraph_force_atlas2LayoutnoneoptionalfixedmanyCompute ForceAtlas2 two-dimensional layout coordinates.
HITScugraph_hitsCentralitynoneignoredfixedfewCompute HITS hub and authority scores.
In Degrees Allcugraph_in_degrees_allStructurenoneignoredfixednoneCompute in-degree for every vertex.
K-Corecugraph_k_coreStructurenoneignoredfixedfewReturn the graph k-core edge set.
Katz Centralitycugraph_katz_centralityCentralitynoneignoredfixedfewCompute Katz centrality scores.
Leidencugraph_leidenCommunity DetectionnoneignoredfixedfewDetect communities with Leiden optimization.
Louvaincugraph_louvainCommunity DetectionnoneignoredfixedfewDetect communities with Louvain modularity optimization.
Minimum Spanning Treecugraph_minimum_spanning_treeConnectivitynonerequiredfixednoneCompute a minimum spanning tree.
Out Degrees Allcugraph_out_degrees_allStructurenoneignoredfixednoneCompute out-degree for every vertex.
PageRankcugraph_pagerankCentralitynoneoptionalfixedfewCompute PageRank scores.
Personalized PageRankcugraph_personalized_pagerankCentralitynoneoptionalfixedmanyCompute personalized PageRank scores.
Spectral Modularity Maximizationcugraph_spectral_modularity_maximizationCommunity DetectionnoneignoredfixedmanyCluster vertices with spectral modularity maximization.
SSSPcugraph_ssspTraversal & Pathsrequired_scalaroptionalfixedfewCompute single-source shortest paths.
Strongly Connected Componentscugraph_strongly_connected_componentsConnectivitynoneignoredfixednoneCompute strongly connected components.
Triangle Count Allcugraph_triangle_count_allStructurenoneignoredfixednoneCompute triangle counts for every vertex.
Weakly Connected Componentscugraph_weakly_connected_componentsConnectivitynoneignoredfixednoneCompute weakly connected components.