Skip to main content
This section provides guides and references for the Databend connector. Configure Databend metadata workflows externally with YAML:

How to Run the Connector Externally

To run the Ingestion via the UI you’ll need to use the OpenMetadata Ingestion Container, which comes shipped with custom Airflow plugins to handle the workflow deployment. If, instead, you want to manage your workflows externally on your preferred orchestrator, you can check the following docs to run the Ingestion Framework anywhere.

External Schedulers

Get more information about running the Ingestion Framework Externally

Requirements

OpenMetadata connects to the Databend HTTP query service with a SQLAlchemy driver, using a username and password. The connecting user must be able to read the system and information_schema metadata, and to read the databases and tables you want to ingest.

Entity Mapping

OpenMetadata ingests only the Databend default catalog. Databend objects map to OpenMetadata entities as follows:

Profiler and Data Quality

Running the profiler workflow, data quality tests, or data diff requires SELECT on the tables and schemas being profiled or tested. For more information, see Profiler Workflow and Data Quality.

Lineage Requirements

OpenMetadata reads table and column lineage from the lineage records that Databend keeps in system_history.lineage_history. Databend records lineage from its query planner, so OpenMetadata doesn’t parse SQL. Lineage requires:
  • Databend v1.2.933 or later.
  • A Databend Enterprise license.
  • [lineage] on = true and [log.history] on = true in the Databend query configuration.
  • SELECT on system_history. For example:
These requirements apply only to lineage. The metadata, profiler, and data quality workflows don’t need them. OpenMetadata creates lineage as follows:
  • View lineage: OpenMetadata reads CREATE VIEW records and keeps only the current definition of each view. When Override View Lineage is on, OpenMetadata replaces the existing view lineage.
  • Query lineage: OpenMetadata reads CREATE TABLE ... AS SELECT and data manipulation language (DML) records that fall inside the Query Log Duration.
The lineage agent has the following options:
  • Query Log Duration: How many days back OpenMetadata reads query lineage records. Defaults to 1.
  • Override View Lineage: Replaces existing view lineage. Off by default.
OpenMetadata skips the following lineage edges:
  • Edges where either table isn’t ingested in OpenMetadata yet. Run metadata ingestion first. A later run adds skipped view edges, and skipped query edges only while their records are within Query Log Duration.
  • Edges that involve an external catalog. OpenMetadata reads only the default catalog.
  • A table that is its own source, such as an in-place update.
Schema and table filter patterns also apply to lineage.

Python Requirements

Use Python 3.10 or later. Python 3.12 is recommended, because it is what the OpenMetadata 2.0 ingestion images use. To confirm the supported range for your release, check the Requires-Python metadata of that release’s openmetadata-ingestion package. To run the Databend ingestion, install:

Metadata Ingestion

All connectors are defined as JSON Schemas. See the Databend connection JSON Schema for the full set of properties. To create and run a metadata ingestion workflow, create a YAML configuration. The configuration connects to the source, processes entities if needed, and reaches the OpenMetadata server. The workflow is modeled around the following JSON Schema.

1. Define the YAML Config

Use the following YAML configuration as a starting point.

2. Run with the CLI

First, we will need to save the YAML file. Afterward, and with all requirements installed, we can run:
Note that from connector to connector, this recipe will always be the same. By updating the YAML configuration, you will be able to extract metadata from different sources. Databend lineage reads only queryLogDuration, overrideViewLineage, processViewLineage, processQueryLineage, schemaFilterPattern, and tableFilterPattern. The other keys in the shared example, such as resultLimit, parsingTimeoutLimit, filterCondition, and threads, have no effect.

Lineage

After running a Metadata Ingestion workflow, we can run Lineage workflow. While the serviceName will be the same to that was used in Metadata Ingestion, so the ingestion bot can get the serviceConnection details from the server.

1. Define the YAML Config

This is a sample config for databend Lineage:
  • You can learn more about how to configure and run the Lineage Workflow to extract Lineage data from here

2. Run with the CLI

After saving the YAML config, we will run the command the same way we did for the metadata ingestion:

Data Profiler

The Data Profiler workflow will be using the orm-profiler processor. After running a Metadata Ingestion workflow, we can run the Data Profiler workflow. While the serviceName will be the same to that was used in Metadata Ingestion, so the ingestion bot can get the serviceConnection details from the server.

1. Define the YAML Config

This is a sample config for the profiler:
  • You can learn more about how to configure and run the Profiler Workflow to extract Profiler data and execute the Data Quality from here

2. Run with the CLI

After saving the YAML config, we will run the command the same way we did for the metadata ingestion:
Note now instead of running ingest, we are using the profile command to select the Profiler workflow.

Data Profiler

Find more information about the Data Profiler here

Auto Classification

The Auto Classification workflow will be using the orm-profiler processor. After running a Metadata Ingestion workflow, we can run the Auto Classification workflow. While the serviceName will be the same to that was used in Metadata Ingestion, so the ingestion bot can get the serviceConnection details from the server.

1. Define the YAML Config

This is a sample config for the Auto Classification Workflow:

2. Run with the CLI

After saving the YAML config, we will run the command the same way we did for the metadata ingestion:
Now instead of running ingest, we are using the classify command to select the Auto Classification workflow.

Data Quality

Adding Data Quality Test Cases from yaml config

When creating a JSON config for a test workflow the source configuration is very simple.
The only sections you need to modify here are the serviceName (this name needs to be unique) and entityFullyQualifiedName (the entity for which we’ll be executing tests against) keys. Once you have defined your source configuration you’ll need to define te processor configuration.
The processor type should be set to "orm-test-runner". For accepted test definition names and parameter value names refer to the tests page.
Note that while you can define tests directly in this YAML configuration, running the workflow will execute ALL THE TESTS present in the table, regardless of what you are defining in the YAML.This makes it easy for any user to contribute tests via the UI, while maintaining the test execution external.
You can keep your YAML config as simple as follows if the table already has tests.

Key reference:

  • forceUpdate: if the test case exists (base on the test case name) for the entity, implements the strategy to follow when running the test (i.e. whether or not to update parameters)
  • testCases: list of test cases to add to the entity referenced. Note that we will execute all the tests present in the Table.
  • name: test case name
  • testDefinitionName: test definition
  • columnName: only applies to column test. The name of the column to run the test against
  • parameterValues: parameter values of the test
The sink and workflowConfig will have the same settings as the ingestion and profiler workflow.

Full yaml config example

How to Run Tests

To run the tests from the CLI execute the following command