A programming language for data stream processing.

$ cargo install aqua --git https://github.com/aqua-language/aqua
Text copied to clipboard!
 1  # Calculate the total quantity and average EUR price of items every
 2  # six hours for orders that have been shipped in the last day.
 3  
 4  struct Item(id:u64, priceUsd:f64, quantity:u64);
 5  struct Order(id:u64, items:Vec[Item], status:String, timestamp:Time);
 6  
 7  var reader = Reader::kafka("localhost:9092/orders");
 8  var writer = Writer::kafka("localhost:9092/items");
 9  var format = Format::json();
10  
11  var query =
11    from order:Order in Stream::source(reader, format, _.timestamp)
12    where order.status == "shipped"
13    from item:Item in order.items
14    group itemId = item.id
15      over Window::sliding(1d, 6h)
16      compute avgPriceUsd = avg of item.priceUsd,
17              totalQuantity = sum of item.quantity
18    select itemId, avgPriceEur = avgPriceUsd * 0.85, totalQuantity
19    into sink(writer, format);
20  
21  query.run(Backend::flink());

Get Started ⇩

Overview

Aqua is a high-level programming language for processing data streams. It is designed to be simple, expressive, efficient and safe. Aqua compiles to dataflow systems such as Apache Flink (Java), and a custom native runtime (Rust).

Features (Planned)

Installation

$ cargo install aqua --git https://github.com/aqua-language/aqua

Usage

$ aqua
>> print("Hello world!");
Hello world!

More