From 7cf7ea0762865fcdda2a9d808195587bdc69de49 Mon Sep 17 00:00:00 2001 From: ZENOTME Date: Tue, 19 Nov 2024 10:40:38 +0800 Subject: [PATCH] refine commit uuid --- crates/iceberg/src/transaction.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/iceberg/src/transaction.rs b/crates/iceberg/src/transaction.rs index 2b56785ec..906690614 100644 --- a/crates/iceberg/src/transaction.rs +++ b/crates/iceberg/src/transaction.rs @@ -134,7 +134,7 @@ impl<'a> Transaction<'a> { /// Creates a fast append action. pub fn fast_append( self, - commit_uuid: Option, + commit_uuid: Option, key_metadata: Vec, ) -> Result> { let parent_snapshot_id = self @@ -147,7 +147,7 @@ impl<'a> Transaction<'a> { let schema_id = schema.schema_id(); let format_version = self.table.metadata().format_version(); let partition_spec = self.table.metadata().default_partition_spec().clone(); - let commit_uuid = commit_uuid.unwrap_or_else(|| uuid::Uuid::new_v4().to_string()); + let commit_uuid = commit_uuid.unwrap_or_else(Uuid::new_v4); FastAppendAction::new( self, @@ -205,7 +205,7 @@ impl<'a> FastAppendAction<'a> { format_version: FormatVersion, partition_spec: Arc, key_metadata: Vec, - commit_uuid: String, + commit_uuid: Uuid, snapshot_properties: HashMap, ) -> Result { Ok(Self { @@ -318,7 +318,7 @@ struct SnapshotProduceAction<'a> { schema: Schema, key_metadata: Vec, - commit_uuid: String, + commit_uuid: Uuid, snapshot_properties: HashMap, added_data_files: Vec, @@ -340,7 +340,7 @@ impl<'a> SnapshotProduceAction<'a> { partition_spec: Arc, schema: Schema, key_metadata: Vec, - commit_uuid: String, + commit_uuid: Uuid, snapshot_properties: HashMap, ) -> Result { Ok(Self { @@ -417,7 +417,7 @@ impl<'a> SnapshotProduceAction<'a> { "{}/{}/{}-m{}.{}", self.tx.table.metadata().location(), META_ROOT_PATH, - &self.commit_uuid, + self.commit_uuid, self.manifest_counter.next().unwrap(), DataFileFormat::Avro );