MCPcopy Create free account
hub / github.com/apache/paimon-rust / list_all_ids

Method list_all_ids

crates/paimon/src/table/schema_manager.rs:84–100  ·  view source on GitHub ↗

List all schema ids sorted ascending. Returns an empty vector if the schema directory is missing or empty. Mirrors Java [SchemaManager.listAllIds()](https://github.com/apache/paimon/blob/release-1.3/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java).

(&self)

Source from the content-addressed store, hash-verified

82 ///
83 /// Mirrors Java [SchemaManager.listAllIds()](https://github.com/apache/paimon/blob/release-1.3/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java).
84 pub async fn list_all_ids(&self) -> crate::Result<Vec<i64>> {
85 let mut ids: Vec<i64> = self
86 .file_io
87 .list_status(&self.schema_directory())
88 .await?
89 .into_iter()
90 .filter(|s| !s.is_dir)
91 .filter_map(|s| {
92 get_basename(s.path.as_str())
93 .strip_prefix(SCHEMA_PREFIX)?
94 .parse::<i64>()
95 .ok()
96 })
97 .collect();
98 ids.sort_unstable();
99 Ok(ids)
100 }
101
102 /// List all schemas sorted by id ascending.
103 ///

Callers 5

clean_larger_thanFunction · 0.45
collect_scope_filesFunction · 0.45
list_allMethod · 0.45
latestMethod · 0.45

Calls 2

list_statusMethod · 0.80
schema_directoryMethod · 0.80

Tested by

no test coverage detected