Skip to content

Commit 0dea573

Browse files
allow nullable column type in column-lineaeg (#2272)
Signed-off-by: Pawel Leszczynski <leszczynski.pawel@gmail.com> Signed-off-by: Pawel Leszczynski <leszczynski.pawel@gmail.com>
1 parent 36e94ce commit 0dea573

4 files changed

Lines changed: 17 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Changelog
22

33
## [Unreleased](https://github.com/MarquezProject/marquez/compare/0.28.0...HEAD)
4+
5+
### Added
6+
47
* Column-lineage endpoints supports point-in-time requests [`#2265`](https://github.com/MarquezProject/marquez/pull/2265) [@pawel-big-lebowski](https://github.com/pawel-big-lebowski)
58
*Enable requesting `column-lineage` endpoint by a dataset version, job version or dataset field of a specific dataset version.*
69

10+
### Fixed
11+
12+
* Allow null column type in column-lineage [`#2272`](https://github.com/MarquezProject/marquez/pull/2272) [@pawel-big-lebowski](https://github.com/pawel-big-lebowski)
713
* Include error message for JSON processing exception [`#2271`](https://github.com/MarquezProject/marquez/pull/2271) [@pawel-big-lebowski](https://github.com/pawel-big-lebowski)
814
*In case of JSON processing exceptions Marquez API should return exception message to a client.*
915

api/src/main/java/marquez/db/mappers/ColumnLineageNodeDataMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public ColumnLineageNodeData map(ResultSet results, StatementContext ctx) throws
3939
stringOrThrow(results, Columns.DATASET_NAME),
4040
uuidOrThrow(results, Columns.DATASET_VERSION_UUID),
4141
stringOrThrow(results, Columns.FIELD_NAME),
42-
stringOrThrow(results, Columns.TYPE),
42+
stringOrNull(results, Columns.TYPE),
4343
stringOrNull(results, TRANSFORMATION_DESCRIPTION),
4444
stringOrNull(results, TRANSFORMATION_TYPE),
4545
toInputFields(results, "inputFields"));

api/src/main/java/marquez/db/models/ColumnLineageNodeData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ColumnLineageNodeData implements NodeData {
1919
@NonNull String dataset;
2020
@Nullable UUID datasetVersion;
2121
@NonNull String field;
22-
@NonNull String fieldType;
22+
@Nullable String fieldType;
2323
String transformationDescription;
2424
String transformationType;
2525
@NonNull List<InputFieldNodeData> inputFields;

api/src/test/java/marquez/db/ColumnLineageDaoTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,15 @@ void testGetLineageWhenJobRunMultipleTimes() {
474474
.isEqualTo(lineageRow.getInputs().get().get(0).getDatasetVersionRow().getUuid());
475475
}
476476

477+
@Test
478+
void testGetLineageWhenDataTypeIsEmpty() {
479+
Dataset datasetWithNullDataType = getDatasetB();
480+
datasetWithNullDataType.getFacets().getSchema().getFields().get(0).setType(null);
481+
482+
UpdateLineageRow lineageRow = createLineage(openLineageDao, dataset_A, datasetWithNullDataType);
483+
getColumnLineage(lineageRow, "col_c");
484+
}
485+
477486
private Set<ColumnLineageNodeData> getColumnLineage(UpdateLineageRow lineageRow, String field) {
478487
UpdateLineageRow.DatasetRecord datasetRecord = lineageRow.getOutputs().get().get(0);
479488
UUID field_UUID = fieldDao.findUuid(datasetRecord.getDatasetRow().getUuid(), field).get();

0 commit comments

Comments
 (0)