delta-io / delta

An open-source storage framework that enables building a Lakehouse architecture with compute engines including Spark, PrestoDB, Flink, Trino, and Hive and APIs
https://delta.io
Apache License 2.0
6.96k stars 1.58k forks source link

[Spark] Make txn readPredicates thread safe #3022

Closed cstavr closed 1 week ago

cstavr commented 2 weeks ago

Which Delta project/connector is this regarding?

Description

OptimisticTransaction.readPredicates may be updated by multiple threads that call filesForScan. This commit turns it from an ArrayBuffer to a ConcurrentLinkedQueue to be thread safe.

How was this patch tested?

Existing tests.

Does this PR introduce any user-facing changes?

No