MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / result_schema

Method result_schema

nodedb-graph/src/params.rs:90–111  ·  view source on GitHub ↗

Result column schema: `(column_name, column_type)`. Used by the Arrow result builder to construct RecordBatches and by the DDL layer to advertise result columns.

(&self)

Source from the content-addressed store, hash-verified

88 /// Used by the Arrow result builder to construct RecordBatches and by
89 /// the DDL layer to advertise result columns.
90 pub fn result_schema(&self) -> &'static [(&'static str, AlgoColumnType)] {
91 use AlgoColumnType::*;
92 match self {
93 Self::PageRank => &[("node_id", Text), ("rank", Float64)],
94 Self::Wcc => &[("node_id", Text), ("component_id", Int64)],
95 Self::LabelPropagation => &[("node_id", Text), ("community_id", Int64)],
96 Self::Lcc => &[("node_id", Text), ("coefficient", Float64)],
97 Self::Sssp => &[("node_id", Text), ("distance", Float64)],
98 Self::Betweenness => &[("node_id", Text), ("centrality", Float64)],
99 Self::Closeness => &[("node_id", Text), ("centrality", Float64)],
100 Self::Harmonic => &[("node_id", Text), ("centrality", Float64)],
101 Self::Degree => &[("node_id", Text), ("centrality", Float64)],
102 Self::Louvain => &[
103 ("node_id", Text),
104 ("community_id", Int64),
105 ("modularity", Float64),
106 ],
107 Self::Triangles => &[("node_id", Text), ("triangles", Int64)],
108 Self::Diameter => &[("diameter", Int64), ("radius", Int64)],
109 Self::KCore => &[("node_id", Text), ("coreness", Int64)],
110 }
111 }
112}
113
114/// Column type for algorithm result schemas.

Callers 7

result_schema_columnsFunction · 0.80
newMethod · 0.80
arrow_schemaMethod · 0.80
to_jsonMethod · 0.80
writeMethod · 0.80

Calls

no outgoing calls

Tested by 2

result_schema_columnsFunction · 0.64