Abstract
SQL++ is a formal, backward-compatible extension of SQL designed to natively handle the "messy" reality of modern data—specifically semi-structured, nested, and schemaless formats like JSON. By strategically "relaxing" traditional SQL constraints rather than bolting on complex new features, it provides a unified query language that bridges the gap between relational databases and NoSQL systems.
Introduction
For five decades, SQL has reigned supreme in the world of flat, strictly typed tabular data. However, the "cloud era" ushered in NoSQL systems and semi-structured data (JSON, Avro, Parquet) that do not fit the rigid relational mold. Until now, the industry has tackled this in two suboptimal ways: the "bolt-on" approach, where traditional vendors add non-standard JSON functions, and the "fragmented" approach, where NoSQL vendors create proprietary APIs lacking SQL's expressive power.
The authors—including Don Chamberlin, the co-creator of SQL—propose SQL++ as a way to bring the skills, tools, and maturity of the SQL community to modern, flexible data.
Methodology: The Philosophy of Relaxation
The core philosophy of SQL++ is relaxation. Instead of adding a mountain of new syntax, it removes specific restrictions inherent in the SQL-92 standard:
- Data Model Relaxation: SQL++ allows collections to contain anything—scalars, arrays, or nested structs—with or without a schema, moving beyond homogeneous tuples.
- The
MISSINGValue: It introducesMISSINGas a distinct concept fromNULL. WhileNULLindicates an unknown value,MISSINGhandles cases where an attribute simply doesn't exist, allowing for permissive query execution. - Left-Correlation: The
FROMclause can reference variables defined earlier in the same clause, enabling intuitive "unnesting" of records using standard join logic. - Core vs. Syntactic Sugar: The language is built on a "Core" of fully composable functional operators. Standard SQL is treated as "syntactic sugar" mapping onto this core, ensuring 100% backward compatibility.
Key Insights
SQL++ demonstrates that "relaxation" is more elegant than "addition." By allowing variables to bind to any value, the language naturally scales to handle JSON. Furthermore, SQL++ represents a convergence of major industry dialects, including Apache AsterixDB, Couchbase’s N1QL, and Amazon’s PartiQL (used in Redshift, DynamoDB, and S3 Select). It prioritizes composability, ensuring that the output of any clause can be fed directly into another, making subqueries and nested results intuitive.
Industry Impact and Results
SQL++ is not merely a theoretical exercise; it is already powering massive production systems at Amazon and Couchbase. The paper demonstrates that complex transformations—such as pivoting a flat list of stock prices into a nested JSON object—can be performed in a single, readable SQL-like block without external application logic. It offers a "best of both worlds" solution for data lakes and heterogeneous data by respecting schemas when they exist while remaining schema-optional.
Limitations and Future Directions
While the "Core" is well-defined, minor syntactic gaps remain between commercial implementations like PartiQL and N1QL. The authors emphasize the need for a shared "Compatibility Kit" to ensure cross-vendor consistency. Ultimately, the paper serves as a call to arms for the database community to stop inventing fragmented languages and instead contribute to this unified, relaxed standard.
Summary updated