You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "toddmeng-db (via GitHub)" <gi...@apache.org> on 2025/05/06 20:24:54 UTC
[PR] databricks proxy configuration [arrow-adbc]
toddmeng-db opened a new pull request, #2789:
URL: https://github.com/apache/arrow-adbc/pull/2789
(no comment)
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(csharp/src/Drivers/Databricks) Databricks Proxy Configurator [arrow-adbc]
Posted by "toddmeng-db (via GitHub)" <gi...@apache.org>.
toddmeng-db commented on code in PR #2789:
URL: https://github.com/apache/arrow-adbc/pull/2789#discussion_r2078095916
##########
csharp/src/Drivers/Apache/Hive2/HiveServer2ProxyConfigurator.cs:
##########
@@ -0,0 +1,229 @@
+/*
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Net;
+using System.Net.Http;
+using System.Text.RegularExpressions;
+
+namespace Apache.Arrow.Adbc.Drivers.Apache.Hive2
+{
+ /// <summary>
+ /// Interface for proxy configuration
+ /// </summary>
+ public interface IProxyConfigurator
+ {
+ /// <summary>
+ /// Configures proxy settings on an HttpClientHandler
+ /// </summary>
+ /// <param name="handler">The HttpClientHandler to configure</param>
+ void ConfigureProxy(HttpClientHandler handler);
+ }
+
+ /// <summary>
+ /// Default implementation of proxy configuration for HTTP connections
+ /// </summary>
+ public class HiveServer2ProxyConfigurator : IProxyConfigurator
+ {
+ private readonly bool _useProxy;
+ private readonly string _proxyHost;
+ private readonly int _proxyPort;
+ private readonly bool _proxyAuth;
+ private readonly string? _proxyUid;
+ private readonly string? _proxyPwd;
+ private readonly string[]? _proxyBypassList;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="HiveServer2ProxyConfigurator"/> class.
+ /// </summary>
+ /// <param name="useProxy">Whether to use a proxy</param>
+ /// <param name="proxyPort">The proxy port</param>
+ /// <param name="proxyHost">The proxy host</param>
+ /// <param name="proxyAuth">Whether to use proxy authentication</param>
+ /// <param name="proxyUid">The proxy username</param>
+ /// <param name="proxyPwd">The proxy password</param>
+ /// <param name="proxyIgnoreList">Comma-separated list of hosts to bypass the proxy</param>
+ public HiveServer2ProxyConfigurator(
+ bool useProxy,
+ int? proxyPort = null,
+ string? proxyHost = null,
+ bool proxyAuth = false,
+ string? proxyUid = null,
+ string? proxyPwd = null,
+ string? proxyIgnoreList = null)
+ {
+ if (useProxy)
+ {
+ if (proxyHost == null)
+ throw new ArgumentNullException(nameof(proxyHost));
+
+ if (proxyPort == null)
+ throw new ArgumentNullException(nameof(proxyPort));
+ }
+
+ if (proxyAuth)
+ {
+ if (proxyUid == null)
+ throw new ArgumentNullException(nameof(proxyUid));
+
+ if (proxyPwd == null)
+ throw new ArgumentNullException(nameof(proxyPwd));
+ }
+
+ _useProxy = useProxy;
+ _proxyHost = proxyHost!;
+ _proxyPort = proxyPort!.Value;
+ _proxyAuth = proxyAuth;
+ _proxyUid = proxyUid;
+ _proxyPwd = proxyPwd;
+
+ if (!string.IsNullOrEmpty(proxyIgnoreList))
+ {
+ _proxyBypassList = ParseProxyIgnoreList(proxyIgnoreList);
+ }
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="HiveServer2ProxyConfigurator"/> class from connection properties.
+ /// </summary>
+ /// <param name="properties">The connection properties</param>
+ public static HiveServer2ProxyConfigurator FromProperties(IReadOnlyDictionary<string, string> properties)
+ {
+ bool useProxy = properties.TryGetValue(HttpProxyOptions.UseProxy, out string? useProxyStr) &&
+ useProxyStr == "1";
+
+ if (!useProxy)
+ {
+ return new HiveServer2ProxyConfigurator(false, 0);
+ }
+
+ // Get proxy host
+ if (!properties.TryGetValue(HttpProxyOptions.ProxyHost, out string? proxyHost) ||
+ string.IsNullOrEmpty(proxyHost))
+ {
+ throw new ArgumentException($"Parameter '{HttpProxyOptions.UseProxy}' is set to '1' but '{HttpProxyOptions.ProxyHost}' is not specified");
+ }
+
+ // Get proxy port
+ if (!properties.TryGetValue(HttpProxyOptions.ProxyPort, out string? proxyPortStr))
+ {
+ throw new ArgumentException($"Parameter '{HttpProxyOptions.ProxyPort}' is required when '{HttpProxyOptions.UseProxy}' is set to '1'");
+ }
+
+ if (!int.TryParse(proxyPortStr, out int proxyPort) || proxyPort <= 0 || proxyPort > 65535)
+ {
+ throw new ArgumentOutOfRangeException(
+ HttpProxyOptions.ProxyPort,
+ $"Invalid proxy port: {proxyPortStr}. Must be between 1 and 65535.");
+ }
+
+ // Get proxy authentication settings
+ bool proxyAuth = properties.TryGetValue(HttpProxyOptions.ProxyAuth, out string? proxyAuthStr) &&
+ proxyAuthStr == "1";
+
+ string? proxyUid = null;
+ string? proxyPwd = null;
+
+ if (proxyAuth)
+ {
+ properties.TryGetValue(HttpProxyOptions.ProxyUID, out proxyUid);
+ properties.TryGetValue(HttpProxyOptions.ProxyPWD, out proxyPwd);
+
+ if (string.IsNullOrEmpty(proxyUid))
+ {
+ throw new ArgumentException($"Parameter '{HttpProxyOptions.ProxyAuth}' is set to '1' but '{HttpProxyOptions.ProxyUID}' is not specified");
+ }
+
+ if (string.IsNullOrEmpty(proxyPwd))
+ {
+ throw new ArgumentException($"Parameter '{HttpProxyOptions.ProxyAuth}' is set to '1' but '{HttpProxyOptions.ProxyPWD}' is not specified");
+ }
+ }
+
+ // Get proxy bypass list
+ string? proxyIgnoreList;
+ properties.TryGetValue(HttpProxyOptions.ProxyIgnoreList, out proxyIgnoreList);
+
+ return new HiveServer2ProxyConfigurator(
+ useProxy,
+ proxyPort,
+ proxyHost,
+ proxyAuth,
+ proxyUid,
+ proxyPwd,
+ proxyIgnoreList);
+ }
+
+ /// <summary>
+ /// Configures proxy settings on an HttpClientHandler
+ /// </summary>
+ /// <param name="handler">The HttpClientHandler to configure</param>
+ public void ConfigureProxy(HttpClientHandler handler)
+ {
+ if (_useProxy)
+ {
+ // Create and configure the proxy
+ var proxy = new WebProxy(_proxyHost, _proxyPort);
+ // Configure authentication if needed
+ if (_proxyAuth && !string.IsNullOrEmpty(_proxyUid))
+ {
+ proxy.Credentials = new NetworkCredential(_proxyUid, _proxyPwd);
+ }
+
+ // Configure bypass list
+ if (_proxyBypassList != null && _proxyBypassList.Length > 0)
+ {
+ proxy.BypassList = _proxyBypassList;
+ }
+
+ // Apply proxy to handler
+ handler.Proxy = proxy;
+ handler.UseProxy = true;
+ }
+ else
+ {
+ // No proxy configuration
+ handler.UseProxy = false;
+ }
+ }
+
Review Comment:
http client bypass list in c# expects regex strings, hence why some handling is done to make hosts in regex format. I assume we don't want to expect users to pass in regex strings (though we still allow for wildcard pattern here)
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(csharp/src/Drivers/Databricks) Databricks Proxy Configurator [arrow-adbc]
Posted by "toddmeng-db (via GitHub)" <gi...@apache.org>.
toddmeng-db commented on code in PR #2789:
URL: https://github.com/apache/arrow-adbc/pull/2789#discussion_r2078145962
##########
csharp/src/Drivers/Apache/Spark/SparkHttpMessageHandlerFactory.cs:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
+{
+ /// <summary>
+ /// Factory for creating HTTP clients with proper configuration
+ /// </summary>
+ public class SparkHttpMessageHandlerFactory
Review Comment:
I'm taking a look at the implementation; other concern is the `NewHttpClientHandler` method is static, and is called by different httpconnections (`SparkHttpConnection`, `ImpalaHttpConnection`, `HiveServer2HttpConnection`). Since these classes all inherit from `HiveServer2Connection` (and we probably don't want to expose http logic at this layer), there is no obvious place to initialize http client with proxy logic for all child http connections. I think it actually makes some sense to use factory here, then
Edit, Discussed off-line: We could still put the logic in `NewHttpClientHandler` method, since that class is performing many different http configurations, anyways.
@CurtHagenlocher
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(csharp/src/Drivers/Databricks) Databricks Proxy Configurator [arrow-adbc]
Posted by "toddmeng-db (via GitHub)" <gi...@apache.org>.
toddmeng-db commented on code in PR #2789:
URL: https://github.com/apache/arrow-adbc/pull/2789#discussion_r2078145962
##########
csharp/src/Drivers/Apache/Spark/SparkHttpMessageHandlerFactory.cs:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
+{
+ /// <summary>
+ /// Factory for creating HTTP clients with proper configuration
+ /// </summary>
+ public class SparkHttpMessageHandlerFactory
Review Comment:
I'm taking a look at the implementation; other concern is the `NewHttpClientHandler` method is static, and is called by different httpconnections (`SparkHttpConnection`, `ImpalaHttpConnection`, `HiveServer2HttpConnection`). Since these classes all inherit from `HiveServer2Connection` (and we probably don't want to expose http logic at this layer), there is no obvious place to initialize http client with proxy logic for all child http connections. I think it actually makes some sense to use factory here, then
Discussed off-line: We could still put the logic in `NewHttpClientHandler` method, since that class is performing many different http configurations, anyways.
@CurtHagenlocher
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(csharp/src/Drivers/Databricks) Databricks Proxy Configurator [arrow-adbc]
Posted by "eric-wang-1990 (via GitHub)" <gi...@apache.org>.
eric-wang-1990 commented on code in PR #2789:
URL: https://github.com/apache/arrow-adbc/pull/2789#discussion_r2076570445
##########
csharp/src/Drivers/Apache/Spark/SparkParameters.cs:
##########
@@ -34,6 +34,48 @@ public class SparkParameters
public const string DataTypeConv = "adbc.spark.data_type_conv";
public const string ConnectTimeoutMilliseconds = "adbc.spark.connect_timeout_ms";
public const string UserAgentEntry = "adbc.spark.user_agent_entry";
+
+ // Proxy configuration parameters
+ /// <summary>
+ /// Whether to use a proxy for HTTP connections.
+ /// Default value is 0 (disabled) if not specified.
+ /// </summary>
+ public const string UseProxy = "UseProxy";
Review Comment:
This should be a general option setting for all hive traffic. Conside something like adbc.http_options.proxy.use_proxy, added to here: https://github.com/apache/arrow-adbc/blob/e045731b24f00df50e9c9f50e5ba6ec632cbd3ef/csharp/src/Drivers/Apache/Hive2/HiveServer2Parameters.cs#L55
##########
csharp/src/Drivers/Apache/Spark/SparkHttpMessageHandlerFactory.cs:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
+{
+ /// <summary>
+ /// Factory for creating HTTP clients with proper configuration
+ /// </summary>
+ public class SparkHttpMessageHandlerFactory
Review Comment:
We should not need this, here is already returning a handler: https://github.com/apache/arrow-adbc/blob/e045731b24f00df50e9c9f50e5ba6ec632cbd3ef/csharp/src/Drivers/Apache/Spark/SparkHttpConnection.cs#L151.
We can just call the proxy configurator on top of it.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(csharp/src/Drivers/Databricks): Databricks Proxy Configurator [arrow-adbc]
Posted by "toddmeng-db (via GitHub)" <gi...@apache.org>.
toddmeng-db commented on code in PR #2789:
URL: https://github.com/apache/arrow-adbc/pull/2789#discussion_r2078145962
##########
csharp/src/Drivers/Apache/Spark/SparkHttpMessageHandlerFactory.cs:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
+{
+ /// <summary>
+ /// Factory for creating HTTP clients with proper configuration
+ /// </summary>
+ public class SparkHttpMessageHandlerFactory
Review Comment:
I'm taking a look at the implementation; other concern is the `NewHttpClientHandler` method is static, and is called by different httpconnections (`SparkHttpConnection`, `ImpalaHttpConnection`, `HiveServer2HttpConnection`). Since these classes all inherit from `HiveServer2Connection` (and we probably don't want to expose http logic at this layer), there is no obvious place to initialize http client with proxy logic for all child http connections. I think it actually makes some sense to use factory here, then
Edit, Discussed off-line: We could still put the logic in `NewHttpClientHandler` method (or new method), since that class is performing many different http configurations, anyways.
@CurtHagenlocher
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(csharp/src/Drivers/Databricks): Databricks Proxy Configurator [arrow-adbc]
Posted by "toddmeng-db (via GitHub)" <gi...@apache.org>.
toddmeng-db commented on code in PR #2789:
URL: https://github.com/apache/arrow-adbc/pull/2789#discussion_r2078145962
##########
csharp/src/Drivers/Apache/Spark/SparkHttpMessageHandlerFactory.cs:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
+{
+ /// <summary>
+ /// Factory for creating HTTP clients with proper configuration
+ /// </summary>
+ public class SparkHttpMessageHandlerFactory
Review Comment:
I'm taking a look at the implementation; other concern is the `NewHttpClientHandler` method is static, and is called by different httpconnections (`SparkHttpConnection`, `ImpalaHttpConnection`, `HiveServer2HttpConnection`). Since these classes all inherit from `HiveServer2Connection` (and we probably don't want to expose http logic at this layer), there is no obvious place to initialize http client with proxy logic for all child http connections. I think it actually makes some sense to use factory here, then
Edit, Discussed off-line: We could still put the logic in `NewHttpClientHandler` method (or new method), since that class is performing many different tls configurations, anyways.
@CurtHagenlocher
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(csharp/src/Drivers/Databricks) Databricks Proxy Configurator [arrow-adbc]
Posted by "toddmeng-db (via GitHub)" <gi...@apache.org>.
toddmeng-db commented on code in PR #2789:
URL: https://github.com/apache/arrow-adbc/pull/2789#discussion_r2076890531
##########
csharp/src/Drivers/Apache/Spark/SparkHttpMessageHandlerFactory.cs:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
+{
+ /// <summary>
+ /// Factory for creating HTTP clients with proper configuration
+ /// </summary>
+ public class SparkHttpMessageHandlerFactory
Review Comment:
My main concern is that if we don't have a factory, we will have to configure proxy every where http client is used (cloud-fetch, oauth)
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(csharp/src/Drivers/Databricks) Databricks Proxy Configurator [arrow-adbc]
Posted by "toddmeng-db (via GitHub)" <gi...@apache.org>.
toddmeng-db commented on code in PR #2789:
URL: https://github.com/apache/arrow-adbc/pull/2789#discussion_r2078076798
##########
csharp/src/Drivers/Apache/Spark/SparkHttpMessageHandlerFactory.cs:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
+{
+ /// <summary>
+ /// Factory for creating HTTP clients with proper configuration
+ /// </summary>
+ public class SparkHttpMessageHandlerFactory
Review Comment:
Sounds good. I think it's feasible either way, but yea maybe client factory is a bit heavy weight right now.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(csharp/src/Drivers/Databricks) Databricks Proxy Configurator [arrow-adbc]
Posted by "eric-wang-1990 (via GitHub)" <gi...@apache.org>.
eric-wang-1990 commented on code in PR #2789:
URL: https://github.com/apache/arrow-adbc/pull/2789#discussion_r2078027760
##########
csharp/src/Drivers/Apache/Spark/SparkHttpMessageHandlerFactory.cs:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Net.Http;
+
+namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
+{
+ /// <summary>
+ /// Factory for creating HTTP clients with proper configuration
+ /// </summary>
+ public class SparkHttpMessageHandlerFactory
Review Comment:
Yeah I think it's fine, there is only cloud fetch and oauth case.
Actually for oauth you probably can just pass the handler to the httpClient constructor: https://github.com/apache/arrow-adbc/blob/ed2fe871ce9f7378b9aa9a03b51a9e498dd73207/csharp/src/Drivers/Databricks/Auth/OAuthClientCredentialsProvider.cs#L69
Try to see how bad it is, I think it's not that too bad.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org