Skip to content
/ wvlet Public
forked from wvlet/wvlet

A flow-style query language for SQL engines

License

Notifications You must be signed in to change notification settings

smdmts/wvlet

This branch is 1 commit ahead of, 320 commits behind wvlet/wvlet:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Dec 2, 2024
a61380a · Dec 2, 2024
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wvlet

Wvlet, pronounced as weave-let, is a new cross-SQL flow-style query language for functional data modeling and interactive data exploration. Wvlet works with various types of SQL-based database engines, including DuckDB, Trino, Hive, etc.

wvlet-architecture

demo

Why Wvlet?

Wvlet queries (saved as .wv files) provide a natural way to describe data processing pipelines, which will eventually be compiled into a sequence of SQL queries. While SQL is a powerful language for processing data, its syntax often does not match the semantic order of data processing. Let's see the following example: The syntactic order of SQL's SELECT ... statements mismatches with the actual data flow inside the SQL engines (cited from A Critique of Modern SQL And A Proposal Towards A Simple and Expressive Query Language (CIDR '24)):

semantic-order

For overcoming this shortcoming of SQL, Wvlet starts from a table scan statement from ..., and the result can be streamlined to the next processing operators like where, group by, select, etc., as if passing table values through a pipe to the next operator:

from (table)
where (filtering condition)
...
where (more filtering condition can be added)
group by (grouping keys, ...)
where (group condition can be added just with where)
select (columns to output)
order by (ordering columns...)
limit (limiting the number of output rows)

With this flow style, you can describe data processing pipelines in a natural order to create complex queries. You can also add operators for testing or debugging data in the middle of the query. This flow syntax is gaining traction and has been adopted in Google's SQL to simplify writing SQL queries. For more details, see SQL Has Problems. We Can Fix Them: Pipe Syntax In SQL (VLDB 2024).

Contributors

Many thanks to everyone who has contributed to our progress:

Contributors

About

A flow-style query language for SQL engines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 90.6%
  • Shell 4.7%
  • TypeScript 2.8%
  • JavaScript 0.7%
  • CSS 0.4%
  • HTML 0.3%
  • Other 0.5%