WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center
"Databricks" (Data Connection)

"Databricks" (Data Connection)

Details

Properties

  • DataConnectionObject [assoc] creates a reference to a data source. The source does not need to exist yet.
  • General keys typically found in assoc are:
  • "ConnectionName" "Databricks"
    "Location" SQL query given as a string
    "Redownload" whether to rerun the query and overwrite cached results
  • Required keys in assoc are:
  • "Host" the host servicing the database
    "Warehouse" the path to the Databricks SQL warehouse
  • Typical keys in assoc are:
  • "Port" the server port to access the database
    "Schema" database or schema to connect to
  • Possible forms of "Location" when connecting to Databricks include:
  • "query" SQL query given as a string
  • Account Setting & Authentication

  • Possible values for Authentication are:
  • Automatic attempt to use saved credentials or give a dialog
    "Dialog" give authentication parameters via a dialog
    SystemCredential ["key"] retrieve authentication information from secure storage
    SystemCredentialData [] stored authentication data
    assoc provide explicit credentials
  • Use the form Authentication :> SystemCredential ["key"] to delay evaluating securely stored credentials.
  • The following keys are accepted by Authentication assoc:
  • "Token" Databricks jdbc token
  • Examples

    open all close all

    Basic Examples  (2)

    Create a DataConnectionObject to data from a Databricks query:

    Wolfram Language code: DataConnectionObject[<|"ConnectionName" -> "Databricks", "Host" -> "dbc-123456abc-abc1.cloud.databricks.com", "Port" -> 443, "Warehouse" -> "/sql/1.0/warehouses/abc123abc123", "Location" -> "SELECT * FROM table"|>, Authentication -> <|"Token" -> "mytoken"|>]
    Wolfram Language code: DataConnectionObject[Association["ConnectionName" -> "Databricks", "Host" -> "dbc-123456abc-abc1.cloud.databricks.com", "Port" -> 443, "Warehouse" -> "/sql/1.0/warehouses/d96fbbe2acr8d329", "Location" -> "SELECT * FROM table"], Association["UUID" -> "db9e416a-0032-4d9f-8ab4-44b58477454d"], Authentication -> Association["Token" -> "mytoken"]]

    Retrieve the data using Import :

    Wolfram Language code: Import@DataConnectionObject[<|"ConnectionName" -> "Databricks", "Host" -> "dbc-123456abc-abc1.cloud.databricks.com", "Port" -> 443, "Warehouse" -> "/sql/1.0/warehouses/abc123abc123", "Location" -> "SELECT * FROM table"|>, Authentication -> <|"Token" -> "mytoken"|>]

    Authentication  (2)

    Use an account token as Authentication for a Databricks connection:

    Wolfram Language code: DataConnectionObject[<|"ConnectionName" -> "Databricks", "Host" -> "dbc-123456abc-abc1.cloud.databricks.com", "Port" -> 443, "Warehouse" -> "/sql/1.0/warehouses/abc123abc123", "Location" -> "SELECT * FROM table"|>, Authentication -> <|"Token" -> "mytoken"|>]
    Wolfram Language code: DataConnectionObject[Association["ConnectionName" -> "Databricks", "Host" -> "dbc-123456abc-abc1.cloud.databricks.com", "Port" -> 443, "Warehouse" -> "/sql/1.0/warehouses/d96fbbe2acr8d329", "Location" -> "SELECT * FROM table"], Association["UUID" -> "db9e416a-0032-4d9f-8ab4-44b58477454d"], Authentication -> Association["Token" -> "mytoken"]]

    Retrieve the data using Import :

    Wolfram Language code: Import@DataConnectionObject[<|"ConnectionName" -> "Databricks", "Host" -> "dbc-123456abc-abc1.cloud.databricks.com", "Port" -> 443, "Warehouse" -> "/sql/1.0/warehouses/abc123abc123", "Location" -> "SELECT * FROM table"|>, Authentication -> <|"Token" -> "mytoken"|>]

    See Also

    DataConnectionObject   Import

    Data Connections: Snowflake   PostgreSQL   SQLite   MySQL   MicrosoftSQL   Oracle

    Top [フレーム]

    AltStyle によって変換されたページ (->オリジナル) /