Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions THIRD_PARTY_NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ SQLQuack's tokenizer, parser and syntax tree are a modified fork of polyglot
The derived code is in crates/sqlquack-syntax-snowflake, which now holds most of it,
crates/sqlquack-syntax and crates/sqlquack-derive. The exact-check corpus
corpora/polyglot-check/polyglot_tests.json holds the SQL inputs of polyglot's tests.
SQLQuack's DuckDB result-type rules, in crates/sqlquack-semantics/src/duckdb/profile/_helpers/typing.rs,
are ported from polyglot's engine type rules, and the fixture
crates/sqlquack-semantics/src/duckdb/profile/tests/fixtures/duckdb_engine_types.json is polyglot's
tests/fixtures/engine_types/duckdb.json, the result types DuckDB bound for its synthetic cases.
DuckDB's widening of a signed integer mixed with an unsigned one, unsigned_coercion in
crates/sqlquack-semantics/src/duckdb/profile/_helpers/duck_types.rs, is ported from polyglot's
type annotation. SQLQuack's other DuckDB result-type rules, in
crates/sqlquack-semantics/src/duckdb/profile/_helpers/typing.rs, and the fixture
crates/sqlquack-semantics/src/duckdb/profile/tests/fixtures/duckdb_engine_types.json are
SQLQuack's own, written in its fork of polyglot and never part of upstream polyglot.
The semantic checks in crates/sqlquack-semantics/src/lineage/_helpers/checks are ported from
polyglot's validation: the type families in families.rs, the built-in function signatures in
signatures.rs and the scope rules in scope_rules.rs, and the type checks and their messages in
Expand Down
10 changes: 6 additions & 4 deletions crates/sqlquack/THIRD_PARTY_NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ SQLQuack's tokenizer, parser and syntax tree are a modified fork of polyglot
The derived code is in crates/sqlquack-syntax-snowflake, which now holds most of it,
crates/sqlquack-syntax and crates/sqlquack-derive. The exact-check corpus
corpora/polyglot-check/polyglot_tests.json holds the SQL inputs of polyglot's tests.
SQLQuack's DuckDB result-type rules, in crates/sqlquack-semantics/src/duckdb/profile/_helpers/typing.rs,
are ported from polyglot's engine type rules, and the fixture
crates/sqlquack-semantics/src/duckdb/profile/tests/fixtures/duckdb_engine_types.json is polyglot's
tests/fixtures/engine_types/duckdb.json, the result types DuckDB bound for its synthetic cases.
DuckDB's widening of a signed integer mixed with an unsigned one, unsigned_coercion in
crates/sqlquack-semantics/src/duckdb/profile/_helpers/duck_types.rs, is ported from polyglot's
type annotation. SQLQuack's other DuckDB result-type rules, in
crates/sqlquack-semantics/src/duckdb/profile/_helpers/typing.rs, and the fixture
crates/sqlquack-semantics/src/duckdb/profile/tests/fixtures/duckdb_engine_types.json are
SQLQuack's own, written in its fork of polyglot and never part of upstream polyglot.
The semantic checks in crates/sqlquack-semantics/src/lineage/_helpers/checks are ported from
polyglot's validation: the type families in families.rs, the built-in function signatures in
signatures.rs and the scope rules in scope_rules.rs, and the type checks and their messages in
Expand Down
10 changes: 6 additions & 4 deletions python/THIRD_PARTY_NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ SQLQuack's tokenizer, parser and syntax tree are a modified fork of polyglot
The derived code is in crates/sqlquack-syntax-snowflake, which now holds most of it,
crates/sqlquack-syntax and crates/sqlquack-derive. The exact-check corpus
corpora/polyglot-check/polyglot_tests.json holds the SQL inputs of polyglot's tests.
SQLQuack's DuckDB result-type rules, in crates/sqlquack-semantics/src/duckdb/profile/_helpers/typing.rs,
are ported from polyglot's engine type rules, and the fixture
crates/sqlquack-semantics/src/duckdb/profile/tests/fixtures/duckdb_engine_types.json is polyglot's
tests/fixtures/engine_types/duckdb.json, the result types DuckDB bound for its synthetic cases.
DuckDB's widening of a signed integer mixed with an unsigned one, unsigned_coercion in
crates/sqlquack-semantics/src/duckdb/profile/_helpers/duck_types.rs, is ported from polyglot's
type annotation. SQLQuack's other DuckDB result-type rules, in
crates/sqlquack-semantics/src/duckdb/profile/_helpers/typing.rs, and the fixture
crates/sqlquack-semantics/src/duckdb/profile/tests/fixtures/duckdb_engine_types.json are
SQLQuack's own, written in its fork of polyglot and never part of upstream polyglot.
The semantic checks in crates/sqlquack-semantics/src/lineage/_helpers/checks are ported from
polyglot's validation: the type families in families.rs, the built-in function signatures in
signatures.rs and the scope rules in scope_rules.rs, and the type checks and their messages in
Expand Down
6 changes: 3 additions & 3 deletions website/src/content/docs/docs/credits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ SQLQuack wouldn't exist without two projects:

- **[Polyglot](https://github.com/tobilg/polyglot)** by Tobias
([@tobilg](https://github.com/tobilg)). SQLQuack's tokenizer, parser and syntax tree are a
modified fork of Polyglot's, and much of that code is still his. Its DuckDB result-type rules
and its semantic checks are also ported from Polyglot.
modified fork of Polyglot's, and much of that code is still his. Its semantic checks and its
rule for widening mixed signed and unsigned integers are also ported from Polyglot.
- **[SQLGlot](https://github.com/tobymao/sqlglot)** by Toby Mao and contributors. Polyglot is a
Rust port of SQLGlot and is based on its design, and so is SQLQuack's parser. SQLQuack also uses
the Snowflake SQL of SQLGlot's test suite as case inputs, with the expected answers recorded from
Snowflake itself.

The translation to DuckDB and the recorded evidence behind it are SQLQuack's own.
The translation to DuckDB, the typing and the recorded evidence behind them are SQLQuack's own.
SQLQuack goes a different way from both projects on translation. It doesn't rewrite the tree and
print it out. It checks each rule against recorded warehouse results and refuses what it can't
prove.
Expand Down
Loading