[BUG] [SPARK] Kafka streaming inputs empty on Spark 3.4/3.5: StreamingDataSourceV2ScanRelation builder only registered for Spark 4
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 65/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
Start by comparing Spark35DatasetBuilderFactory and Spark34DatasetBuilderFactory with Spark40DatasetBuilderFactory, then read StreamingDataSourceV2ScanRelationDatasetBuilder and the Spark 4 tests added for #5101. Check how the Spark 3.5 factory handles the reported StreamingDataSourceV2ScanRelation plan. Done means Kafka inputs are present alongside outputs on Spark 3.5, with tests covering the reported plan and Databricks-style shaded partition keys.
索引モデルが issue の本文から書いたものです。
説明
OpenLineage integration/client
Spark integration
OpenLineage version
io.openlineage:openlineage-spark_2.13:1.55.0io.openlineage:transports-s3:1.55.0(S3 transport)
Technology and package versions
| Component | Version |
|---|---|
| Platform | Databricks |
| Apache Spark (failing case) | 3.5.2 (processing_engine.version on emitted events) |
| Apache Spark (control — works) | 4.0.0 (same OpenLineage JAR, same job) |
| Scala | 2.13 (openlineage-spark_2.13 on driver) |
| OpenLineage Spark adapter | 1.55.0 |
| Kafka connector | Spark kafka / KafkaSourceProvider (KafkaTable, MicroBatchScan) |
| Databricks Runtime | e.g. 16.4 LTS (Spark 3.5.2) vs DBR with Spark 4.0 |
Environment configuration
spark.extraListeners=io.openlineage.spark.agent.OpenLineageSparkListener,com.databricks.backend.daemon.driver.DBCEventLoggingListener
spark.openlineage.transport.type=s3
spark.openlineage.transport.bucketName=bucket
spark.openlineage.transport.fileNamePrefix=openlineage/events/
spark.openlineage.namespace=workspace_name
spark.openlineage.version=v1
Deployment details
Init script: copies openlineage-spark_2.13-1.55.0.jar and transports-s3-1.55.0.jar to /databricks/jars.
Pipeline: readStream.format("kafka") → decode → writeStream.toTable(<catalog>.<schema>.<table>).
Problem details
On Databricks with Apache Spark 3.5.x, OpenLineage 1.55.0 emits streaming COMPLETE events with Unity Catalog / Delta outputs but inputs: [] for the Kafka source. The same Structured Streaming job on Spark 4.0 with the same OpenLineage version produces both Kafka inputs and UC/Delta outputs.
This is a follow-up to #5099: #5101 fixed shaded TopicPartition on the Spark 4 code path (StreamingDataSourceV2ScanRelationDatasetBuilder + KafkaMicroBatchStreamStrategy). On Spark 3.5.x, that builder is not registered in Spark35DatasetBuilderFactory, so #5101 never runs even though the logical plan already contains StreamingDataSourceV2ScanRelation.
On both Spark versions the analyzed logical plan uses the same shape: WriteToMicroBatchDataSourceV1 over StreamingDataSourceV2ScanRelation … KafkaTable (not legacy StreamingDataSourceV2Relation). See SPARK-46777, #4018.
Actual behavior
Spark 3.5.2 (failing):
- Stream and sink succeed; UC table is updated.
- OpenLineage
COMPLETEhasinputs: []and populatedoutputs(openlineageAdapterVersion: 1.55.0). - Driver Log4j: no
Selected this strategy: KafkaMicroBatchStreamStrategy(input builder not invoked). No #5099-styleTopicPartitionProxyerror on 1.55.0 — strategy simply never runs.
Spark 4.0 (control — same job, same OL 1.55.0):
COMPLETEincludes Kafka inputs (subscribed topic) and UC/Delta outputs.- Log4j may show
Selected this strategy: KafkaMicroBatchStreamStrategy(after #5101).
Logical plan (representative)
Plan parity (redacted; same job on DBR Spark 3.5.2 vs 4.0):
| Plan element | Spark 3.5.2 | Spark 4.0 |
|---|---|---|
| Sink | WriteToMicroBatchDataSourceV1 → UC/Delta DeltaSink |
Same |
| Source logical node | StreamingDataSourceV2ScanRelation[...] KafkaTable |
Same |
| Source physical node | MicroBatchScan[...] KafkaSourceProvider$KafkaScan |
Same |
Legacy StreamingDataSourceV2Relation |
Not present | Not present |
WriteToMicroBatchDataSourceV1 `<catalog>`.`<schema>`.`<table>`, DeltaSink[s3://<uc-storage>/...], ...
+- ...
+- StreamingDataSourceV2ScanRelation[key#..., value#..., topic#..., partition#..., offset#..., ...] KafkaTable
Physical:
+- MicroBatchScan[...] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan
Root cause (analysis)
OpenLineage picks a DatasetBuilderFactory from SPARK_VERSION (DatasetBuilderFactoryProvider):
- 3.4.x →
Spark34DatasetBuilderFactory - 3.5.x →
Spark35DatasetBuilderFactory - 4.x →
Spark40DatasetBuilderFactory
Spark34DatasetBuilderFactory / Spark35DatasetBuilderFactory register WriteToMicroBatchDataSourceV1DatasetBuilder (streaming outputs, #4018) but do not register io.openlineage.spark40.agent.lifecycle.plan.StreamingDataSourceV2ScanRelationDatasetBuilder, where KafkaMicroBatchStreamStrategy and #5101 run.
Spark40DatasetBuilderFactory registers both the micro-batch output builder and StreamingDataSourceV2ScanRelationDatasetBuilder. That matches observed behavior: outputs-only on 3.5.2, full lineage on 4.0 with the same plan nodes.
Spark3VisitorFactoryImpl still adds legacy StreamingDataSourceV2RelationVisitor, which does not match StreamingDataSourceV2ScanRelation — no fallback.
| Spark | DatasetBuilderFactory |
Kafka inputs on COMPLETE |
UC/Delta outputs |
|---|---|---|---|
| 3.5.2 | Spark35DatasetBuilderFactory |
Empty | Present |
| 4.0.0 | Spark40DatasetBuilderFactory |
Present | Present |
What you think should happen instead
Streaming COMPLETE events include a Kafka input dataset for the subscribed topic (namespace from bootstrap servers), plus UC/Delta output datasets — on Spark 3.4+ when the plan uses StreamingDataSourceV2ScanRelation, not only on Spark 4.
How to reproduce
- On Databricks DBR with Spark 3.5.x, install
openlineage-spark_2.13-1.55.0on the driver classpath and enable the OpenLineage Spark listener. - Run Structured Streaming: Kafka source (
subscribe,kafka.bootstrap.servers, SASL; usekafkashaded.*in JAAS per Databricks Kafka FAQ) → UC/Delta viawriteStream.toTable(...). - Confirm the stream reads data and the UC table is updated.
- Inspect a streaming
COMPLETEevent:outputspopulated,inputs: []. - Repeat steps 1–4 on Databricks DBR with Spark 4.0 and the same OpenLineage version:
COMPLETEincludes Kafka inputs and UC/Delta outputs (comparedf.explain(true)— sameStreamingDataSourceV2ScanRelation/MicroBatchScanshape).
Additional details
Related work
Possible fix (suggestion)
- Register
StreamingDataSourceV2ScanRelationDatasetBuilder(or move to a shared module) inSpark34DatasetBuilderFactoryandSpark35DatasetBuilderFactory, mirroringSpark40DatasetBuilderFactory, or - Register Kafka streaming input extraction for all Spark ≥ 3.4 when the plan contains
StreamingDataSourceV2ScanRelation+KafkaMicroBatchStream.
Add unit/integration tests for Spark 3.5 (and 3.4 if supported) with StreamingDataSourceV2ScanRelation and Databricks-style kafkashaded.* partition keys (#5101 tests currently target the Spark 4 builder module).
Do you plan to make this contribution yourself?
- I am interested in doing this work
- 主要言語
- Java
- スター
- 2.7k
- フォーク
- 545
- 平均マージ
- 4日 1時間
- マージ済み PR(30日)
- 47
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenLineage/OpenLineage のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
OpenLineage/OpenLineage#5138 ·
メンテナーはふだん 2 日以内に返信
-
[BUG] Python token providers ignore a numeric zero refresh buffer対応中かも @bosprimigenious が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
OpenLineage/OpenLineage#5126 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
OpenLineage/OpenLineage#5114 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
kind:proposal state:needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
OpenLineage/OpenLineage#5106 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
kind:feature state:needs-triage
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
OpenLineage/OpenLineage#5098 ·
メンテナーはふだん 2 日以内に返信
OpenLineage/OpenLineage の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
scylladb/scylla-cdc-source-connector#402 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ahmedmmordi/store-app#8 ·
-
jhipster heroku fails on heroku git:remote when reusing an existing app outside a git repositoryオープンarea: triage theme: undefined
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
jhipster/generator-jhipster#36018 ·
メンテナーはふだん 1 日以内に返信