Skip to content

Commit

Permalink
feat: Add kerberos service property to allow kerberized hive connection
Browse files Browse the repository at this point in the history
  • Loading branch information
robertomorandeira committed Jan 24, 2024
1 parent 28d6e8b commit a82edd6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions soda/spark/soda/data_sources/spark_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def hive_connection_function(
port: str,
database: str,
auth_method: str,
kerberos_service_name: str,
**kwargs,
):
"""
Expand All @@ -44,6 +45,8 @@ def hive_connection_function(
The databse
auth_method : str
The authentication method
kerberos_service_name: str
The Kerberos service name
Returns
-------
Expand All @@ -59,6 +62,7 @@ def hive_connection_function(
port=port,
database=database,
auth=auth_method,
kerberos_service_name=kerberos_service_name,
)
return connection

Expand Down Expand Up @@ -438,6 +442,7 @@ def __init__(self, logs: Logs, data_source_name: str, data_source_properties: di
self.database = data_source_properties.get("catalog", "default")
self.schema = data_source_properties.get("schema", "default")
self.auth_method = data_source_properties.get("authentication", None)
self.kerberos_service_name = data_source_properties.get("kerberos_service_name", None)
self.configuration = data_source_properties.get("configuration", {})
self.driver = data_source_properties.get("driver", None)
self.organization = data_source_properties.get("organization", None)
Expand All @@ -464,6 +469,7 @@ def connect(self):
port=self.port,
database=self.database,
auth_method=self.auth_method,
kerberos_service_name=self.kerberos_service_name,
driver=self.driver,
token=self.token,
schema=self.schema,
Expand Down

0 comments on commit a82edd6

Please sign in to comment.