This is an automated email from the ASF dual-hosted git repository.
liurenjie1024 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git
The following commit(s) were added to refs/heads/main by this push:
new 560a1241 chore: expose default schema id (#1526)
560a1241 is described below
commit 560a1241c75471d5f7d695af265b3e8aad454faa
Author: dentiny <[email protected]>
AuthorDate: Sun Jul 20 02:29:57 2025 -0700
chore: expose default schema id (#1526)
## What changes are included in this PR?
I'm using `SchemaBuilder` to construct `Schema`, I want to do assertion
on schema id to make sure it's properly assigned.
Essentially:
```sh
// upstream
let schema = SchemaBuilder::new().xxx().xxx().build();
// downstream
assert_ne!(schema.schema_id(), DEFAULT_SCHEMA_ID);
```
## Are these changes tested?
No-op change, compilation is enough.
---
crates/iceberg/src/spec/schema/mod.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crates/iceberg/src/spec/schema/mod.rs
b/crates/iceberg/src/spec/schema/mod.rs
index 5c677a59..65546299 100644
--- a/crates/iceberg/src/spec/schema/mod.rs
+++ b/crates/iceberg/src/spec/schema/mod.rs
@@ -49,7 +49,8 @@ use crate::{Error, ErrorKind, ensure_data_valid};
pub type SchemaId = i32;
/// Reference to [`Schema`].
pub type SchemaRef = Arc<Schema>;
-pub(crate) const DEFAULT_SCHEMA_ID: SchemaId = 0;
+/// Default schema id.
+pub const DEFAULT_SCHEMA_ID: SchemaId = 0;
/// Defines schema in iceberg.
#[derive(Debug, Serialize, Deserialize, Clone)]