DataHub

DataHub is a metadata platform for data discovery, governance and lineage. The DataHub technology plugin is a Hop lineage sink: it takes the in-engine lineage events of every pipeline and workflow run and writes them to DataHub, so DataHub shows which Hop pipelines read and write which files and tables, how a workflow runs its pipelines, and how every run went.

The sink writes to DataHub’s metadata API (GMS) directly. It needs nothing configured on the DataHub side and does not use DataHub’s OpenLineage endpoint. It is tested with DataHub 1.0, 1.7 and 1.8; DataHub Cloud serves the same API.

The plugin builds on the OpenLineage plugin, which has to be installed as well: it shares that plugin’s lineage mapping, asynchronous delivery and spool.

Quick start

  1. Install the DataHub and OpenLineage plugins with the Marketplace. The DataHub plugin needs the OpenLineage one.

  2. Create a Data Catalog of type DataHub with the URL of DataHub’s metadata service (GMS), for example http://localhost:8080, or https://<your-company>.acryl.io/gms on DataHub Cloud, and a personal access token. Test checks both.

  3. Create a Lineage Sink of type DataHub that uses that data catalog.

  4. Select the sink in the Lineage sink option of your pipeline and workflow run configurations.

  5. Run a workflow. In DataHub, its pipelines are listed under the Apache Hop platform, with their tasks, their runs and the datasets they read and write.

To put a whole project in DataHub without running it, see Publishing a project without running it.

What you see in DataHub

Hop DataHub

Pipeline, workflow

A pipeline (DataFlow) on the Apache Hop platform, of type Pipeline or Workflow, with the name and description from its metadata. It is identified by its file: the path in the project (pipelines/load.hpl), or the full path outside a project. Two files that hold pipelines of the same name are two pipelines in DataHub.

The sink writes the Apache Hop platform itself, with its name and logo, when DataHub doesn’t have it yet, and checks again every ten minutes. A DataHub that has the platform keeps its own, also one an older Hop version wrote. To get the current name and logo, delete the platform in DataHub (datahub delete --urn urn:li:dataPlatform:hop --hard).

Transform, action

A task (DataJob) of that pipeline, of type Transform or Action, with the datasets it read and wrote, and its description. A transform lists the transforms that feed it as upstream tasks, an action the actions a workflow hop leads from: the hops are the task graph.

A transform or action that is removed from its pipeline or workflow, or renamed, is soft-deleted in DataHub after the next successful run; it comes back if it is added again. A run that reaches DataHub late, from the spool after a newer run of the same file, is recorded as a run but changes neither the tasks nor what they read and write.

A run of any of these

A run (DataProcessInstance) named <name> <time>, for example nightly/Load orders 2026-10-18T07:34Z, with its start, its end, its outcome (success or failure) and the run that started it. A transform’s run lists its row counts (linesInput, linesOutput, linesUpdated, linesRejected, …​) in its properties, a pipeline’s run the totals of its transforms. A run whose end Hop never reported, such as an action that stopped with an error, is ended as failed when the sink shuts down.

A pipeline or workflow run by a workflow action, or a pipeline run by a transform of another pipeline (Pipeline Executor, mapping)

Its first transforms or actions list that action or transform as an upstream task, so lineage runs from the workflow into what it started; its run is a child of the run of that action or transform.

File, table

A dataset, named the way DataHub’s own sources name it: a table on its database platform (postgres, mssql, …) with its qualified name, an object as bucket/key on s3, gcs or abs, a local file as its path on file. A table on a database server with a platform instance is named with it, see Database platform instances.

Kafka topic (Kafka Consumer, Kafka Producer)

A dataset on the kafka platform named after the topic, as DataHub’s Kafka source names it. A consumer runs until it is stopped: its task lists the topic as soon as it starts reading, before the run ends.

Column mappings (SQL INSERT … SELECT, Table Input → Table Output)

Column-level lineage, on the task and on the dataset.

