In Degrees All
SQL function: cugraph_in_degrees_all
Compute in-degree for every vertex.
Signature
cugraph_in_degrees_all(table_name [, src_col, dst_col [, weight_col [, options_json]]])
Allowed argument counts: 1, 3, 4, 5.
Quickstart
SELECT * FROM cugraph_in_degrees_all('target_edges')
Positional arguments
| Argument | Type | Required | Default | Notes |
|---|---|---|---|---|
table_name | Utf8 | yes | ||
src_col | Utf8 | no | src | |
dst_col | Utf8 | no | dst | |
weight_col | Utf8|null | no | accepted as an edge-column binding; native algorithm execution does not consume weights; semantic effect: none for this algorithm | |
options_json | Utf8 | no |
JSON options
This algorithm has no algorithm-specific options.
Graph construction options
Shared by all cuGraph functions, shown here with this function's defaults. The construction_policy option controls whether Nexus requests Python cuGraph-compatible edge normalization or bypasses it for raw libcugraph-style construction; see graph construction options for the full policy guide.
| Option | Type | Default | Constraints | Description |
|---|---|---|---|---|
construction_policy | Utf8 | "python_cugraph" | one of "python_cugraph", "raw_libcugraph" | Edge-list construction semantics used before calling libcugraph. |
directed | Boolean | true | Whether graph construction treats edges as directed. | |
renumber | Boolean | true | Whether graph construction may renumber external vertex identifiers internally. |
Output schema
| Column | Type | Nullable | Description |
|---|---|---|---|
vertex | Int64 | no | Vertex whose in-degree count is reported. |
in_degree | Int64 | no | Number of incoming edges for the vertex. |
These are the generic registry schemas. Run cugraph_validate_call for the concrete, table-specific output schema of a particular call.
Examples
This example runs on the citation network demo dataset.
In-graph citations vs. what the metadata claims
papers.n_citation is AMiner's global citation count; in_degree counts
only edges present in this corpus. Joining the two measures how much of each
paper's audience lies outside the dataset:
SELECT p.year, d.in_degree AS in_graph, p.n_citation AS reported,
p.n_citation - d.in_degree AS outside,
p.title AS paper
FROM cugraph_in_degrees_all('citation_edges', 'src', 'dst') d
JOIN papers p ON p.paper_id = d.vertex
ORDER BY d.in_degree DESC
LIMIT 5;
| year | in_graph | reported | outside | paper |
|---|---|---|---|---|
| 2004 | 22,892 | 35,541 | 12,649 | Distinctive Image Features from Scale-Invariant Keypoints |
| 2011 | 19,662 | 31,047 | 11,385 | LIBSVM: A library for support vector machines |
| 1989 | 17,207 | 44,175 | 26,968 | Genetic algorithms in search, optimization, and machine learning |
| 1996 | 16,579 | 42,437 | 25,858 | Fuzzy sets |
| 2001 | 15,048 | 34,741 | 19,693 | Random Forests |
SIFT is the most-cited paper within the corpus. Older cross-disciplinary classics (genetic algorithms, fuzzy sets) show the biggest gap — more than half their citations come from fields this CS-centric corpus doesn't cover.
Limitations & notes
- dry-run validates table resolution, column presence, static dtypes, and options only
- dry-run does not scan edge data, construct a graph, or prove source-vertex existence
Validate before running
Always dry-run a call before executing it. Validation checks the function, table, columns, dtypes, and options without touching the GPU:
SELECT * FROM cugraph_validate_call(
'cugraph_in_degrees_all',
'your_edges_table',
'{"src_col":"src","dst_col":"dst"}'
);
See Discovery & validation for the full cugraph_validate_call contract.