Skip to content

Commit 9c80936

Browse files
Lineage Improvements (#24919)
* Lineage Improvements 1. Add path preservation 2. Add Column Filter * Remove impl doc * Add Lineage Strategies for efficient loading of graphs * Update getByEntityCount * Update generated TypeScript types * Add Builder * Fix Build Issue * Make NodOpProgressTracker have empty constructor --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 66f2cb4 commit 9c80936

37 files changed

Lines changed: 5301 additions & 60 deletions

openmetadata-service/src/main/java/org/openmetadata/service/resources/lineage/LineageResource.java

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,18 @@ public SearchLineageResult searchLineage(
228228
@Parameter(description = "Size field to limit the no.of results returned, defaults to 10")
229229
@DefaultValue("1000")
230230
@QueryParam("size")
231-
int size)
231+
int size,
232+
@Parameter(
233+
description =
234+
"Column-level lineage filter. Supports filtering by column names, tags, or glossary terms (e.g., 'columnName:customer_id', 'tag:PII', 'glossary:BusinessTerm')")
235+
@QueryParam("columnFilter")
236+
String columnFilter,
237+
@Parameter(
238+
description =
239+
"When true, preserves all nodes in the path to filtered results. When false, only returns nodes matching the filter. Default is true.")
240+
@QueryParam("preservePaths")
241+
@DefaultValue("true")
242+
Boolean preservePaths)
232243
throws IOException {
233244
return Entity.getSearchRepository()
234245
.searchLineage(
@@ -241,7 +252,9 @@ public SearchLineageResult searchLineage(
241252
.withIsConnectedVia(isConnectedVia(entityType))
242253
.withLayerFrom(from)
243254
.withLayerSize(size)
244-
.withIncludeSourceFields(getRequiredLineageFields(includeSourceFields)));
255+
.withIncludeSourceFields(getRequiredLineageFields(includeSourceFields))
256+
.withColumnFilter(columnFilter)
257+
.withPreservePaths(preservePaths));
245258
}
246259

247260
@GET
@@ -329,7 +342,18 @@ public SearchLineageResult searchLineageWithDirection(
329342
@Parameter(description = "Size field to limit the no.of results returned, defaults to 10")
330343
@DefaultValue("1000")
331344
@QueryParam("size")
332-
int size)
345+
int size,
346+
@Parameter(
347+
description =
348+
"Column-level lineage filter. Supports filtering by column names, tags, or glossary terms (e.g., 'columnName:customer_id', 'tag:PII', 'glossary:BusinessTerm')")
349+
@QueryParam("columnFilter")
350+
String columnFilter,
351+
@Parameter(
352+
description =
353+
"When true, preserves all nodes in the path to filtered results. When false, only returns nodes matching the filter. Default is true.")
354+
@QueryParam("preservePaths")
355+
@DefaultValue("true")
356+
Boolean preservePaths)
333357
throws IOException {
334358
return Entity.getSearchRepository()
335359
.searchLineageWithDirection(
@@ -343,7 +367,9 @@ public SearchLineageResult searchLineageWithDirection(
343367
.withDirection(direction)
344368
.withLayerFrom(from)
345369
.withLayerSize(size)
346-
.withIncludeSourceFields(getRequiredLineageFields(includeSourceFields)));
370+
.withIncludeSourceFields(getRequiredLineageFields(includeSourceFields))
371+
.withColumnFilter(columnFilter)
372+
.withPreservePaths(preservePaths));
347373
}
348374

349375
@GET

openmetadata-service/src/main/java/org/openmetadata/service/resources/settings/SettingsCache.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,23 @@ private static void createDefaultConfiguration(OpenMetadataApplicationConfig app
223223
new LineageSettings()
224224
.withDownstreamDepth(2)
225225
.withUpstreamDepth(2)
226-
.withLineageLayer(LineageLayer.ENTITY_LINEAGE));
226+
.withLineageLayer(LineageLayer.ENTITY_LINEAGE)
227+
.withGraphPerformanceConfig(
228+
new org.openmetadata.schema.api.lineage.GraphPerformanceConfig()
229+
.withSmallGraphThreshold(5000)
230+
.withMediumGraphThreshold(50000)
231+
.withMaxInMemoryNodes(100000)
232+
.withSmallGraphBatchSize(10000)
233+
.withMediumGraphBatchSize(5000)
234+
.withLargeGraphBatchSize(1000)
235+
.withStreamingBatchSize(500)
236+
.withEnableCaching(true)
237+
.withCacheTTLSeconds(300)
238+
.withMaxCachedGraphs(100)
239+
.withEnableProgressTracking(false)
240+
.withProgressReportInterval(1000)
241+
.withUseScrollForLargeGraphs(true)
242+
.withScrollTimeoutMinutes(5)));
227243
Entity.getSystemRepository().createNewSetting(setting);
228244
}
229245

0 commit comments

Comments
 (0)