SQL a transform ran (Table Input, Execute SQL), expressions it calculated fields with (Formula, Calculator)

The SQL is the task’s transformation logic, when the run ran exactly one statement; a run that ran none, or several, leaves it empty. DataHub only takes SQL there, so a Formula’s or Calculator’s expressions are properties of the task instead: logic.<field> with the expression, such as logic.total = [price] * [qty], or MULTIPLY(total, rate) for a calculation.

A file or table a run wrote

An operation on the dataset when the run succeeds: INSERT, UPDATE or DELETE, or CREATE, DROP or ALTER for a dataset created, deleted, moved or renamed, with the number of rows when Hop knows them (see Row counts). A pipeline reports one operation per dataset when it completes, with the rows of all the transforms and copies that wrote it; an action reports the files it wrote when it completes. DataHub shows when a dataset last changed from its operations, and the freshness check of a Check data catalog action reads them, so a dataset that only Hop writes has a freshness too. A failed or stopped run reports no operation: a half-written table doesn’t look up to date. Neither does a run that inserted, updated or deleted no rows; a table truncated or a file rewritten with nothing written was emptied, and gets a DELETE without a row count.

A file copied or moved (Copy files, Move files)

The copy is linked to its own source as a COPY upstream, so copying several files does not pair every source with every copy. The run of the action still lists all of them.

Lineage between datasets runs through the tasks: orders.csv → Read orders → Write copy → orders-copy.csv. A pipeline that reads two files and writes two files shows the two real paths, not every input paired with every output.

Enabling the sink

The simplest way is a Lineage Sink of type DataHub, selected in a pipeline or workflow run configuration. It writes to the DataHub of a DataHub Data Catalog, with its URL, token and environment, so Hop reads from the same DataHub it writes to. The runs of that configuration report their lineage to it, and no variables are needed.

The sink can also be configured with variables, for every run of a Hop process. The lineage hub is off by default. Enable it and select the DataHub sink with these variables, as environment variables or in the Hop configuration (Tools > Edit config variables):

bash
HOP_LINEAGE_ENABLED=Y
HOP_LINEAGE_SINK_IDS=datahub
HOP_LINEAGE_DATAHUB_URL=http://localhost:8080
# with authentication enabled in DataHub (always the case on DataHub Cloud):
HOP_LINEAGE_DATAHUB_TOKEN=<personal access token>

On DataHub Cloud the URL is the GMS endpoint, https://<your-company>.acryl.io/gms. The token needs the privilege to edit lineage and entities, and to read entities: the sink checks what DataHub already holds before it writes a schema (see Dataset schemas), a deprecation, a retired task or a task’s upstream tasks. When DataHub cannot be reached for a read, the sink writes the lineage now and keeps the event to make those decisions later. A token that may not read gets the lineage without them, and the log says so once.

To send lineage to an OpenLineage collector as well, list both sinks: HOP_LINEAGE_SINK_IDS=datahub,openlineage. Do not leave HOP_LINEAGE_SINK_IDS empty: that loads every installed sink, and the OpenLineage sink, installed with this plugin, then fails to start without its URL, which stops lineage delivery for every sink.

Configuration

Variable Default Description

HOP_LINEAGE_DATAHUB_URL

(required)

DataHub GMS URL.

HOP_LINEAGE_DATAHUB_TOKEN

(empty)

DataHub personal access token, sent as a bearer token. It can be stored encrypted, as hop-encrypt writes it (Encrypted …).

HOP_LINEAGE_DATAHUB_ENV

PROD

DataHub environment of the datasets, pipelines and tasks. Use the value the other sources that describe the same datasets use, or their lineage does not join up.

HOP_LINEAGE_DATAHUB_PLATFORM_INSTANCE

(empty)

Keeps the pipelines of several Hop installations, or of projects with the same folder layout, apart in one DataHub: their ids are prefixed with it (emea.flows/nightly.hwf).

HOP_LINEAGE_DATAHUB_DATABASE_INSTANCES

