WetABQ opened a new issue, #14546:
URL: https://github.com/apache/datafusion/issues/14546

   ### Describe the bug
   
   When attempting to use the object_store crate with an HTTP URL, the error 
message returned is non-intuitive. The error is caused by the object_store 
crate enforcing HTTPS, but the error message does not clearly indicate this. 
Instead, it returns a generic error message that can be confusing to users.
   
   Error Message:
   ```
   ObjectStore(Generic { store: "HTTP", source: Request { source: Reqwest { 
retries: 0, max_retries: 10, elapsed: 65.417µs, retry_timeout: 180s, source: 
reqwest::Error { kind: Builder, url: "http://127.0.0.1:3000/hits_0.parquet";, 
source: BadScheme } } } })
   ```
   
   ### To Reproduce
   
   Set up a local HTTP server serving a Parquet (or whatever) file at 
`http://127.0.0.1:3000/hits_0.parquet`.
   
   Use the following code snippet to attempt to register the Parquet file with 
a DataFusion context:
   ```rust
    use std::sync::Arc;
    use datafusion::prelude::{ParquetReadOptions, SessionConfig, 
SessionContext};
    use object_store::http::HttpBuilder;
    use url::Url;
   
    #[tokio::main]
    async fn main() -> datafusion::error::Result<()> {
        let mut config = SessionConfig::new();
        let ctx = SessionContext::new_with_config(config);
   
        let base_url = Url::parse("http://127.0.0.1:3000/";).unwrap();
        let object_store = HttpBuilder::new()
              .with_url(base_url.clone())
              .build()
              .unwrap();
        ctx.register_object_store(&base_url, Arc::new(object_store));
   
        ctx.register_parquet(
            "hits",
            "http://127.0.0.1:3000/hits_0.parquet";,
            ParquetReadOptions::default()
        ).await?;
   
        Ok(())
    }
   ```
   
   
   ### Expected behavior
   
   The error should be raised after the object store has been retrieved, and it 
should clearly indicate that the issue is related to the use of HTTP instead of 
HTTPS. A more intuitive error message would help users quickly identify and 
resolve the issue.
   
   ### Additional context
   
   Config Option: 
https://docs.rs/object_store/0.11.2/object_store/enum.ClientConfigKey.html


-- 
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: github-unsubscr...@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to