EXPLAIN OPENLINEAGE to export a semantic view’s declared dataset and column dependencies as standard OpenLineage JSON. It includes facts, dimensions, metrics and the computation definitions that connect them to source datasets. This is design-time lineage: the statement does not execute or materialize the computation, create an SV, or modify catalog metadata.
Syntax
CREATE SEMANTIC VIEW declaration.
Usage
Export a saved semantic view
For an existingexample_db.sales_sv:
Analyze a declaration without creating the semantic view
Supposeexample_db.orders already has columns id, amount and discount:
sales_preview. The database and referenced sources must already exist. A dry-run declaration does not require CREATE_VIEW; SELECT privileges are checked on every exposed source. Named input additionally requires SELECT on the target SV.
Choose the lineage depth
Physical tables are leaves in every mode. Missing sources, insufficient privileges, unsupported expansion or cyclic dependencies are errors, not permission to guess a partial physical pipeline. Depth controls expansion, not SQL execution or materialization.
Interpret the output
Each SQL result row is one standard OpenLineage JSON event, not a private wrapper:- A table, View, MV or SV is a Dataset. DatasetEvents carry schema and lineage metadata.
- An expanded computation declaration is a Job with a JobEvent containing declared inputs/outputs and SQL.
- No Run or RunEvent is emitted: analyzing a declaration is not an execution instance.
- Facts, dimensions and metrics appear in
schema.fields, with their semantic role in standard field tags (semantic_role) and their expression in the field description. lineage.fieldsrecords direct column dependencies;lineage.inputsalso records dataset-wide controls such as FILTER and JOIN. Job SQL preserves the declaration’s computation.- A constant or
COUNT(*)can have no direct input column while still depending on source datasets. An empty field-input list does not mean there is no lineage.
Save the JSON
Adjust the connection options for your cluster. The MySQL client’s raw batch output preserves one JSON event per line (NDJSON).Example: a semantic view over logical views
This case usessv_recommendation/tpcds_test/query06. The linked JSON files are actual exports archived on October 23, 2026, not hand-written examples or a fresh run of the latest implementation. Empty physical tables were sufficient for metadata/lineage verification; these files do not prove populated-data query equivalence.
Definitions
The five physical tables arestore_sales, customer, customer_address, date_dim, and item. Two logical views filter the date and item inputs. The SV declares 12 dimensions, one metric, and no facts.
Full source files, including the original empty semantic-metadata placeholders:
- SV DDL
- Date view DDL
- Item view DDL
- Physical table DDL: store_sales, customer, customer_address, date_dim, item.
JSON output
Each SQL result row is one standard JSON event. The downloadable.ndjson files preserve these rows verbatim, without a private wrapper. In the archived test, the database qualifier was changed from tpcds_1g to isolated database ol_corpus_3be7062938_tpcds; the namespace is starrocks://582847750/default_catalog. Business expressions are unchanged. The metadata-only fixture also reduced physical bucket counts and replication; these storage settings do not affect the lineage shown here.
VERBOSE and FULL are identical after removing only
eventTime in this case: both views directly depend on physical tables. FULL preserves intermediate views rather than flattening away their definitions.
The SV’s standard schema has 13 fields. Standard field tags identify DIMENSION or METRIC through semantic_role; no custom facet is needed. For example, this is an extracted fragment of dataset.facets.lineage.fields, not a complete standalone event:
item.i_category → v_i_06_1.i_category, completing the two-edge physical-to-semantic path. Its standard Job SQL facet retains the correlated average-price filter. The standard legacy columnLineage facet is also present for consumers that support it.
COUNT(*) reads a row set, not the value of an individual column. Its empty direct field inputs are intentional; its expression is retained in the schema description and Job SQL. Dataset inputs and indirect controls describe the surrounding dependencies. Do not fabricate a physical-column-to-count edge.
Dataset and column lineage
Rectangular nodes in dataset graphs are Datasets; rounded nodes are definition Jobs, not execution Runs. Column graphs show every exported field dependency: solid blue edges are direct identity mappings; dashed edges terminate at dataset-wide FILTER/JOIN controls, not at invented per-field dependencies. Database qualifiers are omitted from image labels only; the raw JSON is unchanged. The column graphs contain all 13 SV fields. VERBOSE/FULL additionally show all four date-view fields and six item-view fields, including view output columns not selected as SV dimensions.BRIEF


v_d_06_1 and v_i_06_1 and therefore does not export their underlying filters.
VERBOSE


FULL


Indirect controls
The date view records FILTER dependencies ondate_dim.d_year, d_moy, and d_month_seq. The item view records FILTER dependencies on item.i_category and i_current_price, including the correlated category comparison and the average-price expression in Job SQL. These controls influence row selection, not the direct value identity mappings.
The SV records eight JOIN endpoint dependencies for these four declared relationships:
These controls live in
lineage.inputs; direct value mappings live in lineage.fields. A consumer must consider both, together with Job SQL, to interpret the declared computation.
Check exported references
For exports of the same unchanged SV, the following inline Python example checks that dataset/column references resolve, including dataset-wide controls. It is a lightweight referential check, not a replacement for the official OpenLineage JSON Schemas. No repository-specific test utility is required.docs/_assets/semantic-view-openlineage-query06. The @site resource alias resolves them through the Docusaurus site directory even when language trees are relocated. There are no localized copies, DOT sources or separate rendering/test scripts.