(empty)

The platform instances of database servers, as <namespace>=<instance> pairs separated by commas, such as postgres://db.example.com:5432=warehouse; see Database platform instances. A sink of a Lineage Sink takes them from its data catalog instead.

HOP_LINEAGE_DATAHUB_DATASET_SCHEMA

missing

When a dataset’s schema is written; see Dataset schemas. missing, always or never.

HOP_LINEAGE_DATAHUB_LIFECYCLE

N

Y deprecates datasets a run deletes or moves; see Deleted and moved datasets.

HOP_LINEAGE_DATAHUB_ACTOR

urn:li:corpuser:datahub

The DataHub user named as the creator of runs and deprecations.

HOP_LINEAGE_DATAHUB_SPOOL_DIR

(empty)

Folder that keeps events until DataHub accepted them; see Durability.

HOP_LINEAGE_DATAHUB_SPOOL_MAX_BYTES

67108864

Size limit of the spool (64 MiB).

HOP_LINEAGE_DATAHUB_SQL_PARSE

Y

Parse the SQL of Table Input, Database Join, Execute SQL, Execute row SQL script and the SQL action to find the tables and columns it reads and writes.

HOP_LINEAGE_DATAHUB_MAX_RETRIES, …_RETRY_BACKOFF_MS, …_CONNECT_TIMEOUT_MS, …_READ_TIMEOUT_MS, …_BUFFER_SIZE, …_OVERFLOW_POLICY, …_ENQUEUE_TIMEOUT_MS, …_SHUTDOWN_DRAIN_MS, …_METRICS_INTERVAL_MS

as OpenLineage

Delivery settings, with the meaning and defaults of their OpenLineage counterparts.

HOP_LINEAGE_DATAHUB_TRUSTSTORE_PATH, …_TRUSTSTORE_PASSWORD, …_KEYSTORE_TYPE

(empty), PKCS12

Trust store for a GMS with a certificate the JVM does not trust.

Database platform instances

A DataHub ingestion source can have a platform_instance, to keep apart two database servers that hold databases and tables of the same name. Its tables are then named with it: warehouse.sales.public.orders instead of sales.public.orders. For Hop’s lineage to land on those datasets, give the server the same instance in Hop: list its connection and the instance under Database platform instances in the DataHub Data Catalog.

