Global DAG Mapping for SQL Parallelism and Shuffle Visibility
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing distributed computing systems like Apache Spark and Apache Flink generate local DAGs that lack comprehensive content information, particularly regarding parallelism and data-exchange strategies, making it difficult for developers to optimize SQL query performance and face challenges when mixing different compilers and execution engines.
Innovation Solution
A system and method to create a global DAG for the entire SQL job, using a custom data structure that maps relational expressions to execution engine operators, providing graphical representation of execution plans and shuffle rules, enabling developers to understand and optimize query performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If local DAGs are generated by distributed computing systems, then execution can be performed, but comprehensive content information about parallelism and data-exchange strategies is lost
Solution Approach 1:
The execution plan is segmented into multiple stages, where each stage represents a set of operations that can be executed in parallel. This segmentation allows the system to maintain comprehensive information about parallelism and data-exchange strategies while enabling distributed execution. Each stage is further divided into tasks that can be assigned to different workers, preserving the execution plan's structural information throughout the distributed computation.
Solution Approach 2:
An intermediary representation layer is introduced between the SQL query and the distributed execution tasks. This intermediary maintains the execution plan as a global DAG structure that captures parallelism and data-exchange strategies, while allowing individual tasks to execute independently. The intermediary ensures that comprehensive information is preserved without requiring all workers to maintain the entire execution plan in memory.
2Loss of information
If developers want to optimize SQL query performance, then they need comprehensive insights into execution processes, but existing tools do not provide sufficient visibility
Solution Approach 1:
The system provides feedback mechanisms that expose the global execution plan and shuffle rules to developers during query optimization. By displaying the execution plan as a visual representation with identified stages and tasks, developers receive immediate feedback about how their SQL queries will be executed, enabling them to optimize performance without extensive trial and error. The feedback is integrated into the query development workflow, allowing developers to review and adjust their queries based on the exposed execution information.
3Adaptability or versatility
If multiple compilers and execution engines are used, then versatility is improved, but it becomes challenging to mix and coordinate different systems
Solution Approach 1:
The execution plan representation is designed as a universal structure that can be generated and interpreted by multiple compilers and execution engines. The global DAG format serves as a common language that different systems can understand and work with, enabling versatility in choosing different compilers and execution engines without requiring complex integration logic. Each system can generate the universal execution plan representation and consume it, facilitating interoperability while maintaining the benefits of using specialized tools for different parts of the computation.
Data Source
AI summary
Creating a global directed acyclic graph (DAG) of an execution plan according to a logical plan derived from one or more Structured Query Language (SQL) queries. The logical plan comprises a set of SqlNodes, where each non-root SqlNode includes parent SqlNode information. The DAG comprises vertices connected by edges, wherein each vertex corresponds to a respective relational expression of a set of relational expressions and is labeled according to an operator of an execution engine, such as Spark, that has been mapped to the respective relational expression. The DAG may be displayed via a graphical user interface. In some implementations, one or more vertices includes information indicating a level of execution parallelism and/or cache enablement.


