I have an idea to implement lineage capabilities for unstructured data—similar to the structured data lineage found in Apache Atlas or OpenLineage—within the current project

Author: fightBoxingCreated Jul 10, 2026Updated Jul 26, 2026
Labelsenhancement

Before Submitting

  • I have asked the Data-Juicer Q&A Copilot (available on Doc Site, DingTalk, or Discord) about this feature, but still want to submit it as a formal request.

  • I have searched the Data-Juicer issues and found no similar feature requests.

Description

The context is that clients in the financial sector possess vast amounts of unstructured data that is often poorly managed; given that lineage management for structured data in legacy data warehouses is already highly mature, I am exploring whether unstructured data lineage can be managed in a similar fashion.

Use Case

No response

Proposed Solution

一、方案定位与核心理念

1.1 方案定位

不是:"把结构化血缘搬到 Data-Juicer" ❌ 而是:"为多模态非结构化数据处理,构建一套原生、精准、可审计的血缘体系",并与 OpenLineage 生态标准兼容 ✅

1.2 五大设计原则

原则 说明
模态原生(Modality-Native) 图像/视频/音频/文本各自有专属血缘 Facet,不强求统一
内容寻址(Content-Addressable) 用内容指纹而非文件路径做血缘主键,跨存储迁移不断链
拓扑感知(Topology-Aware) 显式建模 1对N(拆分)、N对1(聚合)、N对M(去重)关系
标准兼容(Standard-Compatible) 遵循 OpenLineage 规范,通过 Custom Facet 扩展多模态语义
成本可控(Cost-Configurable) 提供 minimal / standard / full 三档,让用户自行权衡开销

二、现状差距与目标矩阵

2.1 Data-Juicer 已有能力盘点

层次 已有资产 完备度
样本级追踪 Tracer / RayTracer ✅ 完善
事件日志 EventLoggingMixin + 8 种 EventType ✅ 完善
Pipeline 拓扑 PipelineDAG ✅ 完善
内容哈希 HashKeys.hash/minhash/simhash/imagehash/videohash 有资产但未串联
Agent 场景元数据 agent_request_model / agent_pt / agent_request_id 局部场景
文件级溯源 _data_source_provenance_block(HTML 报告内) 报告级
数据集/字段级血缘 ❌ 无 ❌ 需新建
资产级血缘 ❌ 无 ❌ 需新建
LLM 调用血缘 ❌ 无 ❌ 需新建
合规链 ❌ 无(虽有 PII/NSFW 算子) ❌ 需新建
去重等价类血缘 ❌ 无 ❌ 需新建

2.2 目标能力矩阵

                          ┌───────────────────────────────────────┐
                          │       Data-Juicer Lineage v2.0        │
                          └───────────────────────────────────────┘
                                          │
    ┌──────────────┬──────────────┬──────┴───────┬──────────────┬──────────────┐
    ▼              ▼              ▼              ▼              ▼              ▼
┌────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐
│Pipeline│  │ Dataset  │  │ Column   │  │ Asset    │  │  LLM     │  │Compliance│
│Lineage │  │ Lineage  │  │ Lineage  │  │ Lineage  │  │ Lineage  │  │ Lineage  │
│(Run/Job)│  │(输入/输出)│  │(字段映射)│  │(多模态)  │  │(模型调用)│  │(PII/水印)│
└────────┘  └──────────┘  └──────────┘  └──────────┘  └──────────┘  └──────────┘
                                          │
                          ┌───────────────┴───────────────┐
                          ▼                                ▼
                  ┌──────────────┐              ┌──────────────────┐
                  │  Sample      │              │  Dedup           │
                  │  Lineage     │              │  Equivalence     │
                  │  (1→N/N→1)   │              │  Class Lineage   │
                  └──────────────┘              └──────────────────┘

三、总体架构

┌────────────────────────────────────────────────────────────────────────────────┐
│                         Data-Juicer Pipeline Execution                          │
│                                                                                │
│   Executor(LocalExecutor / RayExecutor)                                       │
│      │                                                                         │
│      │  钩子注入:before_op / after_op / on_error                              │
│      ▼                                                                         │
│  ┌──────────────────────────────────────────────────────────────────────┐     │
│  │                    Lineage Collector(中心协调器)                    │     │
│  │                                                                       │     │
│  │  ┌─────────────┐ ┌────────────┐ ┌────────────┐ ┌─────────────────┐   │     │
│  │  │Pipeline     │ │Dataset     │ │Column      │ │Asset            │   │     │
│  │  │Recorder     │ │Recorder    │ │Recorder    │ │Recorder         │   │     │
│  │  │             │ │            │ │            │ │(多模态资产)      │   │     │
│  │  └─────────────┘ └────────────┘ └────────────┘ └─────────────────┘   │     │
│  │  ┌─────────────┐ ┌────────────┐ ┌────────────┐ ┌─────────────────┐   │     │
│  │  │LLM Call     │ │Compliance  │ │Dedup       │ │Sample Lineage   │   │     │
│  │  │Recorder     │ │Recorder    │ │Recorder    │ │Recorder (1→N)   │   │     │
│  │  └─────────────┘ └────────────┘ └────────────┘ └─────────────────┘   │     │
│  └──────────────────────────────────────────────────────────────────────┘     │
│      │                                                                         │
│      │  数据源:                                                                │
│      │   - Op 声明的 declare_columns()                                          │
│      │   - HashKeys 内容指纹                                                    │
│      │   - Tracer 采样样本                                                      │
│      │   - EventLog 事件流                                                      │
│      │   - MetaKeys.llm_semantic_usage                                          │
│      ▼                                                                         │
│  ┌──────────────────────────────────────────────────────────────────────┐     │
│  │                   OpenLineage Event Builder                          │     │
│  │  RunEvent = { eventType, run, job, inputs, outputs, facets }         │     │
│  │       + Custom Facets:                                               │     │
│  │         AssetFacet / LLMFacet / ComplianceFacet / DedupFacet /       │     │
│  │         SampleTopologyFacet / MultiModalSchemaFacet                  │     │
│  └──────────────────────────────────────────────────────────────────────┘     │
│      │                                                                         │
│      ▼                                                                         │
│  ┌──────────────────────────────────────────────────────────────────────┐     │
│  │                          Emitter Layer                                │     │
│  │  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌────────────┐            │     │
│  │  │File      │  │HTTP      │  │Kafka     │  │Composite   │            │     │
│  │  │Emitter   │  │Emitter   │  │Emitter   │  │Emitter     │            │     │
│  │  │(JSONL)   │  │(Marquez/ │  │(Stream)  │  │(多路输出)   │            │     │
│  │  │          │  │ Atlas)   │  │          │  │            │            │     │
│  │  └──────────┘  └──────────┘  └──────────┘  └────────────┘            │     │
│  └──────────────────────────────────────────────────────────────────────┘     │
│                                                                                │
└────────────────────────────────────────────────────────────────────────────────┘
              │                    │                    │
              ▼                    ▼                    ▼
   ┌──────────────────┐  ┌──────────────────┐  ┌──────────────────┐
   │ Marquez / Atlas  │  │ Local JSONL      │  │ Streamlit App    │
   │ (Web UI + Graph) │  │ (审计归档)        │  │ (血缘视图 Tab)   │
   └──────────────────┘  └──────────────────┘  └──────────────────┘

Additional Context

No response

Are you willing to submit a PR for this feature?

  • Yes I'd like to help by submitting a PR!