zakariya-s commented on code in PR #2776:
URL: https://github.com/apache/iceberg-rust/pull/2776#discussion_r3608925525
##########
crates/iceberg/src/catalog/metadata_location.rs:
##########
@@ -25,11 +25,14 @@ use crate::compression::CompressionCodec;
use crate::spec::{TableMetadata, parse_metadata_file_compression};
use crate::{Error, ErrorKind, Result};
-/// Helper for parsing a location of the format:
`<location>/metadata/<version>-<uuid>.metadata.json`
-/// or with compression:
`<location>/metadata/<version>-<uuid>.gz.metadata.json`
+/// Helper for parsing a location of the format:
`<metadata-dir>/<version>-<uuid>.metadata.json`
+/// or with compression: `<metadata-dir>/<version>-<uuid>.gz.metadata.json`
+///
+/// `<metadata-dir>` is set to the `write.metadata.path` table property and
+/// it defaults to the `<location>/metadata` when the property is not set.
#[derive(Clone, Debug, PartialEq)]
pub struct MetadataLocation {
- table_location: String,
+ metadata_dir: String,
Review Comment:
d6629e5c54d4f194db337d92cfdf7a0bd9ca40db
##########
crates/iceberg/src/spec/table_properties.rs:
##########
@@ -228,6 +231,14 @@ impl TableProperties {
/// Default target file size
pub const PROPERTY_WRITE_TARGET_FILE_SIZE_BYTES_DEFAULT: usize = 512 *
1024 * 1024; // 512 MB
+ /// Base location for metadata files (manifests, manifest lists, table
metadata).
+ /// When unset, metadata files default to the `metadata` directory under
the table
+ /// location.
+ pub const PROPERTY_WRITE_METADATA_PATH: &str = "write.metadata.path";
+ /// Default subdirectory (under the table location) for metadata files when
+ /// [`Self::PROPERTY_WRITE_METADATA_PATH`] is not configured.
+ pub const PROPERTY_WRITE_METADATA_PATH_DEFAULT_DIR: &str = "metadata";
Review Comment:
d6629e5c54d4f194db337d92cfdf7a0bd9ca40db
##########
crates/iceberg/src/catalog/metadata_location.rs:
##########
@@ -50,7 +53,7 @@ impl MetadataLocation {
)]
pub fn new_with_table_location(table_location: impl ToString) -> Self {
Self {
- table_location: table_location.to_string(),
+ metadata_dir:
TableMetadata::default_metadata_dir(&table_location.to_string()),
Review Comment:
d6629e5c54d4f194db337d92cfdf7a0bd9ca40db
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]