@malloydata/malloy-tests 0.0.436 → 0.0.438
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTEXT.md +1 -1
- package/databricks/diag_databricks.ts +1 -0
- package/package.json +11 -11
- package/presto/presto_start.sh +1 -1
- package/src/core/bugless.spec.ts +20 -0
- package/src/databases/all/array_query.spec.ts +720 -0
- package/src/databases/all/db_filter_expressions.spec.ts +27 -0
- package/src/databases/all/expr.spec.ts +101 -1
- package/src/databases/all/join.spec.ts +265 -1
- package/src/databases/all/nest.spec.ts +34 -0
- package/src/databases/bigquery/handexpr.spec.ts +6 -2
- package/src/databases/bigquery/wildcard_table_names.spec.ts +3 -3
- package/src/databases/postgres/postgres.spec.ts +22 -0
- package/src/runtimes.ts +1 -0
package/CONTEXT.md
CHANGED
|
@@ -181,7 +181,7 @@ All cross-database tests (`test/src/databases/all/`) reference tables as `malloy
|
|
|
181
181
|
| Trino/Presto | The hive connector reads the parquet in place: each file is mounted into the container and declared as an external table | `test/trino/hive_ddl.ts`, `test/trino/hive.properties`, `test/presto/hive.properties` | `trino_start.sh` / `presto_start.sh` derive the DDL from the parquet schemas at container start. The hive metastore lowercases names, so a table with nested columns (`ga_sample`) is a `_hive` table plus a view that casts the nested field names back; top-level column names stay lowercase, since Trino lowercases those in every connector |
|
|
182
182
|
| BigQuery | Pre-loaded manually in `malloydata-org` project | (none) | No loader script in repo. Data assumed to exist. |
|
|
183
183
|
| Snowflake | SQL: `PUT` local parquet → stage, `COPY INTO` table | `test/snowflake/load_test_data.sh` (wraps `load_test_data.sql`) | Run via `sh test/snowflake/load_test_data.sh` (needs the `snowsql` CLI) |
|
|
184
|
-
| Databricks | TS script: upload to Volume via REST, `CREATE TABLE AS SELECT FROM read_files()` | `test/databricks/load_test_data.sh` (wraps `load_test_data.ts`) | Run manually with the `DATABRICKS_*` env vars set: `sh test/databricks/load_test_data.sh` |
|
|
184
|
+
| Databricks | TS script: upload to Volume via REST, `CREATE TABLE AS SELECT FROM read_files()` | `test/databricks/load_test_data.sh` (wraps `load_test_data.ts`) | Run manually with the `DATABRICKS_*` env vars set: `sh test/databricks/load_test_data.sh`. From a network that reaches the workspace only through a proxy, `DATABRICKS_HTTPS_PROXY` is the connection's `proxy` setting for the tests and `diag_databricks.ts`; the loader uploads with `fetch`, which does not use it |
|
|
185
185
|
|
|
186
186
|
The DuckDB-driven loaders share `test/data/parquet_loader.ts`, which runs everything through Malloy's own `DuckDBConnection`, so a database is built by the same DuckDB the tests read it with. It reads the table list from the parquet directory and takes a `LoadPlan` naming what a target cannot hold.
|
|
187
187
|
|
|
@@ -17,6 +17,7 @@ async function main() {
|
|
|
17
17
|
token: process.env['DATABRICKS_TOKEN'],
|
|
18
18
|
defaultCatalog: process.env['DATABRICKS_CATALOG'],
|
|
19
19
|
defaultSchema: process.env['DATABRICKS_SCHEMA'],
|
|
20
|
+
proxy: process.env['DATABRICKS_HTTPS_PROXY'],
|
|
20
21
|
});
|
|
21
22
|
|
|
22
23
|
const sql = process.argv[2];
|
package/package.json
CHANGED
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"malloyc": "ts-node ../scripts/malloy-to-json"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@malloydata/db-bigquery": "0.0.
|
|
24
|
-
"@malloydata/db-duckdb": "0.0.
|
|
25
|
-
"@malloydata/db-postgres": "0.0.
|
|
26
|
-
"@malloydata/db-snowflake": "0.0.
|
|
27
|
-
"@malloydata/db-sqlserver": "0.0.
|
|
28
|
-
"@malloydata/db-trino": "0.0.
|
|
29
|
-
"@malloydata/malloy": "0.0.
|
|
30
|
-
"@malloydata/malloy-tag": "0.0.
|
|
31
|
-
"@malloydata/render": "0.0.
|
|
32
|
-
"@malloydata/render-validator": "0.0.
|
|
23
|
+
"@malloydata/db-bigquery": "0.0.438",
|
|
24
|
+
"@malloydata/db-duckdb": "0.0.438",
|
|
25
|
+
"@malloydata/db-postgres": "0.0.438",
|
|
26
|
+
"@malloydata/db-snowflake": "0.0.438",
|
|
27
|
+
"@malloydata/db-sqlserver": "0.0.438",
|
|
28
|
+
"@malloydata/db-trino": "0.0.438",
|
|
29
|
+
"@malloydata/malloy": "0.0.438",
|
|
30
|
+
"@malloydata/malloy-tag": "0.0.438",
|
|
31
|
+
"@malloydata/render": "0.0.438",
|
|
32
|
+
"@malloydata/render-validator": "0.0.438",
|
|
33
33
|
"events": "^3.3.0",
|
|
34
34
|
"jsdom": "^22.1.0",
|
|
35
35
|
"luxon": "^3.7.2",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"overrides": {
|
|
44
44
|
"typescript": "^6.0.3"
|
|
45
45
|
},
|
|
46
|
-
"version": "0.0.
|
|
46
|
+
"version": "0.0.438"
|
|
47
47
|
}
|
package/presto/presto_start.sh
CHANGED
package/src/core/bugless.spec.ts
CHANGED
|
@@ -21,6 +21,26 @@ describe('misc tests for regressions that have no better home', () => {
|
|
|
21
21
|
`).toMatchResult(testModel, {});
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
+
test('rename a field in a join below a filtered join', async () => {
|
|
25
|
+
// A filtered join becomes a subquery, and the joins below it are packed
|
|
26
|
+
// into a struct under their column names, which a rename leaves different
|
|
27
|
+
// from the name the query uses.
|
|
28
|
+
await expect(`
|
|
29
|
+
source: two is duckdb.sql("""SELECT 1 as k, 'acme' as name""") extend {
|
|
30
|
+
rename: two_k is k
|
|
31
|
+
primary_key: two_k
|
|
32
|
+
}
|
|
33
|
+
source: one is duckdb.sql("""SELECT 1 as k, 2 as j""") extend {
|
|
34
|
+
where: j > 0
|
|
35
|
+
join_one: two with k
|
|
36
|
+
}
|
|
37
|
+
source: zero is duckdb.sql("""SELECT 1 as k""") extend {
|
|
38
|
+
join_one: one on one.k = k
|
|
39
|
+
}
|
|
40
|
+
run: zero -> { group_by: one.two.name, one.two.two_k }
|
|
41
|
+
`).toMatchResult(testModel, {name: 'acme', two_k: 1});
|
|
42
|
+
});
|
|
43
|
+
|
|
24
44
|
test('ambiguous output names are auto-renamed and runnable', async () => {
|
|
25
45
|
// `state` and `s2.state` both want the name `state`; the second is renamed
|
|
26
46
|
// to `s2_state`. The query must compile to runnable SQL. (Small table with
|