delta icon indicating copy to clipboard operation
delta copied to clipboard

SC-211135: Implement analyzer rule for V2 streaming reads

Open vitaliili-db opened this issue 1 month ago • 0 comments

This implements Option A from the design doc: using an analyzer rule to replace V1 (DeltaTableV2) with V2 (SparkTable) for streaming reads only.

Key changes:

  • Add UseKernelForStreamingRule analyzer rule in spark-unified module
  • Rule pattern matches on StreamingRelationV2 to isolate streaming reads
  • Add DELTA_KERNEL_STREAMING_ENABLED config flag (default: false)
  • Register rule in DeltaSparkSessionExtension

Behavior:

  • Streaming reads (readStream) → V2 (Kernel-based, MicroBatchStream)
  • Streaming writes (writeStream) → V1 (DeltaLog-based)
  • Batch reads/writes → V1 (DeltaLog-based)
  • MERGE/UPDATE/DELETE → V1 (DeltaLog-based)

This approach:

  • Requires zero user code changes
  • Works with existing V1 and V2 implementations unchanged
  • Enables gradual rollout via configuration flag
  • Provides graceful fallback on errors

Which Delta project/connector is this regarding?

  • [ ] Spark
  • [ ] Standalone
  • [ ] Flink
  • [ ] Kernel
  • [ ] Other (fill in here)

Description

How was this patch tested?

Does this PR introduce any user-facing changes?

vitaliili-db avatar Nov 10 '25 23:11 vitaliili-db