ryankert01 commented on code in PR #1130:
URL: https://github.com/apache/mahout/pull/1130#discussion_r2904694095


##########
qdp/qdp-core/src/remote.rs:
##########
@@ -0,0 +1,255 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//! Remote I/O support for cloud object storage.
+//!
+//! When the `remote-io` feature is enabled, cloud URLs (currently `s3://`)
+//! are transparently downloaded to a local temp file before being passed to
+//! readers. Adding GCS (`gs://`) or Azure (`az://`) support requires only a
+//! new match arm in [`build_store`] and the corresponding `object_store`
+//! cargo feature.
+
+use std::io::Write;
+use std::path::{Path, PathBuf};
+use std::sync::Arc;
+
+use object_store::ObjectStore;
+use object_store::path::Path as ObjectPath;
+use tempfile::NamedTempFile;
+
+use crate::error::{MahoutError, Result};
+
+/// Recognized cloud URL schemes.
+const REMOTE_SCHEMES: &[&str] = &["s3://"];
+
+/// Returns true if `path` is a recognized remote URL.
+pub fn is_remote_path(path: &str) -> bool {
+    REMOTE_SCHEMES.iter().any(|s| path.starts_with(s))
+}
+
+/// Parse a cloud URL into (scheme, bucket, key).
+fn parse_url(url: &str) -> Result<(&str, &str, &str)> {
+    let (scheme, rest) = url
+        .split_once("://")
+        .ok_or_else(|| MahoutError::InvalidInput(format!("Not a remote URL: 
{}", url)))?;
+    let (bucket, key) = rest.split_once('/').ok_or_else(|| {

Review Comment:
   the key can be `data.parquet?versionId=abc123`?



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