geyanggang commented on code in PR #11147:
URL: https://github.com/apache/gravitino/pull/11147#discussion_r4548306585
##########
docs/lineage/gravitino-flink-lineage.md:
##########
@@ -0,0 +1,445 @@
+---
+title: "Flink Lineage"
+slug: "/lineage/gravitino-flink-lineage"
+keyword: "Gravitino Flink OpenLineage"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+By leveraging OpenLineage Flink plugin, Gravitino provides separate Flink
plugins to extract data
+lineage and transform the dataset identifier to Gravitino identifier.
+
+Gravitino offers **two plugin variants** to cover different Flink versions:
+
+| Plugin | Flink Version | SQL
Lineage | DataStream Lineage | User Code Change |
+|-------------------|--------------------------------------------------|-------------|--------------------|-----------------------|
+| **Flink2 plugin** | Flink 2.x, or Flink 1.20+ with FLIP-314 backport | Yes
| Yes | None (config only) |
+| **Flink1 plugin** | Flink 1.18 / 1.19 / 1.20 (native, no backport) | No
| Yes | `registerJobListener` |
+
+## Capabilities
+
+- Supports table-level lineage for Flink SQL jobs (Flink2 plugin only).
+- Supports DataStream API lineage for Kafka, JDBC, Iceberg, and Cassandra
sources/sinks, plus any
+ connector implementing the OpenLineage `LineageVertexProvider` interface.
+- Supports lineage across different catalogs like Paimon, Kafka, Hive, JDBC,
Iceberg, etc. (via SQL
+ lineage).
+- Supports Gravitino Flink Connector and non-Gravitino Flink catalogs.
+- Supports physical address resolution via DDL connector options and the
Gravitino REST API
+ (populates the `symlinks` facet, Flink2 plugin only).
+- Supports job lifecycle events: START, COMPLETE, FAIL, ABORT.
+- Supports disabling checkpoint tracking to reduce excessive RUNNING events.
+- Supports the standard OpenLineage transports (`kafka`, `http`, `console`)
for event delivery,
+ including sending events to the Gravitino server's lineage endpoint via the
`http` transport.
+
+## Gravitino Dataset
+
+The Gravitino OpenLineage Flink plugin transforms the Gravitino metalake name
into the dataset
+namespace. The dataset name follows the format
`${catalogName}.${databaseName}.${tableName}`.
+
+### SQL datasets (Flink2 plugin)
+
+When using the [Gravitino Flink
Connector](../flink-connector/flink-connector.md) to access tables
+managed by Gravitino, the dataset name follows this format:
+
+| Dataset Type | Dataset name |
Example | Since Version |
+|-----------------|------------------------------------------------------|----------------------------------|---------------|
+| Paimon catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`paimon_catalog.ods.user_events` | 2.0.0 |
+| Kafka catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`kafka_catalog.default.events` | 2.0.0 |
+| Hive catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`hive_catalog.warehouse.orders` | 2.0.0 |
+| JDBC catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`jdbc_catalog.public.users` | 2.0.0 |
+| Iceberg catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`iceberg_catalog.db.table1` | 2.0.0 |
+
+For datasets not managed by Gravitino (e.g., `default_catalog`), the dataset
name is:
+
+| Dataset Type | Dataset name | Example
| Since Version |
+|-----------------|---------------------------------------------|------------------------------------|---------------|
+| Default catalog | `${catalogName}.${schemaName}.${tableName}` |
`default_catalog.default.my_table` | 2.0.0 |
+
+The dataset `name` field uses the **Flink logical table name** (as registered
in CatalogManager),
+not the underlying physical resource name. For example:
+
+```sql
+CREATE TABLE kafka_catalog.`default`.user_events (...)
+ WITH ('connector' = 'kafka', 'topic' = 'raw_user_events_v2');
+```
+
+The lineage output will be `name = "kafka_catalog.default.user_events"`
(logical name), not `raw_user_events_v2` (physical topic name).
+
+### DataStream datasets (Flink1 and Flink2 plugins)
+
+DataStream connectors report a physical identifier (for example, namespace
`kafka://broker1:9092`
+and name `events`) with no Flink catalog context. The plugin converts it as
follows:
+
+- The connector type is inferred from the namespace scheme: `kafka://` is
`kafka`, `hive://` or
+ `thrift://` is `hive`, `jdbc:` is `jdbc`, `paimon://` is `paimon`, and
`iceberg://` is `iceberg`
+ (Flink1 plugin only). Any other scheme is reported as `unknown`.
+- The inferred connector type is used as the catalog name unless it is
remapped with
+ `openlineage.gravitino.catalogMappings`. For DataStream datasets, the
mapping keys are connector
+ types, for example `kafka:kafka_catalog`.
+- A name of the form `db.table` becomes `${catalogName}.db.table`. A
single-segment name (such as a
+ Kafka topic) becomes `${catalogName}.default.${name}`.
+
+For example, with `openlineage.gravitino.catalogMappings:
kafka:kafka_catalog`, the Kafka topic
+`events` is reported as `name = "kafka_catalog.default.events"`. Without the
mapping it is reported
+as `kafka.default.events`.
+
+### Physical address in symlinks (Flink2 plugin only)
+
+Besides the logical Gravitino identifier, the Flink2 plugin also populates a
`symlinks` facet with the
+underlying physical address (Kafka brokers, JDBC URL, Hive metastore URI,
warehouse path, etc.).
+This allows downstream consumers to correlate logical Gravitino identifiers
with physical cluster
+addresses for quick troubleshooting.
+
+The physical address is resolved with a fixed priority: **table-level** (from
the DDL `WITH`
+options, no Gravitino server needed) > **catalog-level** (from the Gravitino
REST API, reusing the
+`table.catalog-store.gravitino.*` connector configuration) > empty. The Flink1
plugin does not
+populate this facet.
+
+```json
+"symlinks": {
+ "identifiers": [
+ {
+ "namespace": "kafka://broker1:9092",
+ "name": "raw_user_events_v2",
+ "type": "TABLE"
+ }
+ ]
+}
+```
+
+**Table-level resolution** (no Gravitino Server needed):
+
+| Connector | Physical namespace | Physical name |
Source |
+|--------------------------|-------------------------------|---------------|-------------------|
+| `kafka` / `upsert-kafka` | `kafka://<first broker in
properties.bootstrap.servers>` | topic name | DDL `WITH` clause |
+| `jdbc` | JDBC URL (`url`) | table-name |
DDL `WITH` clause |
+
+**Catalog-level resolution** (requires Gravitino Server):
+
+| Provider |
Physical address source | Example |
+|--------------------------------------------------------------------|-------------------------|--------------------------------|
+| `hive` |
`metastore.uris` | `thrift://metastore:9083` |
+| `jdbc-mysql` / `jdbc-postgresql` / `jdbc-doris` / `jdbc-oceanbase` |
`jdbc-url` | `jdbc:mysql://host:3306` |
+| `lakehouse-paimon` |
`warehouse` | `file:///tmp/paimon-warehouse` |
+| `lakehouse-iceberg` | `uri`
or `warehouse` | `thrift://metastore:9083` |
+
+For other providers, the first available property among `uri`, `warehouse`,
`metastore.uris`, and
+`jdbc-url` is used.
+
+Catalog-level resolution is enabled only when both
`table.catalog-store.gravitino.gravitino.uri`
+and `table.catalog-store.gravitino.gravitino.metalake` are configured.
+
+:::note
+Catalog-level resolution is skipped for Flink's built-in `default_catalog` (it
never exists in a
+Gravitino metalake). The resolver reuses the Gravitino Flink Connector client
config
+(`table.catalog-store.gravitino.gravitino.client.auth.type` and related keys).
It supports `basic`
+authentication, and with any other value (including no `auth.type`) it uses
simple auth with the
+current Hadoop/JVM user, matching the connector's behavior. `oauth2` is not
supported: catalog-level
+symlinks are not populated in that case, while table-level symlinks and
lineage are unaffected.
+:::
+
+### Connector support matrix
+
+| Connector | SQL lineage (Flink2) | DataStream lineage | Notes
|
+|----------------------|----------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| Paimon | Yes | No | Paimon
has not implemented `LineageVertexProvider`
|
+| Kafka / upsert-kafka | Yes | Yes |
DataStream visitor requires `flink-connector-kafka` on the classpath
|
+| Hive | Yes | No | SQL
lineage carries the table identifier; the Hive source exposes a
`DataStreamScanProvider`, which the Flink Planner does not extract a lineage
vertex from, so no rich DataStream facets |
+| JDBC | Yes | Yes (Flink1) |
DataStream via the community `JdbcSourceVisitor`
|
+| Iceberg | Yes | Yes (Flink1) |
DataStream via the community `IcebergSourceVisitor` / `IcebergSinkVisitor`
|
+| Cassandra | N/A | Yes (Flink1) |
DataStream via the community `CassandraSourceVisitor` / `CassandraSinkVisitor`
|
+| Other | Yes | Depends | SQL
lineage works for any connector registered via CatalogManager
|
+
+
+## Getting Started (Flink2 plugin)
+
+1. Download [Gravitino OpenLineage Flink2 plugin
jar](https://github.com/datastrato/gravitino-openlineage-plugins/tree/main/flink-plugin/)
(`openlineage-flink2-<version>.jar`) and place it in the Flink `lib/`
directory.
Review Comment:
The Flink jars live in the same public repo as the Spark plugin jar already
linked from the Spark lineage doc, so this matches the existing convention. The
links now point to the released version directory and name the exact jars
(1.45.0-datastrato-1), with a pointer to the README for newer versions. Fixed
in fb27b1b15.
##########
docs/lineage/gravitino-flink-lineage.md:
##########
@@ -0,0 +1,445 @@
+---
+title: "Flink Lineage"
+slug: "/lineage/gravitino-flink-lineage"
+keyword: "Gravitino Flink OpenLineage"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+By leveraging OpenLineage Flink plugin, Gravitino provides separate Flink
plugins to extract data
+lineage and transform the dataset identifier to Gravitino identifier.
+
+Gravitino offers **two plugin variants** to cover different Flink versions:
+
+| Plugin | Flink Version | SQL
Lineage | DataStream Lineage | User Code Change |
+|-------------------|--------------------------------------------------|-------------|--------------------|-----------------------|
+| **Flink2 plugin** | Flink 2.x, or Flink 1.20+ with FLIP-314 backport | Yes
| Yes | None (config only) |
+| **Flink1 plugin** | Flink 1.18 / 1.19 / 1.20 (native, no backport) | No
| Yes | `registerJobListener` |
+
+## Capabilities
+
+- Supports table-level lineage for Flink SQL jobs (Flink2 plugin only).
+- Supports DataStream API lineage for Kafka, JDBC, Iceberg, and Cassandra
sources/sinks, plus any
+ connector implementing the OpenLineage `LineageVertexProvider` interface.
+- Supports lineage across different catalogs like Paimon, Kafka, Hive, JDBC,
Iceberg, etc. (via SQL
+ lineage).
+- Supports Gravitino Flink Connector and non-Gravitino Flink catalogs.
+- Supports physical address resolution via DDL connector options and the
Gravitino REST API
+ (populates the `symlinks` facet, Flink2 plugin only).
+- Supports job lifecycle events: START, COMPLETE, FAIL, ABORT.
+- Supports disabling checkpoint tracking to reduce excessive RUNNING events.
+- Supports the standard OpenLineage transports (`kafka`, `http`, `console`)
for event delivery,
+ including sending events to the Gravitino server's lineage endpoint via the
`http` transport.
+
+## Gravitino Dataset
+
+The Gravitino OpenLineage Flink plugin transforms the Gravitino metalake name
into the dataset
+namespace. The dataset name follows the format
`${catalogName}.${databaseName}.${tableName}`.
+
+### SQL datasets (Flink2 plugin)
+
+When using the [Gravitino Flink
Connector](../flink-connector/flink-connector.md) to access tables
+managed by Gravitino, the dataset name follows this format:
+
+| Dataset Type | Dataset name |
Example | Since Version |
+|-----------------|------------------------------------------------------|----------------------------------|---------------|
+| Paimon catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`paimon_catalog.ods.user_events` | 2.0.0 |
+| Kafka catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`kafka_catalog.default.events` | 2.0.0 |
+| Hive catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`hive_catalog.warehouse.orders` | 2.0.0 |
+| JDBC catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`jdbc_catalog.public.users` | 2.0.0 |
+| Iceberg catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`iceberg_catalog.db.table1` | 2.0.0 |
+
+For datasets not managed by Gravitino (e.g., `default_catalog`), the dataset
name is:
+
+| Dataset Type | Dataset name | Example
| Since Version |
+|-----------------|---------------------------------------------|------------------------------------|---------------|
+| Default catalog | `${catalogName}.${schemaName}.${tableName}` |
`default_catalog.default.my_table` | 2.0.0 |
+
+The dataset `name` field uses the **Flink logical table name** (as registered
in CatalogManager),
+not the underlying physical resource name. For example:
+
+```sql
+CREATE TABLE kafka_catalog.`default`.user_events (...)
+ WITH ('connector' = 'kafka', 'topic' = 'raw_user_events_v2');
+```
+
+The lineage output will be `name = "kafka_catalog.default.user_events"`
(logical name), not `raw_user_events_v2` (physical topic name).
+
+### DataStream datasets (Flink1 and Flink2 plugins)
+
+DataStream connectors report a physical identifier (for example, namespace
`kafka://broker1:9092`
+and name `events`) with no Flink catalog context. The plugin converts it as
follows:
+
+- The connector type is inferred from the namespace scheme: `kafka://` is
`kafka`, `hive://` or
+ `thrift://` is `hive`, `jdbc:` is `jdbc`, `paimon://` is `paimon`, and
`iceberg://` is `iceberg`
+ (Flink1 plugin only). Any other scheme is reported as `unknown`.
+- The inferred connector type is used as the catalog name unless it is
remapped with
+ `openlineage.gravitino.catalogMappings`. For DataStream datasets, the
mapping keys are connector
+ types, for example `kafka:kafka_catalog`.
+- A name of the form `db.table` becomes `${catalogName}.db.table`. A
single-segment name (such as a
+ Kafka topic) becomes `${catalogName}.default.${name}`.
+
+For example, with `openlineage.gravitino.catalogMappings:
kafka:kafka_catalog`, the Kafka topic
+`events` is reported as `name = "kafka_catalog.default.events"`. Without the
mapping it is reported
+as `kafka.default.events`.
+
+### Physical address in symlinks (Flink2 plugin only)
+
+Besides the logical Gravitino identifier, the Flink2 plugin also populates a
`symlinks` facet with the
+underlying physical address (Kafka brokers, JDBC URL, Hive metastore URI,
warehouse path, etc.).
+This allows downstream consumers to correlate logical Gravitino identifiers
with physical cluster
+addresses for quick troubleshooting.
+
+The physical address is resolved with a fixed priority: **table-level** (from
the DDL `WITH`
+options, no Gravitino server needed) > **catalog-level** (from the Gravitino
REST API, reusing the
+`table.catalog-store.gravitino.*` connector configuration) > empty. The Flink1
plugin does not
+populate this facet.
+
+```json
+"symlinks": {
+ "identifiers": [
+ {
+ "namespace": "kafka://broker1:9092",
+ "name": "raw_user_events_v2",
+ "type": "TABLE"
+ }
+ ]
+}
+```
+
+**Table-level resolution** (no Gravitino Server needed):
+
+| Connector | Physical namespace | Physical name |
Source |
+|--------------------------|-------------------------------|---------------|-------------------|
+| `kafka` / `upsert-kafka` | `kafka://<first broker in
properties.bootstrap.servers>` | topic name | DDL `WITH` clause |
+| `jdbc` | JDBC URL (`url`) | table-name |
DDL `WITH` clause |
+
+**Catalog-level resolution** (requires Gravitino Server):
+
+| Provider |
Physical address source | Example |
+|--------------------------------------------------------------------|-------------------------|--------------------------------|
+| `hive` |
`metastore.uris` | `thrift://metastore:9083` |
+| `jdbc-mysql` / `jdbc-postgresql` / `jdbc-doris` / `jdbc-oceanbase` |
`jdbc-url` | `jdbc:mysql://host:3306` |
+| `lakehouse-paimon` |
`warehouse` | `file:///tmp/paimon-warehouse` |
+| `lakehouse-iceberg` | `uri`
or `warehouse` | `thrift://metastore:9083` |
+
+For other providers, the first available property among `uri`, `warehouse`,
`metastore.uris`, and
+`jdbc-url` is used.
+
+Catalog-level resolution is enabled only when both
`table.catalog-store.gravitino.gravitino.uri`
+and `table.catalog-store.gravitino.gravitino.metalake` are configured.
+
+:::note
+Catalog-level resolution is skipped for Flink's built-in `default_catalog` (it
never exists in a
+Gravitino metalake). The resolver reuses the Gravitino Flink Connector client
config
+(`table.catalog-store.gravitino.gravitino.client.auth.type` and related keys).
It supports `basic`
+authentication, and with any other value (including no `auth.type`) it uses
simple auth with the
+current Hadoop/JVM user, matching the connector's behavior. `oauth2` is not
supported: catalog-level
+symlinks are not populated in that case, while table-level symlinks and
lineage are unaffected.
+:::
+
+### Connector support matrix
+
+| Connector | SQL lineage (Flink2) | DataStream lineage | Notes
|
+|----------------------|----------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| Paimon | Yes | No | Paimon
has not implemented `LineageVertexProvider`
|
+| Kafka / upsert-kafka | Yes | Yes |
DataStream visitor requires `flink-connector-kafka` on the classpath
|
+| Hive | Yes | No | SQL
lineage carries the table identifier; the Hive source exposes a
`DataStreamScanProvider`, which the Flink Planner does not extract a lineage
vertex from, so no rich DataStream facets |
+| JDBC | Yes | Yes (Flink1) |
DataStream via the community `JdbcSourceVisitor`
|
+| Iceberg | Yes | Yes (Flink1) |
DataStream via the community `IcebergSourceVisitor` / `IcebergSinkVisitor`
|
+| Cassandra | N/A | Yes (Flink1) |
DataStream via the community `CassandraSourceVisitor` / `CassandraSinkVisitor`
|
+| Other | Yes | Depends | SQL
lineage works for any connector registered via CatalogManager
|
+
+
+## Getting Started (Flink2 plugin)
+
+1. Download [Gravitino OpenLineage Flink2 plugin
jar](https://github.com/datastrato/gravitino-openlineage-plugins/tree/main/flink-plugin/)
(`openlineage-flink2-<version>.jar`) and place it in the Flink `lib/`
directory.
+2. For Kafka transport, ensure `kafka-clients` jar is in Flink `lib/`.
+3. Add configuration to Flink to enable lineage collection.
+
+Configuration example for Flink `config.yaml`:
+
+```yaml
+# Register the listener
+execution.job-status-changed-listeners:
io.openlineage.flink.listener.GravitinoOpenLineageListenerFactory
+
+# Gravitino lineage configuration
+openlineage.gravitino.metalake: ${metalakeName}
+openlineage.gravitino.useGravitinoIdentifier: true
+openlineage.job.namespace: ${metalakeName}
+
+# Kafka transport
+openlineage.transport.type: kafka
+openlineage.transport.topicName: lineage-events
+openlineage.transport.properties.bootstrap.servers: ${bootstrap-servers}
+openlineage.transport.properties.key.serializer:
org.apache.kafka.common.serialization.StringSerializer
+openlineage.transport.properties.value.serializer:
org.apache.kafka.common.serialization.StringSerializer
+openlineage.transport.properties.acks: all
+openlineage.transport.properties.retries: 5
+
+# Disable checkpoint tracking (optional, reduces excessive RUNNING events)
+# openlineage.flink.disableCheckpointTracking: true
+```
+
+:::note
+The `key.serializer` and `value.serializer` properties are **required** for
Kafka transport. The
+plugin passes properties directly to `KafkaProducer` without setting defaults.
+:::
+
+To send lineage events directly to the Gravitino server instead of Kafka, use
the `http` transport
+pointing at the Gravitino lineage endpoint (`/api/lineage`):
+
+```yaml
+openlineage.transport.type: http
+openlineage.transport.url: http://${gravitino-host}:${gravitino-port}
+openlineage.transport.endpoint: /api/lineage
+```
+
+This requires the Gravitino server to have its lineage HTTP source enabled (it
is the default
+`gravitino.lineage.source`). See [Server
Lineage](./gravitino-server-lineage.md) for the
+server-side configuration.
+
+Alternatively, transport can be configured via an external `openlineage.yml`
file:
+
+```bash
+export OPENLINEAGE_CONFIG=/path/to/openlineage.yml
+```
+
+```yaml
+transport:
+ type: kafka
+ topicName: lineage-events
+ properties:
+ bootstrap.servers: broker1:9092,broker2:9092
+ key.serializer: org.apache.kafka.common.serialization.StringSerializer
+ value.serializer: org.apache.kafka.common.serialization.StringSerializer
+ acks: all
+```
+
+Refer to [OpenLineage Flink
guides](https://openlineage.io/docs/integrations/flink/) and
+[Gravitino Flink Connector](../flink-connector/flink-connector.md) for more
details.
+
+## Getting Started (Flink1 plugin)
+
+1. Download [Gravitino OpenLineage Flink1 plugin
jar](https://github.com/datastrato/gravitino-openlineage-plugins/tree/main/flink-plugin/)
(`openlineage-flink1-<version>.jar`) and place it in the Flink `lib/`
directory.
+2. Register the listener in your application code:
+
+```java
+import io.openlineage.flink.GravitinoOpenLineageFlinkJobListener;
+
+StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
+env.registerJobListener(
+ GravitinoOpenLineageFlinkJobListener.builder()
+ .executionEnvironment(env)
+ .build());
+
+// Your DataStream job logic...
+env.execute("My Flink Job");
+```
+
+3. Add configuration to Flink:
+
+```yaml
+execution.job-listener.openlineage.namespace: ${metalakeName}
+execution.job-listener.openlineage.job-name: ${jobName}
+
+# Optional: map the inferred connector type to the Gravitino catalog name
+# openlineage.gravitino.catalogMappings: kafka:kafka_catalog,hive:hive_catalog
+```
+
+If `openlineage.gravitino.metalake` and
`table.catalog-store.gravitino.gravitino.metalake` are not
+set, the Flink1 plugin uses `execution.job-listener.openlineage.namespace` as
the metalake name.
+
+4. Set `OPENLINEAGE_CONFIG` environment variable pointing to `openlineage.yml`
(same format as Flink2).
+
+### Flink1 plugin limitations
+
+- **No SQL lineage**: Only DataStream API jobs produce lineage events.
+- **Requires code change**: Must call `env.registerJobListener(...)`.
+- **No automatic connector detection**: Only connectors with explicit Visitor
implementations.
+- **No physical address symlinks**: The `symlinks` facet is not populated with
Gravitino-resolved
+ physical addresses.
+- **Connector-type catalog names**: Dataset names are derived from the
physical identifier, so the
+ catalog name is the inferred connector type unless remapped with
+ `openlineage.gravitino.catalogMappings`.
+
+## Configuration Reference
+
+The configurations are grouped by purpose. Unless noted otherwise, they apply
to both plugins.
+
+### Gravitino identifier configuration
+
+| Configuration item | Description
| Default value | Required | Since Version |
+|------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `openlineage.gravitino.metalake` | The Gravitino metalake name
used as the dataset namespace. If not set, falls back to
`table.catalog-store.gravitino.gravitino.metalake`; the Flink1 plugin then
falls back to `execution.job-listener.openlineage.namespace`. If none is set,
Gravitino identifier conversion is skipped.
| None | Yes, unless a fallback is set | 2.0.0
|
+| `openlineage.gravitino.useGravitinoIdentifier` | Whether to transform the
dataset identifier to the Gravitino format. When `false`, the original
OpenLineage identifier is used (e.g. `kafka://broker:9092` as the namespace for
Kafka tables); note that for the Paimon/Hive/JDBC SQL path the original
namespace is empty, since the Flink Planner does not populate physical
addresses for these connectors. | `true` | No | 2.0.0 |
+| `openlineage.gravitino.catalogMappings` | Catalog name mapping rules.
For SQL datasets (Flink2), the keys are Flink catalog names and are used when
the Flink catalog registration name differs from the Gravitino catalog name.
For DataStream datasets, the keys are the inferred connector types (such as
`kafka`, `hive`, `jdbc`, `paimon`). Format:
`origin1:gravitino1,origin2:gravitino2`.
|
None | No | 2.0.0 |
+
+### Flink2 plugin configuration
+
+| Configuration item | Description
| Default value | Required | Since Version |
+|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `execution.job-status-changed-listeners` | Flink listener factory
class. Set to
`io.openlineage.flink.listener.GravitinoOpenLineageListenerFactory`.
| None | Yes | 2.0.0 |
+| `openlineage.job.namespace` | The OpenLineage job
namespace. Typically set to the metalake name.
| `flink-jobs` | No | 2.0.0 |
+| `openlineage.flink.disableCheckpointTracking` | When `true`, disables
checkpoint tracking to reduce excessive RUNNING events. Only START, COMPLETE,
FAIL, and ABORT events are emitted. | `false` | No | 2.0.0 |
+
+### Flink1 plugin configuration
+
+| Configuration item | Description
| Default value | Required | Since Version |
+|------------------------------------------------|--------------------------------|-----------------------|----------|---------------|
+| `execution.job-listener.openlineage.namespace` | The OpenLineage job
namespace. | `flink_jobs` | No | 2.0.0 |
+| `execution.job-listener.openlineage.job-name` | The OpenLineage job name.
| `Flink Streaming Job` | No | 2.0.0 |
+
+### Transport configuration
+
+These are standard OpenLineage transport options; the Gravitino plugin passes
them through unchanged.
+
+| Configuration item | Description
| Default value | Required | Since Version |
+|--------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|---------------|-------------|---------------|
+| `openlineage.transport.type` | Transport type: `kafka`, `http`, or
`console`. Use `http` to send events to the Gravitino server.
| None | Yes | 2.0.0 |
Review Comment:
The Required column is already per transport type (Yes (Kafka) / Yes (HTTP))
on the current head. I added a short note explaining this, that console needs
no extra options, and that everything can also be set in openlineage.yml. Fixed
in fb27b1b15.
##########
docs/lineage/gravitino-flink-lineage.md:
##########
@@ -0,0 +1,445 @@
+---
+title: "Flink Lineage"
+slug: "/lineage/gravitino-flink-lineage"
+keyword: "Gravitino Flink OpenLineage"
+license: "This software is licensed under the Apache License version 2."
+---
+
+## Overview
+
+By leveraging OpenLineage Flink plugin, Gravitino provides separate Flink
plugins to extract data
+lineage and transform the dataset identifier to Gravitino identifier.
+
+Gravitino offers **two plugin variants** to cover different Flink versions:
+
+| Plugin | Flink Version | SQL
Lineage | DataStream Lineage | User Code Change |
+|-------------------|--------------------------------------------------|-------------|--------------------|-----------------------|
+| **Flink2 plugin** | Flink 2.x, or Flink 1.20+ with FLIP-314 backport | Yes
| Yes | None (config only) |
+| **Flink1 plugin** | Flink 1.18 / 1.19 / 1.20 (native, no backport) | No
| Yes | `registerJobListener` |
+
+## Capabilities
+
+- Supports table-level lineage for Flink SQL jobs (Flink2 plugin only).
+- Supports DataStream API lineage for Kafka, JDBC, Iceberg, and Cassandra
sources/sinks, plus any
+ connector implementing the OpenLineage `LineageVertexProvider` interface.
+- Supports lineage across different catalogs like Paimon, Kafka, Hive, JDBC,
Iceberg, etc. (via SQL
+ lineage).
+- Supports Gravitino Flink Connector and non-Gravitino Flink catalogs.
+- Supports physical address resolution via DDL connector options and the
Gravitino REST API
+ (populates the `symlinks` facet, Flink2 plugin only).
+- Supports job lifecycle events: START, COMPLETE, FAIL, ABORT.
+- Supports disabling checkpoint tracking to reduce excessive RUNNING events.
+- Supports the standard OpenLineage transports (`kafka`, `http`, `console`)
for event delivery,
+ including sending events to the Gravitino server's lineage endpoint via the
`http` transport.
+
+## Gravitino Dataset
+
+The Gravitino OpenLineage Flink plugin transforms the Gravitino metalake name
into the dataset
+namespace. The dataset name follows the format
`${catalogName}.${databaseName}.${tableName}`.
+
+### SQL datasets (Flink2 plugin)
+
+When using the [Gravitino Flink
Connector](../flink-connector/flink-connector.md) to access tables
+managed by Gravitino, the dataset name follows this format:
+
+| Dataset Type | Dataset name |
Example | Since Version |
+|-----------------|------------------------------------------------------|----------------------------------|---------------|
+| Paimon catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`paimon_catalog.ods.user_events` | 2.0.0 |
+| Kafka catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`kafka_catalog.default.events` | 2.0.0 |
+| Hive catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`hive_catalog.warehouse.orders` | 2.0.0 |
+| JDBC catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`jdbc_catalog.public.users` | 2.0.0 |
+| Iceberg catalog | `${GravitinoCatalogName}.${schemaName}.${tableName}` |
`iceberg_catalog.db.table1` | 2.0.0 |
+
+For datasets not managed by Gravitino (e.g., `default_catalog`), the dataset
name is:
+
+| Dataset Type | Dataset name | Example
| Since Version |
+|-----------------|---------------------------------------------|------------------------------------|---------------|
+| Default catalog | `${catalogName}.${schemaName}.${tableName}` |
`default_catalog.default.my_table` | 2.0.0 |
+
+The dataset `name` field uses the **Flink logical table name** (as registered
in CatalogManager),
+not the underlying physical resource name. For example:
+
+```sql
+CREATE TABLE kafka_catalog.`default`.user_events (...)
+ WITH ('connector' = 'kafka', 'topic' = 'raw_user_events_v2');
+```
+
+The lineage output will be `name = "kafka_catalog.default.user_events"`
(logical name), not `raw_user_events_v2` (physical topic name).
+
+### DataStream datasets (Flink1 and Flink2 plugins)
+
+DataStream connectors report a physical identifier (for example, namespace
`kafka://broker1:9092`
+and name `events`) with no Flink catalog context. The plugin converts it as
follows:
+
+- The connector type is inferred from the namespace scheme: `kafka://` is
`kafka`, `hive://` or
+ `thrift://` is `hive`, `jdbc:` is `jdbc`, `paimon://` is `paimon`, and
`iceberg://` is `iceberg`
Review Comment:
Agreed. Replaced the inline list with a table showing which schemes each
plugin infers (iceberg:// is Flink1 only; the rest are inferred by both). Fixed
in fb27b1b15.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]