SQL Ingestion Migration
The new SQL Ingestion feature enhances the user interface and introduces a new way to execute CData SQL jobs. Most importantly, you will now be able to preview SQL queries for ingestion to get to the correct ingestion result quickly. This guide will help you migrate from the traditional column-based imports to the new SQL Ingestion feature.
Key Features
-
UI Experience:
- Offers authoring and previewing of CData queries.
- Available behind a feature flag and can be enabled per space.
- Will become the default UI experience in the future.
-
Jobs Execution:
- Available alongside traditional CData integrations for all customers on production.
- Start using it immediately to work around the limitations of column-based CData ingestion.
Enabling SQL Ingestion UI
You can enable the new SQL Ingestion UI for a space without affecting existing jobs. After enabling the SQL Ingestion UI, you will not have access to the UI for editing column-based CData ingestion, but you can still make edits in the YAML.
Migrate Column-Based Assets to SQL Ingestion Assets
-
Open Connector YAML File:
- Locate and open the YAML file for the connector and table you wish to migrate.
- Note the source name and table name.
_31version: 3_31_31sources:_31 - name: cdata-youtube # <<< SOURCE_NAME_31 config:_31 y42_source:_31 type: cdata-youtubeanalytics_31 connection: my-youtube_31 y42:_31 apiVersion: v3_31 meta:_31 experts:_31 users:_31 - data-expert@y42.com_31 tables:_31 - name: Videos # <<< TABLE_NAME_31 config:_31 y42_table:_31 import: Videos_31 columns:_31 - Id_31 - ChannelId_31 - CategoryId_31 - ..._31 group: null_31 supported_sync_modes:_31 - full_refresh_31 default_cursor_field: []_31 source_defined_cursor: "False"_31 source_defined_primary_key:_31 - - Id
-
Retrieve Query from Logs:
- Access the build history and view the latest job logs.
- Note the query executed in this job.
Ingestion build logs query
-
Create SQL File:
- Create a new file in the
sql_ingest
folder named{SOURCE-NAME}_{TABLE-NAME}.sql
.
- Create a new file in the
- cdata-youtube_Videos.sql
- dbt_project.yml
- Paste the query previously copied from the logs into the new file.
- Remove any backslashes (
\
) used to escape special characters.
_10SELECT_10 Id,_10 ChannelId,_10 CategoryId,_10 ..._10FROM_10 Videos
-
Update Connector YAML File:
- Locate and open the YAML file for the connector and table you wish to migrate.
- Remove all child keys of
y42_table
and add the single keyquery_file
with the value{SOURCE-NAME}_{TABLE-NAME}
.
_19version: 3_19_19sources:_19 - name: cdata-youtube # <<< SOURCE_NAME_19 config:_19 y42_source:_19 type: cdata-youtubeanalytics_19 connection: my-youtube_19 y42:_19 apiVersion: v3_19 meta:_19 experts:_19 users:_19 - data-expert@y42.com_19 tables:_19 - name: Videos # <<< TABLE_NAME_19 config:_19 y42_table:_19 query_file: cdata-youtube_Videos
-
Navigate to List Mode
- Select the table you wish to migrate and run a preview.
- Verify the returned data and make changes as needed.
-
Commit and build
- Commit your changes to git and trigger a new build.
Frequently Asked Questions
I am already running my own query specified in the YAML. Do you still have to migrate to SQL Ingestion?
SQL Ingestion will give you a much richer editing experience and fast preview of quer results. While you do not have to migrate to SQL Ingestion for now, we highly recommend it.