Connect and Query Live Odoo Data in Databricks with CData Connect Cloud



Use CData Connect Cloud to integrate live Odoo data into Databricks and enable direct, live querying and analysis without replication.

Databricks is a leading AI cloud-native platform that unifies data engineering, machine learning, and analytics at scale. Its powerful data lakehouse architecture combines the performance of data warehouses with the flexibility of data lakes. Integrating Databricks with CData Connect Cloud gives organizations live, real-time access to Odoo data without the need for complex ETL pipelines or data duplication—streamlining operations and reducing time-to-insights.

In this article, we'll walk through how to configure a secure, live connection from Databricks to Odoo using CData Connect Cloud. Once configured, you'll be able to access Odoo data directly from Databricks notebooks using standard SQL—enabling unified, real-time analytics across your data ecosystem.

About Odoo Data Integration

Accessing and integrating live data from Odoo has never been easier with CData. Customers rely on CData connectivity to:

  • Access live data from both Odoo API 8.0+ and Odoo.sh Cloud ERP.
  • Extend the native Odoo features with intelligent handling of many-to-one, one-to-many, and many-to-many data properties. CData's connectivity solutions also intelligently handle complex data properties within Odoo. In addition to columns with simple values like text and dates, there are also columns that contain multiple values on each row. The driver decodes these kinds of values differently, depending upon the type of column the value comes from:
    • Many-to-one columns are references to a single row within another model. Within CData solutions, many-to-one columns are represented as integers, whose value is the ID to which they refer in the other model.
    • Many-to-many columns are references to many rows within another model. Within CData solutions, many-to-many columns are represented as text containing a comma-separated list of integers. Each value in that list is the ID of a row that is being referenced.
    • One-to-many columns are references to many rows within another model - they are similar to many-to-many columns (comma-separated lists of integers), except that each row in the referenced model must belong to only one in the main model.
  • Use SQL stored procedures to call server-side RFCs within Odoo.

Users frequently integrate Odoo with analytics tools such as Power BI and Qlik Sense, and leverage our tools to replicate Odoo data to databases or data warehouses.


Getting Started


Overview

Here is an overview of the simple steps:

  1. Step 1 — Connect and Configure: In CData Connect Cloud, create a connection to your Odoo source, configure user permissions, and generate a Personal Access Token (PAT).
  2. Step 2 — Query from Databricks: Install the CData JDBC driver in Databricks, configure your notebook with the connection details, and run SQL queries to access live Odoo data.

Prerequisites

Before you begin, make sure you have the following:

  1. An active Odoo account.
  2. A CData Connect Cloud account. You can log in or sign up for a free trial here.
  3. A Databricks account. Sign up or log in here.

Step 1: Connect and Configure a Odoo Connection in CData Connect Cloud

1.1 Add a Connection to Odoo

CData Connect Cloud uses a straightforward, point-and-click interface to connect to available data sources.

  1. Log into Connect Cloud, click Sources on the left, and then click Add Connection in the top-right.
  2. Select "Odoo" from the Add Connection panel.
  3. Enter the necessary authentication properties to connect to Odoo.

    To connect, set the Url to a valid Odoo site, User and Password to the connection details of the user you are connecting with, and Database to the Odoo database.

  4. Click Save & Test in the top-right.
  5. Navigate to the Permissions tab on the Odoo Connection page and update the user-based permissions based on your preferences.

1.2 Generate a Personal Access Token (PAT)

When connecting to Connect Cloud through the REST API, the OData API, or the Virtual SQL Server, a Personal Access Token (PAT) is used to authenticate the connection to Connect Cloud. PAT functions as an alternative to your login credentials for secure, token-based authentication. It is a best practice to create a separate PAT for each service to maintain granularity of access.

  1. Click on the Gear icon () at the top right of the Connect Cloud app to open the settings page.
  2. On the Settings page, go to the Access Tokens section and click Create PAT.
  3. Give the PAT a name and click Create.
  4. Note: The personal access token is only visible at creation, so be sure to copy it and store it securely for future use.

