Apache Spark Big Data (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
What is Adaptive Query Execution (AQE) in Spark 3.x?
senior LevelSystem Design
In Simple Words: AQE dynamically re-optimizes query plans at runtime based on actual stage execution statistics:
- Dynamically Coalescing Shuffle Partitions: Automatically combines hundreds of tiny shuffle partitions into optimal partition sizes.
- Dynamically Switching Join Strategies: Converts a Sort-Merge Join to a Broadcast Hash Join if a table's filtered runtime size turns out to be smaller than the broadcast threshold.
- Dynamically Handling Data Skew: Automatically splits skewed shuffle partitions into smaller sub-partitions.