Repository navigation
Fixes #36788: keep OpenLineage column lineage for names with reserved characters or dots - #36789
Conversation
…dots extractColumnLineage built column FQNs from the raw field name, so `a>b` and `c.d` matched neither `a__reserved__arrow__b` nor `"c.d"`, and validateLineageDetails dropped their lineage without reporting it. Match each field against the stored columns of its table instead. A dot in a field is either part of a name or a path to a nested column, and only the stored columns can tell which. A table created from an event now stores the same names connectors do.
The connector built column FQNs from the name of the fetched column. That name has its reserved characters decoded and its dots unquoted, so `a>b` and `c.d` matched no real column and the server dropped their lineage without reporting it. Send the FQN the column already carries.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
extractColumnLineage read every input for every output, including inputs the facet never names, so an event with several outputs repeated those table loads. Keep the read columns for the whole event and load an input only when a field references it. Add the decision record for how a field resolves to a stored column and which name a created column takes. The Java server and the Python ingestion now have to agree on that format, and the PR description does not reach git log.
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Resolve the conflict with open-metadata#36867 in the OpenLineage connector: _match_column_fqn keeps returning the stored column FQN, and keeps main's rule that an unmatched field of a sharded table resolves to None and is skipped. Add a test for that combined behaviour.
The test had been inserted between assertAuditFieldsStamped and its Javadoc, so the Javadoc described the wrong method.
Code Review ✅ Approved 🟡 Medium risk 2 closed / 2 findingsResolving OpenLineage fields against stored column FQNs changes lineage mapping; a mismatch could omit or misattribute column lineage. Keeps OpenLineage column lineage for names with reserved characters or dots by resolving event fields against stored column FQNs on both the server and the connector. Resolved this session: the shared reserved-name encoding and field resolution order are now recorded, and input table columns are read once per event rather than re-fetched for every output dataset. No open issues found. ✅ 2 closed✅ Quality: Shared reserved-name encoding and field resolution order are unrecorded
✅ Performance: Input table columns are re-fetched for every output dataset
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
… characters or dots (#36789) (#38902) * Fix OpenLineage column lineage for names with reserved characters or dots extractColumnLineage built column FQNs from the raw field name, so `a>b` and `c.d` matched neither `a__reserved__arrow__b` nor `"c.d"`, and validateLineageDetails dropped their lineage without reporting it. Match each field against the stored columns of its table instead. A dot in a field is either part of a name or a path to a nested column, and only the stored columns can tell which. A table created from an event now stores the same names connectors do. * Use stored column FQNs in OpenLineage connector column lineage The connector built column FQNs from the name of the fetched column. That name has its reserved characters decoded and its dots unquoted, so `a>b` and `c.d` matched no real column and the server dropped their lineage without reporting it. Send the FQN the column already carries. * Read OpenLineage input columns once per event and record the field rule extractColumnLineage read every input for every output, including inputs the facet never names, so an event with several outputs repeated those table loads. Keep the read columns for the whole event and load an input only when a field references it. Add the decision record for how a field resolves to a stored column and which name a created column takes. The Java server and the Python ingestion now have to agree on that format, and the PR description does not reach git log. * Move the special-field-names IT out of the helpers section The test had been inserted between assertAuditFieldsStamped and its Javadoc, so the Javadoc described the wrong method. --------- (cherry picked from commit cff416d) Co-authored-by: ccurve1870 <83492121+ccurve1870@users.noreply.github.com> Co-authored-by: ccurve1870 <hammerous@gmail.com> Co-authored-by: ulixius9 <mayursingal9@gmail.com>
Describe your changes:
Fixes #36788
Related: #35973, which closes the same reserved-character gap for the dbt
DataModel.The rule is recorded in
ADR:2026-11-01-openlineage-fields-resolve-against-stored-columns.Spark reports column lineage with raw column names. Both OpenLineage paths built each FQN by concatenating a column name, so
a>bandc.dmatched neithera__reserved__arrow__bnor"c.d", andvalidateLineageDetailsdropped their lineage while the event still succeeded.Server API (
POST /v1/openlineage/lineage)OpenLineageMappernow resolves each field against the stored columns of its table. A dot in a field is either part of a name ("c.d") or a path to a nested column (s.x), and only the stored columns can tell which, so quoting every dotted name would have broken nested lineage.>keeps matching, then with the name connectors store (OpenLineageColumnMapper.toStoredName, in step withreplace_separatorsincustom_basemodel_validation.py).OpenLineageColumnMapper.toColumnuses the same stored name, so a table created from an event matches what a later metadata ingestion writes.OpenLineage connector (Kafka/Kinesis)
PUT /v1/lineageand never reachesOpenLineageMapper._match_column_namebecomes_match_column_fqnand returns the FQN of the matched column, because a fetched column name is decoded and differs from its FQN segment. A field with no stored column keeps the lowercase fallback.Backport request: the bug reproduces on 2.0.6, whose
OpenLineageMapperhas the same concatenation. 2.0 has noOpenLineageColumnMapper, so a cherry-pick will conflict there. Could this be backported to 2.0 as well?Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
a>b,c.d,e.>fand.>s.x)>keeps matchingUnit tests
OpenLineageMapperTest,OpenLineageColumnMapperTest,OpenLineageEntityResolverTest,ingestion/tests/unit/topology/pipeline/test_openlineage.pymapRunEvent_fieldWithReservedCharacter_reachesTheStoredColumn,mapRunEvent_fieldWithDot_reachesTheQuotedColumn,createdColumnTakesItsStoredNameandtest_get_column_lineage_uses_stored_fqn_of_special_column_namesfail.test_openlineage.pyandtest_openlineage_ownership.py, 148 passed, run with this branch's connector sources on theopenmetadata-ingestion==2.0.6.0generated models.ruff format --checkandruff checkpass with ruff 0.15.22.Backend integration tests
openmetadata-integration-tests/for new/changed API endpoints.OpenLineageLineageResolutionIT#columnLineage_reachesStoredColumnsOfSpecialFieldNamesRun locally on JDK 21 with
-Pmysql-elasticsearch -DintegrationTests.lane=parallel, basece5ecdd53c:plan_local_java_tests.py, on the first commit: 1256 run, 0 failures, 0 errors, 64 skippedOpenLineageLineageResolutionITandOpenLineageResourceIT, 51 run, 0 failures; the 4 impacted unit test classes, 159 run, 0 failuresIngestion integration tests
tests/integration/openlineage/covers Kafka offsets, which this PR does not change. Connector behaviour is covered by the unit test above and the manual run below.Playwright (UI) tests
Manual testing performed
a>b,c.d,e.>fand.>, and ran the Postgres metadata ingestion.openlineage-spark_2.13:1.55.0, sending events to/api/v1/openlineage/lineage.a>bandc.d, whereidandamountwere kept)."e.__reserved__arrow__f"and".__reserved__arrow__".idandamountonly with the currentmainconnector, all six columns with this branch.UI screen recording:
Not applicable — backend-only bug fix.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #36788above.🤖 Generated with Claude Code
Fix nested column matching in the connector and add the required result assertions before merging.
Findings
Summary
The PR resolves OpenLineage fields through stored column FQNs and gives newly created columns the same reserved-character spelling used by ingestion.
Acknowledgments by ccurve1870 in the supplied decision record: literal dotted names and nested paths may share one lookup key, with the later column winning; the Java and Python keyword lists have no shared parity test.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR E[OpenLineage field] --> J[Server lookup] E --> P[Connector lookup] J --> T[Stored columns and children] P --> F[Stored top-level columns] T --> Q[Stored column FQN] F --> Q P -->|Nested field misses| R[Raw lowercase fallback] Q --> V[Lineage write] R --> V V -->|Unknown column name| D[Mapping dropped]Reviews (1) · Last reviewed commit: "Move the special-field-names IT out of t..." · Reviewed by Greptile