devillove084 commented on code in PR #51:
URL: https://github.com/apache/paimon-rust/pull/51#discussion_r1719763578


##########
crates/paimon/src/io/file_io.rs:
##########
@@ -17,66 +17,80 @@
 
 use crate::error::*;
 use std::collections::HashMap;
+use std::ops::Range;
+use std::sync::Arc;
 
-use chrono::offset::Utc;
-use chrono::DateTime;
-use opendal::services::Fs;
-use opendal::{Metakey, Operator};
+use bytes::Bytes;
+use chrono::{DateTime, Utc};
+use opendal::Operator;
 use snafu::ResultExt;
+use url::Url;
+
+use super::Storage;
 
 #[derive(Clone, Debug)]
 pub struct FileIO {
-    op: Operator,
+    inner_storage: Arc<Storage>,
 }
 
 impl FileIO {
-    /// Create a new FileIO.
+    /// Try to infer file io scheme from path.
     ///
     /// The input HashMap is paimon-java's 
[`Options`](https://github.com/apache/paimon/blob/release-0.8.2/paimon-common/src/main/java/org/apache/paimon/options/Options.java#L60)
-    ///
-    /// TODO: Support building Operator from HashMap via options.
-    pub fn new(_: HashMap<String, String>) -> Result<Self> {
-        let op = Operator::new(Fs::default().root("/"))
-            .context(IoUnexpectedSnafu {
-                message: "Failed to create operator".to_string(),
-            })?
-            .finish();
-        Ok(Self { op })
+    pub fn from_path(path: impl AsRef<str>) -> Result<FileIOBuilder> {

Review Comment:
   Yes



-- 
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]

Reply via email to