Pemetaan OpenLineage

Data Lineage API dapat menyerap informasi silsilah dari sistem yang terintegrasi dengan OpenLineage, standar terbuka untuk pengumpulan silsilah. Saat Anda mengirim peristiwa berformat OpenLineage ke Data Lineage API menggunakan metode ProcessOpenLineageRunEvent, Data Lineage API akan memetakan atribut dari pesan OpenLineage ke atribut yang sesuai di Data Lineage API.

Dokumen ini menyediakan tabel referensi untuk pemetaan ini.

Pemetaan atribut

Metode REST API ProcessOpenLineageRunEvent memetakan atribut OpenLineage ke atribut Data Lineage API sebagai berikut:

Atribut Data Lineage API Atribut OpenLineage
Process.name projects/PROJECT_NUMBER/locations/LOCATION/processes/HASH_OF_NAMESPACE_AND_NAME
Process.displayName Job.namespace + ":" + Job.name
Process.attributes Job.facets (lihat Data tersimpan)
Run.name projects/PROJECT_NUMBER/locations/LOCATION/processes/HASH_OF_NAMESPACE_AND_NAME/runs/HASH_OF_RUNID
Run.displayName Run.runId
Run.attributes Run.facets (lihat Data tersimpan)
Run.startTime eventTime
Run.endTime eventTime
Run.state eventType
LineageEvent.name projects/PROJECT_NUMBER/locations/LOCATION/processes/HASH_OF_NAMESPACE_AND_NAME/runs/HASH_OF_RUNID/lineageEvents/HASH_OF_JOB_RUN_INPUT_OUTPUTS_OF_EVENT (misalnya, projects/11111111/locations/us/processes/1234/runs/4321/lineageEvents/111-222-333)
LineageEvent.EventLinks.source input (fqn adalah namespace dan penyambungan nama)
LineageEvent.EventLinks.target output (fqn adalah penyambungan namespace dan nama)
LineageEvent.startTime eventTime
LineageEvent.endTime eventTime
requestId Ditentukan oleh pengguna metode

Silsilah tingkat kolom didukung saat dibuat secara otomatis oleh Managed Service untuk Apache Spark, asalkan menggunakan faset columnLineage dalam objek outputs. Peristiwa OpenLineage kustom yang menyertakan faset ini hanya mewujudkan silsilah tingkat tabel dan tidak merender silsilah tingkat kolom di konsol Google Cloud . Berikut adalah contoh faset yang dihasilkan oleh Managed Service untuk Apache Spark:

"outputs": [ {
  "namespace": "bigquery",
  "name": "project.dataset.outputtable",
  "columnLineage": {
      "_producer": "https://github.com/OpenLineage/OpenLineage/tree/1.39.0/integration/spark",
      "_schemaURL": "https://openlineage.io/spec/facets/1-2-0/ColumnLineageDatasetFacet.json#/$defs/ColumnLineageDatasetFacet",
      "fields": {
        "output_field": { // This is the name of the output field
          "inputFields": [
            {
              "namespace": "bigquery",
              "name": "project.dataset.inputtable",
              "field": "input_field", // This is the name of the input field
              "transformations": [
                {
                  "type": "DIRECT",
                  "subtype": "IDENTITY",
                  "description": "",
                  "masking": false
                }
              ]
            }
          ]
        }
      },
  }
}]

Dalam contoh ini, Anda akan membuat link silsilah tingkat kolom antara input_field dan output_field. Anda harus menyertakan kolom transformasi; jika tidak, silsilah tingkat kolom tidak akan diserap. Untuk mengetahui informasi selengkapnya tentang definisi Open Lineage untuk faset ini, lihat Faset set data tingkat kolom.

Pemetaan FQN

Tabel berikut memberikan contoh pasangan namespace dan nama OpenLineage untuk berbagai sistem, dan nama yang sepenuhnya memenuhi syarat (FQN) Knowledge Catalog (sebelumnya Dataplex Universal Catalog) yang setara:

Sistem Namespace OpenLineage Nama OpenLineage FQN Knowledge Catalog
Athena awsathena://athena.{region_name}.amazonaws.com
  • {catalog}
  • {catalog}.{database}
  • {catalog}.{database}.{table}
  • athena:{catalogId}.{region}
  • athena:{catalogId}.{region}.{databaseId}
  • athena:{catalogId}.{region}.{databaseId}.{tableId}
AWS Glue arn:aws:glue:{region}:{account id} table/{database name}/{table name} aws_glue:table:{region}.{account id}.{database name}.{table name}
Azure Cosmos DB azurecosmos://{host}/dbs/{database} colls/{table}
  • cosmos-db:{host}.{database}
  • cosmos-db:{host}.{database}.{table}
