class atoti_directquery_databricks.DatabricksConnectionInfo#

Information needed to connect to a Databricks database.

__init__(url, /, *, password=None, time_travel='strict')#

Create a Databricks connection info.

To aggregate native Databrick arrays, UDAFs (User Defined Aggregation Functions) provided by ActiveViam must be registered on the cluster. Native array aggregation is not supported on SQL warehouses.

  • url (str) – The JDBC connection string.

  • password (str | None) –

    The password to connect to the database.

    Passing it in this separate parameter allows to avoid having it logged alongside the connection string.

    If None, a password is expected to be present in the passed url.

  • time_travel (Literal[False, 'lax', 'strict']) –

    How to use Databricks’ time travel feature.

    Databricks does not support time travel with views, so the options are: - False: tables and views are queried on the latest state of the database. - "lax": tables are queried with time travel but views are queried without it. - "strict": tables are queried with time travel and querying a view raises an error.


>>> import os
>>> from atoti_directquery_databricks import DatabricksConnectionInfo
>>> connection_info = DatabricksConnectionInfo(
...     "jdbc:databricks://"
...     + os.environ["DATABRICKS_SERVER_HOSTNAME"]
...     + "/default;"
...     + "transportMode=http;"
...     + "ssl=1;"
...     + "httpPath="
...     + os.environ["DATABRICKS_HTTP_PATH"]
...     + ";"
...     + "AuthMech=3;"
...     + "UID=token;",
...     password=os.environ["DATABRICKS_AUTH_TOKEN"],
... )