Step 2: Connect and Query Odoo Data in Databricks

Follow these steps to establish a connection from Databricks to Odoo. You'll install the CData JDBC Driver for Connect Cloud, add the JAR file to your cluster, configure your notebooks, and run SQL queries to access live Odoo data data.

2.1 Install the CData JDBC Driver for Connect Cloud

  1. In CData Connect Cloud, click the Integrations page on the left. Search for JDBC or Databricks, click Download, and select the installer for your operating system.
  2. Once downloaded, run the installer and follow the instructions:
    • For Windows: Run the setup file and follow the installation wizard.
    • For Mac/Linux: Unpack the archive and move the folder to /opt or /Applications. Make sure you have execute permissions.
  3. After installation, locate the JAR file in the installation directory:
    • Windows:
      C:\Program Files\CData\CData JDBC Driver for Connect Cloud\lib\cdata.jdbc.connect.jar
    • Mac/Linux:
      /Applications/CData/CData JDBC Driver for Connect Cloud/lib/cdata.jdbc.connect.jar

2.2 Install the JAR File on Databricks

  1. Log in to Databricks. In the navigation pane, click Compute on the left. Start or create a compute cluster.
  2. Click on the running cluster, go to the Libraries tab, and click Install New at the top right.
  3. In the Install Library dialog, select DBFS, and drag and drop the cdata.jdbc.connect.jar file. Click Install.

2.3 Query Odoo Data in a Databricks Notebook

Notebook Script 1 — Define JDBC Connection:

  1. Paste the following script into the notebook cell:
driver = "cdata.jdbc.connect.ConnectDriver"
url = "jdbc:connect:AuthScheme=Basic;User=your_username;Password=your_pat;URL=https://cloud.cdata.com/api/;DefaultCatalog=Your_Connection_Name;"
  1. Replace:
    • your_username - With your CData Connect Cloud username
    • your_pat - With your CData Connect Cloud Personal Access Token (PAT)
    • Your_Connection_Name - With the name of your Connect Cloud data source, from the Sources page
  2. Run the script.

Notebook Script 2 — Load DataFrame from Odoo data:

  1. Add a new cell for this second script. From the menu on the right side of your notebook, click Add cell below.
  2. Paste the following script into the new cell:
remote_table = spark.read.format("jdbc") \
  .option("driver", "cdata.jdbc.connect.ConnectDriver") \
  .option("url", "jdbc:connect:AuthScheme=Basic;User=your_username;Password=your_pat;URL=https://cloud.cdata.com/api/;DefaultCatalog=Your_Connection_Name;") \
  .option("dbtable", "YOUR_SCHEMA.YOUR_TABLE") \
  .load()
  1. Replace:
    • your_username - With your CData Connect Cloud username
    • your_pat - With your CData Connect Cloud Personal Access Token (PAT)
    • Your_Connection_Name - With the name of your Connect Cloud data source, from the Sources page
    • YOUR_SCHEMA.YOUR_TABLE - With your schema and table, for example, Odoo.res_users
  2. Run the script.

Notebook Script 3 — Preview Columns:

  1. Similarly, add a new cell for this third script.
  2. Paste the following script into the new cell:
display(remote_table.select("ColumnName1", "ColumnName2"))
  1. Replace ColumnName1 and ColumnName2 with the actual columns from your Odoo structure (e.g. name, email, etc.).
  2. Run the script.

You can now explore, join, and analyze live Odoo data directly within Databricks notebooks—without needing to know the complexities of the back-end API and without replicating Odoo data.


Try CData Connect Cloud Free for 14 Days

Ready to simplify real-time access to Odoo data? Start your free 14-day trial of CData Connect Cloud today and experience seamless, live connectivity from Databricks to Odoo.

Low code, zero infrastructure, zero replication — just seamless, secure access to your most critical data and insights.

Ready to get started?

Learn more about CData Connect Cloud or sign up for free trial access:

Free Trial