Azure Data Explorer azurekusto://{host}.kusto.windows.net {database}/{table}
  • kusto:{host}.{region}.{database}
  • kusto:{host}.{region}.{database}.{table}
Azure Synapse sqlserver://{host}:{port}
  • {database}
  • {database}.{schema}
  • {database}.{schema}.{table}
Tidak didukung
BigQuery bigquery
  • {project id}.{dataset name}
  • {project id}.{dataset name}.{table name}
  • bigquery:{projectId}.{datasetId}
  • bigquery:{projectId}.{datasetId}.{assetId}
Cassandra cassandra://{host}:{port}
  • {keyspace}
  • {keyspace}.{table}
  • cassandra:{hostWithPort}.{keyspaceId}
  • cassandra:{hostWithPort}.{keyspaceId}.{tableId}
MySQL mysql://{host}:{port}
  • {database}
  • {database}.{table}
  • mysql:{hostWithPort}.{databaseId}
  • mysql:{hostWithPort}.{databaseId}.{tableId}
CrateDB crate://{host}:{port} {database}.{schema}.{table} Tidak didukung
DB2 db2://{host}:{port}
  • {database}
  • {database}.{schema}
  • {database}.{schema}.{table}
  • db2:{dns}.{databaseId}
  • db2:{dns}.{databaseId}.{schemaId}
  • db2:{dns}.{databaseId}.{schemaId}.{tableId}
Hive hive://{host}:{port} {database}.{table} Tidak didukung
MSSQL mssql://{host}:{port} {database}.{schema}.{table} Tidak didukung
OceanBase oceanbase://{host}:{port} {database}.{table} Tidak didukung
Oracle oracle://{host}:{port} {serviceName}.{schema}.{table} or {sid}.{schema}.{table}
  • oracle:{hostWithPort}.{databaseId}
  • oracle:{hostWithPort}.{databaseId}.{schemaId}
  • oracle:{hostWithPort}.{databaseId}.{schemaId}.{tableId}
Postgres postgres://{host}:{port}
  • {database}
  • {database}.{schema}
  • {database}.{schema}.{table}
  • postgresql:{hostWithPort}.{databaseId}
  • postgresql:{hostWithPort}.{databaseId}.{schemaId}
  • postgresql:{hostWithPort}.{databaseId}.{schemaId}.{tableId}
Teradata teradata://{host}:{port} {database}.{table} Tidak didukung
Redshift redshift://{cluster_identifier}.{region_name}:{port}
  • {database}
  • {database}.{schema}
  • {database}.{schema}.{table}
  • redshift:{clusterId}.{region}.{port}.{databaseId}
  • redshift:{clusterId}.{region}.{port}.{databaseId}.{schemaId}
  • redshift:{clusterId}.{region}.{port}.{databaseId}.{schemaId}.{tableId}
Snowflake snowflake://{organization name}-{account name} or snowflake://{account-locator}(.{compliance})(.{cloud_region_id})(.{cloud})
  • {database}
  • {database}.{schema}
  • {database}.{schema}.{table}
  • snowflake:{accountName}.{databaseId}
  • snowflake:{accountName}.{databaseId}.{schemaId}
  • snowflake:{accountName}.{databaseId}.{schemaId}.{tableId}
Spanner spanner://{projectId}:{instanceId} {database}.{schema}.{table} Didukung di Katalog Informasi, tetapi tidak didukung di Silsilah data
Trino trino://{host}:{port}
  • {catalog}
  • {catalog}.{schema}
  • {catalog}.{schema}.{table}
  • trino:{hostWithPort}.{catalogId}
  • trino:{hostWithPort}.{catalogId}.{schemaId}
  • trino:{hostWithPort}.{catalogId}.{schemaId}.{tableId}
ABFSS (Azure Data Lake Gen2) abfss://{container name}@{service name}.dfs.core.windows.net {path}
  • abs:{serviceName}.{containerName}
  • abs:{serviceName}.{containerName}.{path}
DBFS (Databricks File System) dbfs://{workspace name} {path}
  • dbfs:{workspace}
  • dbfs:{workspace}.{path}
Cloud Storage gs://{bucket name} {object key}
  • gcs:{bucketName}
  • gcs:{bucketName}.{virtualPath}
HDFS hdfs://{namenode host}:{namenode port} {path}
  • hdfs:{namenodeHostWithPort}
  • hdfs:{namenodeHostWithPort}.{path}
Kafka kafka://{bootstrap server host}:{port} {topic} kafka:{serverHostWithPort}.{topicId}
Sistem file lokal file {path} filesystem:localhost.{path}
Sistem file jarak jauh file://{host} {path} filesystem:{hostWithPort}.{path}
S3 s3://{bucket name} {object key}
  • s3:{bucketName}
  • s3:{bucketName}.{objectKey}

