Treffer: Representations and Optimizations for Embedded Parallel Dataflow Languages

Title:
Representations and Optimizations for Embedded Parallel Dataflow Languages
Contributors:
Deutsche Forschungsgemeinschaft, European Commission, Bundesministerium für Wissenschaft und Forschung, Oracle Labs
Source:
ACM Transactions on Database Systems ; volume 44, issue 1, page 1-44 ; ISSN 0362-5915 1557-4644
Publisher Information:
Association for Computing Machinery (ACM)
Publication Year:
2019
Document Type:
Fachzeitschrift article in journal/newspaper
Language:
English
DOI:
10.1145/3281629
Accession Number:
edsbas.C612769B
Database:
BASE

Weitere Informationen

Parallel dataflow engines such as Apache Hadoop, Apache Spark, and Apache Flink are an established alternative to relational databases for modern data analysis applications. A characteristic of these systems is a scalable programming model based on distributed collections and parallel transformations expressed by means of second-order functions such as map and reduce. Notable examples are Flink’s DataSet and Spark’s RDD programming abstractions. These programming models are realized as EDSLs—domain specific languages embedded in a general-purpose host language such as Java, Scala, or Python. This approach has several advantages over traditional external DSLs such as SQL or XQuery. First, syntactic constructs from the host language (e.g., anonymous functions syntax, value definitions, and fluent syntax via method chaining) can be reused in the EDSL. This eases the learning curve for developers already familiar with the host language. Second, it allows for seamless integration of library methods written in the host language via the function parameters passed to the parallel dataflow operators. This reduces the effort for developing analytics dataflows that go beyond pure SQL and require domain-specific logic. At the same time, however, state-of-the-art parallel dataflow EDSLs exhibit a number of shortcomings. First, one of the main advantages of an external DSL such as SQL—the high-level, declarative Select-From-Where syntax—is either lost completely or mimicked in a non-standard way. Second, execution aspects such as caching, join order, and partial aggregation have to be decided by the programmer. Optimizing them automatically is very difficult due to the limited program context available in the intermediate representation of the DSL. In this article, we argue that the limitations listed above are a side effect of the adopted type-based embedding approach. As a solution, we propose an alternative EDSL design based on quotations. We present a DSL embedded in Scala and discuss its compiler pipeline, intermediate ...