Skip to content

Commit 8a3aa59

Browse files
Address copilot comments
1 parent e5b4df6 commit 8a3aa59

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

crates/fluss/src/client/table/upsert.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,15 @@ impl<RE: RowEncoder> UpsertWriterImpl<RE> {
322322
self.row_encoder.finish_row()
323323
}
324324

325-
fn get_physical_path<R: InternalRow>(&self, row: &R) -> PhysicalTablePath {
325+
fn get_physical_path<R: InternalRow>(&self, row: &R) -> Result<PhysicalTablePath> {
326326
if let Some(partition_getter) = &self.partition_field_getter {
327327
let partition = partition_getter.get_partition(row);
328-
PhysicalTablePath::of_partitioned(Arc::clone(&self.table_path), partition.ok())
328+
Ok(PhysicalTablePath::of_partitioned(
329+
Arc::clone(&self.table_path),
330+
Some(partition?),
331+
))
329332
} else {
330-
PhysicalTablePath::of(Arc::clone(&self.table_path))
333+
Ok(PhysicalTablePath::of(Arc::clone(&self.table_path)))
331334
}
332335
}
333336
}
@@ -362,7 +365,7 @@ impl<RE: RowEncoder> UpsertWriter for UpsertWriterImpl<RE> {
362365
};
363366

364367
let write_record = WriteRecord::for_upsert(
365-
Arc::new(self.get_physical_path(row)),
368+
Arc::new(self.get_physical_path(row)?),
366369
self.table_info.schema_id,
367370
key,
368371
bucket_key,
@@ -391,7 +394,7 @@ impl<RE: RowEncoder> UpsertWriter for UpsertWriterImpl<RE> {
391394
let (key, bucket_key) = self.get_keys(row)?;
392395

393396
let write_record = WriteRecord::for_upsert(
394-
Arc::new(self.get_physical_path(row)),
397+
Arc::new(self.get_physical_path(row)?),
395398
self.table_info.schema_id,
396399
key,
397400
bucket_key,

0 commit comments

Comments
 (0)