fresh-borzoni commented on code in PR #158:
URL: https://github.com/apache/fluss-rust/pull/158#discussion_r2690218129
##########
crates/fluss/src/metadata/table.rs:
##########
@@ -726,6 +728,22 @@ impl TableConfig {
pub fn get_arrow_compression_info(&self) -> Result<ArrowCompressionInfo> {
ArrowCompressionInfo::from_conf(&self.properties)
}
+
+ pub fn get_datalake_format(&self) -> Result<Option<DataLakeFormat>> {
+ self.properties
+ .get("table.datalake.format")
+ .map(|f| f.parse().map_err(Error::from))
+ .transpose()
+ }
+
+ pub fn get_kv_format(&self) -> Result<Option<KvFormat>> {
Review Comment:
Why do we return Option if we have default and unwrap?
Would smth like this work:
```rust
const DEFAULT: &str = "COMPACTED";
let raw =
self.properties.get("table.kv.format").map(String::as_str).unwrap_or(DEFAULT);
raw.parse().map_err(Into::into)
```
Then the type would be `Result<KvFormat>`
##########
crates/fluss/src/metadata/table.rs:
##########
@@ -726,6 +728,22 @@ impl TableConfig {
pub fn get_arrow_compression_info(&self) -> Result<ArrowCompressionInfo> {
ArrowCompressionInfo::from_conf(&self.properties)
}
+
+ pub fn get_datalake_format(&self) -> Result<Option<DataLakeFormat>> {
+ self.properties
+ .get("table.datalake.format")
+ .map(|f| f.parse().map_err(Error::from))
+ .transpose()
+ }
+
+ pub fn get_kv_format(&self) -> Result<Option<KvFormat>> {
Review Comment:
Why do we return Option if we have default and unwrap?
Would smth like this work here?
```rust
const DEFAULT: &str = "COMPACTED";
let raw =
self.properties.get("table.kv.format").map(String::as_str).unwrap_or(DEFAULT);
raw.parse().map_err(Into::into)
```
Then the type would be `Result<KvFormat>`
--
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]