SteNicholas commented on code in PR #1448:
URL: https://github.com/apache/paimon-rust/pull/1448#discussion_r4656268784
##########
crates/paimon/src/catalog/filesystem.rs:
##########
@@ -463,11 +464,23 @@ impl Catalog for FileSystemCatalog {
});
}
- // todo: consider with lock
if !table_exists {
- self.file_io.mkdirs(&table_path).await?;
+ self.file_io
+ .mkdirs(&self.schema_dir_path(&table_path))
+ .await?;
let table_schema = TableSchema::new(0, &creation);
- self.save_table_schema(&table_path, &table_schema).await?;
+ let created = self
+ .file_io
+ .write_atomic_if_not_exists(
Review Comment:
Fixed in 178d0082. CTAS now calls `create_table_exclusive` and requires
atomic publication of `schema-0`. Ordinary `CREATE TABLE` can use a plain write
on HDFS-native and other backends that lack conditional publication. An I/O
error from an attempted conditional write or rename is propagated.
The regression test disables both conditional capabilities on a local
filesystem operator. It verifies that exclusive creation leaves the table
absent, then registers an existing Parquet file as a Format Table under the
same name and reads its rows back. [Regression
test](https://github.com/apache/paimon-rust/blob/178d0082b1dc803e91d93dbe52a41c0689f64f64/crates/paimon/src/catalog/filesystem.rs#L1828-L1906)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]