A table on that server is then named <instance>.<database>.<schema>.<table> and shows under its instance, by the sink of a Lineage Sink that uses the catalog, by publishing, and when Hop reads the catalog (Check data catalog, Mask fields, the AI Assistant). Without instances, nothing changes. The instance belongs to the server (host and port): every connection to it, and every database on it, gets the same one. A sink configured with variables takes them from HOP_LINEAGE_DATAHUB_DATABASE_INSTANCES, with the namespace Hop gives the server (postgres://db.example.com:5432, the host in lower case and the port).

Durability

Events are written to DataHub on a background thread, so a run never waits for DataHub. With HOP_LINEAGE_DATAHUB_SPOOL_DIR set, every event is stored in that folder before it is sent and removed once DataHub accepted it: a DataHub outage or restart delays lineage instead of losing it. The same process retries, in order, after a pause that doubles from one second to a minute; whatever is left when it ends is sent by the next process that starts the sink, before its own events. Processes can share a spool folder: each keeps its events in a folder of its own and only takes over those of a process that is gone (see OpenLineage durability).

With a spool folder, a rejected token, a wrong URL or a proxy that refuses the request (HTTP 401, 403, 404, 407) keeps the events for later, so they arrive once the configuration is fixed. Without one they are kept in memory, up to the buffer size, until the process ends. An event DataHub refuses as invalid is logged and dropped; when only one of its aspects is invalid, the rest of the event is still written. Events are written in batches, but each one is kept or done on its own: when a request fails halfway through a batch, the events DataHub accepted are not sent again.

When a hop-run ends, the sink waits for DataHub to accept what is still queued, up to HOP_LINEAGE_DATAHUB_SHUTDOWN_DRAIN_MS (30 seconds by default). The log then reports DataHub sink metrics: sent=…, failed=…, rejected=…, dropped=….

Dataset schemas

Hop knows the fields of the files it reads and writes and of the tables it writes, with their types. With the default HOP_LINEAGE_DATAHUB_DATASET_SCHEMA=missing, the sink writes that schema only when DataHub has none for the dataset yet, or the one it has was written by Hop: a table that DataHub’s own database ingestion describes keeps that description. always writes Hop’s schema regardless, never leaves schemas alone.

A table a query reads gets no schema from Hop: the query reads only some of its columns, and the rows it returns, with their aliases and expressions, are not the table’s schema either. The table’s schema comes from a Hop transform that writes it, or from DataHub’s own database ingestion.

Deleted and moved datasets

With HOP_LINEAGE_DATAHUB_LIFECYCLE=Y, a file a run deletes (Process files, or Move files and Unzip when they remove a file) is marked deprecated in DataHub, with a note naming the task that deleted it. A file a run moves (Move files) deprecates the old dataset and names the new one as its replacement. When a later run writes the dataset again, the sink lifts its own deprecation; one a person wrote is never touched.

This is off by default: in DataHub a deprecation can notify the owners of a dataset, and a staging file that every run writes and deletes would be deprecated after every run.

Verifying

Run a pipeline and open DataHub: the pipeline is listed under the Apache Hop platform, its tasks on its Tasks tab and its runs on the Runs tab of each task. The Lineage tab of a dataset the pipeline wrote shows the tasks and datasets upstream of it.

Tools > Lineage sinks in Hop GUI, and the status page of a Hop Server, show what the sink sent, what waits and the last error; see Sink health.

The sink logs one line when it starts:

DataHub lineage sink initialized: gms=http://localhost:8080, env=PROD, dataset schemas=missing, lifecycle=off, spool=off

Unit test results

A pipeline unit test that runs with lineage, for example from the Run pipeline unit tests action in a workflow whose run configuration selects a DataHub lineage sink, reports each golden data set as an assertion run in DataHub: passed or failed, with what the comparison found, or an error when the rows could not be compared, for example because the golden data set could not be read. The test’s run itself, of a changed copy of the pipeline, is not reported to a lineage sink, whether a run configuration selects it or the HOP_LINEAGE_* variables set it up. Before Hop 2.21, a sink set up with those variables got it as a run of the pipeline.

The assertion is on the tables and files the tested transform writes, as its metadata declares them: a test usually replaces that transform, so it is about what the transform would write. DataHub shows it on the dataset’s Quality tab, and the Check data catalog action can check it before a workflow reads the dataset.

DataHub only takes assertions on datasets: a test of a transform that writes no table or file is not sent.

Publishing a project without running it

The Publish to DataHub action, or hop datahub-publish on the command line, publishes a project’s pipelines and workflows to DataHub without running them: their tasks, the tables and files they declare, and the layouts of those files as dataset schemas. It writes through a Lineage Sink of type DataHub, so the pipelines, tasks and datasets are the ones the runs report to. The Publish lineage action and hop lineage-publish, which publish to any lineage sink, publish the same to a DataHub sink, without the documentation.

bash
hop datahub-publish -j my-project -e prod -s prod-datahub
hop datahub-publish -j my-project -s prod-datahub -f '${PROJECT_HOME}/flows'
hop datahub-publish -j my-project -s prod-datahub -d -ip
Option Description

-s, --sink

The lineage sink of type DataHub to publish to. Required.

-f, --folder

The folder with the pipelines and workflows, with its subfolders. The default is the project’s home folder.

-d, --include-documentation

Also publish the documentation of each pipeline and workflow as a DataHub document. Needs DataHub 1.7 or later. See Documentation.

-ip, --include-parameters

With -d: list the parameters of each pipeline and workflow, with their default values, in its document, as hop doc -ip does.

-in, --include-notes

With -d: add the text of the notes of each pipeline and workflow to its document, as hop doc -in does.

-j, -e

The project and environment, as for hop doc.

The command exits with 1 when a file can’t be read or DataHub didn’t accept everything.

Documentation

With -d, or Include documentation in the action, each pipeline and workflow also becomes a DataHub document. The document holds what hop doc writes for the file: its description and extended description, its file name relative to the published folder, and when it was last changed. Its parameters, with their default values, and the text of its notes are only added when asked for (-ip, -in, or Include parameters and Include notes in the action), as with hop doc: they end up in a catalog that more people read than the project. The image of the graph is left out: DataHub shows the tasks itself.

  • The document is related to the pipeline or workflow and to each of its tasks, so it appears on their pages in DataHub.

  • The documents of a project sit under one document named Hop project <name>.

  • Publishing again updates the same documents.

Documents need DataHub 1.7 or later. Earlier versions, such as 1.0, have no documents and refuse them. The documents are sent after every pipeline and workflow is delivered, and the first one alone: when DataHub doesn’t take it, the others are not sent, and the publication fails with that reason. The pipelines, tasks and datasets are published all the same. Leave the option off for those versions. A document stays in DataHub when its pipeline or workflow is deleted.

Publishing past runs

The Publish runs to lineage action, or hop lineage-publish-runs on the command line, publishes the runs an Execution Information Location recorded to a DataHub lineage sink: each as the run instance it would have reported while it ran, with its start, end and result, its task runs, and the datasets its transforms declare. A run keeps its id, so publishing it again updates the same run instance.

Reading from DataHub

The plugin also adds DataHub as a type of Data Catalog, so workflows can read what DataHub knows about a dataset. The Check data catalog action uses it to check, before a workflow goes on, that datasets exist in DataHub, aren’t deprecated, changed recently enough and passed their assertions. Mask fields uses it to mask the fields DataHub tags as personal data, and CSV file input and Text file input can fill their fields from the schema DataHub has for a file. The AI Assistant uses it to include the descriptions, owners, tags, glossary terms and deprecation of a pipeline’s datasets in its questions.

A Data Catalog has its own URL and token: it doesn’t use the HOP_LINEAGE_DATAHUB_* variables. Give it the same environment as HOP_LINEAGE_DATAHUB_ENV, so a table resolves to the dataset the sink writes for it. Its token only needs the privilege to view the datasets and their assertions.

Runs on Hop Server

A pipeline or workflow that runs on a Hop Server through a remote run configuration appears as one run, as a local run does: the server reports it as the client’s run, with its transforms, the datasets they read and write, the client’s file and the task that started it. It reports to the sinks of the client’s run configuration and to its own. See Runs on Hop Server on the OpenLineage page for how that works and which sinks the server can use.

Limitations

  • Column lineage through the stream (Table Input to Table Output) follows fields that keep their name; map them to other column names in the Table Output field list. A field renamed on the way, in Select values for example, has no column lineage.

  • A sink configured with the HOP_LINEAGE_DATAHUB_* variables is the same for the whole Hop process: one DataHub and one environment per JVM, which a project environment (-e) can’t change. To send runs to different DataHubs or environments, select a Lineage Sink in their run configurations instead.

  • A pipeline or workflow file that is moved, renamed or deleted stays in DataHub under its old path; the file in its new place is a new pipeline. Renaming the pipeline itself only changes its name.

  • A pipeline or workflow run on a Hop Server gets its transforms in DataHub only when the server has the DataHub plugin; without it the client reports the run without its transforms. The server also has to reach the sink’s DataHub URL; see Runs on Hop Server.

  • A pipeline run on Apache Beam or native Spark reports its transforms with the tables, files and other datasets they declare in their settings, not with what they only know while they run (a file name from a field, for example). Which transform failed shows only when the engine counted errors for it; otherwise every transform of a failed run fails. A Spark run in cluster mode has no row counts.