Repository navigation
Commit 96fb5f2
Fix column lineage transformation details always appearing as null (#3100)
Marquez's internal LineageEvent.ColumnLineageInputField model (used
to deserialize the OpenLineage ColumnLineageDatasetFacet on
ingestion) only captured namespace/name/field for each input field -
it had no `transformations` property at all. The write path
(OpenLineageDao.upsertColumnLineage) only ever read
transformationDescription/transformationType off the *output
column* object (ColumnLineageOutputColumn), which per the current
OpenLineage spec are explicitly deprecated:
https://github.com/OpenLineage/OpenLineage/blob/main/spec/facets/ColumnLineageDatasetFacet.json
Modern producers report transformation details per input field
instead, via a `transformations` array nested under each entry of
`inputFields[]` (each with type/subtype/description/masking) - this
is exactly the format shown in the issue's example JSON. Since
Marquez's ingestion model didn't have a `transformations` field to
deserialize that array into, and never read the deprecated
output-column-level fields from producers that only emit the new
format, transformation_description/transformation_type were written
as null for any producer using the current (non-deprecated) facet
shape - reproducing the bug exactly as reported.
Fix:
- Added `transformations` (List<Transformation>) to
LineageEvent.ColumnLineageInputField, with a new nested
Transformation class (type, subtype, description, masking)
mirroring the OpenLineage spec. The existing 3-arg constructor
(namespace, name, field) is preserved unchanged, so no existing
call site needed to be touched.
- Added OpenLineageDao.transformationOf(inputField, outputColumn),
a small pure function that resolves the (description, type) pair
for a given input field: prefer the first entry of that specific
input field's (non-deprecated) `transformations` list; fall back
to the deprecated whole-output-column
transformationDescription/transformationType for producers that
still only report the old format.
- Updated OpenLineageDao.upsertColumnLineage to resolve the
transformation per matched input field (via transformationOf)
and group input fields by their resolved (description, type)
before calling the existing ColumnLineageDao.upsertColumnLineageRow(...)
batch API once per group. This correctly persists a distinct
transformation per input/output field edge - which the
column_lineage table and the read path (ColumnLineageService,
which already surfaces per-input-field transformation info) both
already supported - without changing
ColumnLineageDao's public method signature, so no existing
ColumnLineageDaoTest call sites needed to change.
Tests:
- api/src/test/java/marquez/db/OpenLineageDaoColumnLineageTransformationTest.java
(new, tagged UnitTests, no DB required): exercises
OpenLineageDao.transformationOf(...) directly against the exact
scenario from the issue (an output column with no deprecated
fields set, fed by input fields that each report their own
`transformations` entry), plus the multi-input-field, fallback,
"both formats absent", and "multiple transformations reported"
cases. I verified these tests explicitly: temporarily reverted
transformationOf(...) to the old behavior (always read the
deprecated output-column-level fields) and confirmed 3 of 5
tests fail with the expected description/type coming back null -
then restored the fix and confirmed all 5 pass.
- OpenLineageDaoTest#testUpdateMarquezModelDatasetWithColumnLineageFacet_usesNewTransformationsFormat
(new): full DB-backed regression test that builds a
ColumnLineageDatasetFacet using only the new
inputFields[].transformations[] format (deprecated fields left
unset, as real modern producers do) and asserts the persisted
ColumnLineageRow has the expected non-null transformation
description/type.
Test evidence: ./gradlew :api:testUnit passes (123 tests, including
the 5 new pure-function tests). I was not able to execute
OpenLineageDaoTest (Postgres-backed) locally in this sandbox -
Testcontainers fails to negotiate with the local Docker Engine (old
docker-java client defaults to Docker API v1.32, local engine
requires >= v1.40); this is a pre-existing environment limitation
that affects every DB-backed test in the suite, not something
introduced by this change (verified identically on unmodified tests
like RunDaoTest). ./gradlew :api:compileTestJava passes, confirming
the new integration test at least compiles correctly against the
real DAO/model classes.
Fixes #3100
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mohit Kalra <mohit2494@gmail.com>1 parent 180f37b commit 96fb5f2
4 files changed
Lines changed: 339 additions & 24 deletions
File tree
- api/src
- main/java/marquez
- db
- service/models
- test/java/marquez/db
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1049 | 1049 | | |
1050 | 1050 | | |
1051 | 1051 | | |
1052 | | - | |
1053 | | - | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
1054 | 1067 | | |
1055 | | - | |
| 1068 | + | |
1056 | 1069 | | |
1057 | 1070 | | |
1058 | 1071 | | |
| |||
1061 | 1074 | | |
1062 | 1075 | | |
1063 | 1076 | | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
1071 | 1090 | | |
1072 | 1091 | | |
1073 | | - | |
| 1092 | + | |
1074 | 1093 | | |
1075 | 1094 | | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1087 | 1109 | | |
1088 | 1110 | | |
1089 | 1111 | | |
1090 | 1112 | | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
1091 | 1143 | | |
1092 | 1144 | | |
1093 | 1145 | | |
| |||
Lines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
633 | | - | |
634 | | - | |
635 | 633 | | |
636 | 634 | | |
637 | 635 | | |
| |||
642 | 640 | | |
643 | 641 | | |
644 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
645 | 681 | | |
646 | 682 | | |
647 | 683 | | |
| |||
Lines changed: 153 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
0 commit comments