Skip to main content
Once you have enabled the Databricks integration for your project, you can activate Use Databricks as a source to access and use data stored in Databricks within your Kameleoon campaigns. Activating Use Databricks as a source lets you target visitors with attributes from your Databricks tables. Each Data Ingestion Task runs a SQL query that you define, on the frequency you set, and its results become available as custom data. You then build a segment from that custom data and use the segment in your campaigns.
  1. Activate the feature: In the selected project’s configuration, go in the section labeled Use Databricks as a source to enable the feature.
Databricks integration settings with Use Databricks as a source disabled, showing the Data Ingestion Task section with no tasks added.
  1. Create Data Ingestion Tasks: With the feature activated, click Add new task to create a Data Ingestion Task.
Add new data ingestion task form with empty Name, Frequency, Databricks Catalog, Schema and Query fields.
  1. Validate: After providing the required information for the Data Ingestion Task, click Confirm to create the task. You can create additional tasks by repeating the steps of naming the task, defining the SQL query, and setting the frequency. Once you’ve configured your tasks, click Validate to save and apply your configuration settings.
  2. Create custom data: Now that you created your Data Ingestion Task, Kameleoon’s servers will start collecting the data based on the frequency you configured by executing the query on your Databricks instance. To start using the collected data, you need to create custom data.
  3. Create a segment: The last step to target users based on the collected data is to create a segment based on the custom data you created.

Data Ingestion Tasks

Each Data Ingestion Task runs one SQL query against your Databricks tables at the frequency you set. The task’s results are available as custom data, which you use in a segment to target visitors in your Kameleoon campaigns. Kameleoon keeps a visitor in the audience for 1 year after the sync that put them there. If a sync fails, the audience keeps the membership from the last successful sync until a later sync succeeds. Once you have created your Data Ingestion Task, Kameleoon starts polling your warehouse, and the data is available right away for targeting your users in Kameleoon campaigns. You can use the polled data through Kameleoon’s Activation API for web experiments and through Kameleoon’s SDKs for Feature Experimentation.

Creating a Data Ingestion Task

To create a Data Ingestion Task:
  1. Click Add new task.
Data Ingestion Task section of the Databricks integration settings, with the Add new task link next to its title.
  1. Complete the form:
    • Name (Required): Give your task a unique and descriptive name to identify its purpose.
    • Frequency (Required): Specify how often you want the task to run and retrieve data from Databricks (for example, per day).
    • Databricks Catalog (Required): Provide the name of the Databricks “catalog” that contains the schemas you wish Kameleoon to read from (the top level folder).
    • Schema (Required): Provide the schema containing the tables this ingestion task will query from (for example, user_data).
    • Query (Required): Provide the SQL query that retrieves the audience from your Databricks database. The query must follow this specific format: SELECT visitor_id, attribute_1, ..., attribute_N FROM your_events_table
Empty form for a new data ingestion task, with Name, Frequency, Databricks Catalog, Schema and Query fields.
  • attribute_ fields: These are optional, and you can use them for advanced targeting scenarios. For these advanced use cases, see Target your imported audiences.
  • visitor_id: This column represents the unique identifier for your visitors.
Completed data ingestion task form named User City, with a 12 hours frequency, the Kam_DB catalog, the Kam_dbsch schema and a query that selects user_id and city from the Users table.
Once you’ve provided all the required information, click Confirm to create the Data Ingestion Task.

Guidelines

Column naming
Column names can only contain letters (uppercase or lowercase), numbers, and underscores (_). They can’t start with a number.
Column order
The columns must appear in the exact order specified (visitor_id, followed by optional attributes) for the integration to function correctly.

Ingestion Task ID

The task list shows each task as its ID followed by its name, for example 543 Attributes. The Ingestion Task ID is only the number (543). The name (Attributes) isn’t part of it. Use this number as taskId when you target imported audiences by attributes.

Run your query before ingestion

Before saving your ingestion task, you can test your query directly in Kameleoon. Testing allows you to:
  • Verify the connection in real time.
  • Confirm your credentials and access rights are correct, which helps detect issues immediately, without having to wait for the first data import.
  • Validate your data’s structure and accessibility.
You can run a simple query to ensure Kameleoon can access the right databases and tables. You can also download a small sample of the dataset to confirm that the schema, permissions, and contents match your expectations.

Updating a Data Ingestion Task

To update a Data Ingestion Task:
  1. Select the task: Begin by selecting the specific Data Ingestion Task you want to edit from the dropdown menu.
Data ingestion task dropdown open, listing the task 12314 - User City.
  1. Edit task details: Modify the fields you want to update, such as the task’s name, frequency, Databricks Catalog, Schema, or query.
Edit data ingestion task form for User City, with its Name, Frequency, Databricks Catalog, Schema and Query fields filled in.
  1. Confirm changes: After making the necessary updates, click Confirm to save the changes to the Data Ingestion Task.

Deleting a Data Ingestion Task

To delete a Data Ingestion Task:
Data ingestion task dropdown listing the task 12314 - User City.
  1. Select the task: Choose the Data Ingestion Task you wish to delete from the dropdown menu.
Edit data ingestion task form with the Delete ingestion task link highlighted in red.
  1. Initiate deletion: Click the delete icon located in the top-right of the Edit form.
  2. Confirm deletion: A confirmation prompt will appear. Click Confirm to delete the selected Data Ingestion Task.

Targeting your imported audiences

See how to target your warehouse audiences