A quick tour of RAW’s main language features

 

Query CSV, JSON, XML and other raw data directly

RAW queries data directly from source and in real-time, including popular file formats such as CSV, JSON, XML and machine logs. The data schema is inferred automatically by RAW and can be adjusted through queries. RAW builds, maintains and reuses caches of raw data autonomously and transparently to the user.
SELECT * FROM `sales.csv` sale, `products.json` product
WHERE sale.product_id = product.detail.id
AND product.detail.country = "CH"

Support for Machine Logs

RAW includes native support for parsing semi-structured data. With a query, you can turn a sequence of entries in a log file into a sequence of records, which are then converted into efficient data formats. No scripts are needed.
SELECT *
FROM log_file
PARSE AS r"""(\d+-\d+-\d+\s+\d+:\d+)\s+(\w+)\s+-\s+(.*)"""
INTO (time: strtodate(_1, "yyyy-MM-dd HH:MM"), service: _2, event: _3)

Support for Complex Data

RAW data model goes beyond “tables” and fully supports complex data structures, including hierarchies and arrays. These data structures are first-class citizens in RAW and can be used seamlessly through RAW’s extended SQL language, allowing for complex transformations, including ETL tasks or advanced analytics.
SELECT s.country, AVG(SELECT cost FROM s.products WHERE category="Keyboard") AS avg_cost FROM sales s

Assignments

RAW’s extended SQL allows users to build complex queries in parts and use assignments freely. Users can preview partial results while building a query.
{
  young_professor_age := 30;
  young_profs := SELECT * FROM professors
                 WHERE age <= young_professor_age;
  SELECT * FROM students s, young_profs p
  WHERE s.age > p.age
}

Modern Type System

RAW includes a modern type system with support for polymorphic functions. Users can build reusable code for processing data. Entire libraries of code can be built and shared between users of RAW.
{
  filter_young(data, age) := SELECT * FROM data d
                             WHERE d.age <= age;
  SELECT * FROM filter_young(professors, 30)
}