Skip to content

Commit

Permalink
feat(csharp/src/Drivers/Apache/Spark): Azure HDInsight Spark Document…
Browse files Browse the repository at this point in the history
…ation (#2164)

Added documentation on how to connect to Azure HDInsight Spark Cluster
Removed existing flags related to Azure HDInsight Spark

Co-authored-by: Sudhir Emmadi <[email protected]>
  • Loading branch information
sudhiremmadi and Sudhir Emmadi authored Sep 19, 2024
1 parent 36fce3d commit 42e5063
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 8 additions & 2 deletions csharp/src/Drivers/Apache/Spark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ but can also be passed in the call to `AdbcDatabase.Connect`.

| Property | Description | Default |
| :--- | :--- | :--- |
| `adbc.spark.type` | (Required) Indicates the Spark server type. One of `databricks`, `http` (future: `standard`, `hdinsight`) | |
| `adbc.spark.type` | (Required) Indicates the Spark server type. One of `databricks`, `http` (future: `standard`) | |
| `adbc.spark.auth_type` | An indicator of the intended type of authentication. Allowed values: `none`, `username_only`, `basic`, and `token`. This property is optional. The authentication type can be inferred from `token`, `username`, and `password`. If a `token` value is provided, token authentication is used. Otherwise, if both `username` and `password` values are provided, basic authentication is used. | |
| `adbc.spark.host` | Host name for the data source. Do not include scheme or port number. Example: `sparkserver.region.cloudapp.azure.com` | |
| `adbc.spark.port` | The port number the data source listens on for a new connections. | `443` |
Expand Down Expand Up @@ -120,4 +120,10 @@ This is currently unsupported.

### Azure Spark HDInsight

This is currently unsupported.
To read data from Azure HDInsight Spark Cluster, use the following parameters:
adbc.spark.type = "http"
adbc.spark.port = "443"
adbc.spark.path = "/sparkhive2"
adbc.spark.host = $"{clusterHostName}"
username = $"{clusterUserName}"
password = $"{clusterPassword}"
5 changes: 0 additions & 5 deletions csharp/src/Drivers/Apache/Spark/SparkParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public static class SparkServerTypeConstants
public const string Http = "http";
public const string Databricks = "databricks";
public const string Standard = "standard";
public const string HDInsight = "hdinsight";
internal const string SupportedList = Http + ", " + Databricks;

public static bool TryParse(string? serverType, out SparkServerType serverTypeValue)
Expand All @@ -102,9 +101,6 @@ public static bool TryParse(string? serverType, out SparkServerType serverTypeVa
case Standard:
serverTypeValue = SparkServerType.Standard;
return true;
case HDInsight:
serverTypeValue = SparkServerType.HDInsight;
return true;
default:
serverTypeValue = SparkServerType.Invalid;
return false;
Expand All @@ -118,7 +114,6 @@ public enum SparkServerType
Http,
Databricks,
Standard,
HDInsight,
Empty = int.MaxValue,
}

Expand Down
1 change: 0 additions & 1 deletion csharp/test/Drivers/Apache/Spark/SparkConnectionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public InvalidConnectionParametersTestData()
Add(new(new() { [SparkParameters.Type] = " " }, typeof(ArgumentException)));
Add(new(new() { [SparkParameters.Type] = "xxx" }, typeof(ArgumentOutOfRangeException)));
Add(new(new() { [SparkParameters.Type] = SparkServerTypeConstants.Standard }, typeof(ArgumentOutOfRangeException)));
Add(new(new() { [SparkParameters.Type] = SparkServerTypeConstants.HDInsight }, typeof(ArgumentOutOfRangeException)));
Add(new(new() { [SparkParameters.Type] = SparkServerTypeConstants.Http, [SparkParameters.HostName] = " " }, typeof(ArgumentException)));
Add(new(new() { [SparkParameters.Type] = SparkServerTypeConstants.Http, [SparkParameters.HostName] = "invalid!server.com" }, typeof(ArgumentException)));
Add(new(new() { [SparkParameters.Type] = SparkServerTypeConstants.Http, [SparkParameters.HostName] = "http://valid.server.com" }, typeof(ArgumentException)));
Expand Down

0 comments on commit 42e5063

Please sign in to comment.