Awalan namespace s3a dan s3n juga diterima dan dikonversi ke s3
WASBS (Azure Blob Storage) wasbs://{container name}@{service name}.dfs.core.windows.net {object key}
  • abs:{serviceName}.{containerName}
  • abs:{serviceName}.{containerName}.{objectKey}
Topik Pub/Sub pubsub topic:{projectId}:{topicId} pubsub:topic:{projectId}.{topicId}
Langganan Pub/Sub pubsub subscription:{projectId}:{subscriptionId} pubsub:subscription:{projectId}.{subscriptionId}

Format tambahan yang diterima

Meskipun OpenLineage tidak menentukan pasangan namespace/name standar untuk sistem berikut, Data Lineage API menerima peristiwa silsilah untuk sistem tersebut jika diformat seperti yang dijelaskan dalam tabel berikut. Resource yang direferensikan dalam pesan OpenLineage dengan namespace custom ditafsirkan sebagai nama kustom yang sepenuhnya memenuhi syarat.

Sistem Namespace OpenLineage Nama OpenLineage FQN Knowledge Catalog
FQN Kustom custom {some reference} custom:{someReference}
Dataproc Metastore dataproc_metastore
  • dataproc_metastore:{projectId}.{location}.{instanceId}
  • dataproc_metastore:{projectId}.{location}.{instanceId}.{databaseId}
  • dataproc_metastore:{projectId}.{location}.{instanceId}.{databaseId}.{tableId}
  • dataproc_metastore:{projectId}.{location}.{instanceId}
  • dataproc_metastore:{projectId}.{location}.{instanceId}.{databaseId}
  • dataproc_metastore:{projectId}.{location}.{instanceId}.{databaseId}.{tableId}

Katalog Lakehouse (pemetaan berbasis faset)

Tidak seperti sistem dalam tabel sebelumnya, ID tingkat tabel dan tingkat kolom untuk katalog Lakehouse tidak diperoleh dengan menggabungkan namespace dan name set data OpenLineage. Sebagai gantinya, Data Lineage API menyelesaikan tabel katalog Apache Iceberg dan Hive menggunakan kolom set data facets.catalog dan facets.symlinks.

Konfigurasi berikut menentukan format FQN yang dibuat API:

  • Katalog REST Iceberg Lakehouse:
    • Logika pemicu: facets.catalog.type adalah "rest" dan facets.catalog.metadataUri berisi biglake.googleapis.com.
    • Konstruksi FQN: Mem-build biglake:table:{projectId}.{catalogId}.{namespaceId}.{tableId} menggunakan catalogProperties.gcp_project_id atau project dari URI warehouse bl:// untuk {projectId}, catalogId dari URI warehouse, dan {namespaceId}.{tableId} dari symlink TABLE.
  • Katalog Hive Lakehouse:
    • Logika pemicu: facets.catalog.type adalah "gcp_lakehouse" dan facets.catalog.framework adalah "hive".
    • Konstruksi FQN: Membangun biglake:table:{projectId}.{catalogId}.{namespaceId}.{tableId} menggunakan catalogProperties.gcp_project_id untuk {projectId}, facets.catalog.name untuk {catalogId}, dan name dua segmen dari symlink TABLE.
  • Katalog runtime Lakehouse (bigquerymetastore):
    • Logika pemicu: facets.catalog.type adalah "bigquerymetastore".
    • Konstruksi FQN: Membangun bigquery:{projectId}.{datasetId}.{tableId} menggunakan catalogProperties.gcp_project_id untuk {projectId}, dan {datasetId}.{tableId} dari symlink TABLE.

Contoh berikut menunjukkan faset set data yang digunakan untuk memetakan tabel katalog REST Iceberg ke biglake:table:my-project.my_catalog.my_namespace.my_table:

{
  "namespace": "bl://projects",
  "name": "/my-project/catalogs/my_catalog/my_namespace/my_table",
  "facets": {
    "catalog": {
      "framework": "iceberg",
      "type": "rest",
      "name": "my_catalog",
      "metadataUri": "https://biglake.googleapis.com/iceberg/v1/restcatalog",
      "warehouseUri": "bl://projects/my-project/catalogs/my_catalog",
      "catalogProperties": {
        "gcp_project_id": "my-project"
      }
    },
    "symlinks": {
      "identifiers": [
        {
          "namespace": "https://biglake.googleapis.com/iceberg/v1/restcatalog",
          "name": "my_namespace.my_table",
          "type": "TABLE"
        }
      ]
    }
  }
}

Langkah berikutnya