codope commented on code in PR #767:
URL: https://github.com/apache/hudi-rs/pull/767#discussion_r4426944222
##########
cpp/src/lib.rs:
##########
@@ -68,86 +194,95 @@ pub struct HudiFileGroupReader {
pub fn new_file_group_reader_with_options(
base_uri: &CxxString,
options: &CxxVector<CxxString>,
-) -> std::result::Result<Box<HudiFileGroupReader>, String> {
- let base_uri = base_uri
- .to_str()
- .map_err(|e| format!("Failed to convert CxxString to str: {e}"))?;
-
- let mut opt_vec = Vec::new();
- for opt in options.iter() {
- let opt_str = opt
- .to_str()
- .map_err(|e| format!("Failed to convert CxxString to str: {e}"))?;
- if let Some((key, value)) = opt_str.split_once('=') {
- opt_vec.push((key, value))
- }
- }
+) -> Result<Box<HudiFileGroupReader>, String> {
+ guard("new_file_group_reader_with_options", || {
+ let base_uri = cxx_str(base_uri)?;
+
+ let opt_vec = key_values(cxx_strs(options)?)?;
Review Comment:
Created separate PR as dicussed above
https://github.com/apache/hudi-rs/pull/942
--
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]