sjrusso8 / spark-connect-rs

Apache Spark Connect Client for Rust
https://docs.rs/spark-connect-rs
Apache License 2.0
76 stars 13 forks source link

Bug: Endpoint uses https scheme when use_ssl is false #38

Closed Sevenannn closed 4 months ago

Sevenannn commented 4 months ago

I already have a fix in mind for this issue, and I can make a PR if this issue is reviewed and approved, thanks!

Description

The current spark-connect-rs library configures all endpoints to https scheme. When tls feature is enabled, connection cannot be successfully made to server without TLS configured, for example, when connecting to a Spark cluster set up at localhost

Expected Behavior

When tls feature is enabled in spark-connect-rs crate, connection to server with / without TLS configured should both be successful

Proposed Fix

Default endpoint scheme to http, set it to https only when use_ssl=true is specified in connection string

Related Issue

sjrusso8 commented 4 months ago

@Sevenannn Good call. I probably overlooked this because this error never popped up when running spark connect locally.

I created PR #39 to correct this.

Sevenannn commented 4 months ago

@sjrusso8 Thanks for taking a look at this! The PR looks good to me