Data processing systems face a challenge to support increasingly diverse workloads efficiently. At the same time, they are already bloated with internal complexity and it is not clear how new hardware can be supported sustainably.
We propose a layered query compilation framework with open intermediate representations that applies traditional query optimizations as compiler passes. This enables us to support cross-domain optimizations. Furthermore, we introduce a unified abstraction layer based on declarative sub-operators, as a step towards a future-proof execution of diverse workloads on modern hardware. We demonstrate the benefits by implementing the ideas into our compiling query engine, LingoDB. We show that our system can support a variety of workloads and complex operations with relatively low implementation effort, while also providing competitive performance to state-of-the-art systems.