@malloydata/malloy-tests 0.0.223-dev241216191808 → 0.0.223-dev241217155138

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/package.json CHANGED
@@ -21,13 +21,13 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@jest/globals": "^29.4.3",
24
- "@malloydata/db-bigquery": "^0.0.223-dev241216191808",
25
- "@malloydata/db-duckdb": "^0.0.223-dev241216191808",
26
- "@malloydata/db-postgres": "^0.0.223-dev241216191808",
27
- "@malloydata/db-snowflake": "^0.0.223-dev241216191808",
28
- "@malloydata/db-trino": "^0.0.223-dev241216191808",
29
- "@malloydata/malloy": "^0.0.223-dev241216191808",
30
- "@malloydata/render": "^0.0.223-dev241216191808",
24
+ "@malloydata/db-bigquery": "^0.0.223-dev241217155138",
25
+ "@malloydata/db-duckdb": "^0.0.223-dev241217155138",
26
+ "@malloydata/db-postgres": "^0.0.223-dev241217155138",
27
+ "@malloydata/db-snowflake": "^0.0.223-dev241217155138",
28
+ "@malloydata/db-trino": "^0.0.223-dev241217155138",
29
+ "@malloydata/malloy": "^0.0.223-dev241217155138",
30
+ "@malloydata/render": "^0.0.223-dev241217155138",
31
31
  "events": "^3.3.0",
32
32
  "jsdom": "^22.1.0",
33
33
  "luxon": "^2.4.0",
@@ -37,5 +37,5 @@
37
37
  "@types/jsdom": "^21.1.1",
38
38
  "@types/luxon": "^2.4.0"
39
39
  },
40
- "version": "0.0.223-dev241216191808"
40
+ "version": "0.0.223-dev241217155138"
41
41
  }
@@ -1310,6 +1310,39 @@ expressionModels.forEach((x, databaseName) => {
1310
1310
  });
1311
1311
  });
1312
1312
 
1313
+ describe('hll_functions', () => {
1314
+ const supported = runtime.dialect.supportsHyperLogLog;
1315
+ it.when(supported)(`hyperloglog basic - ${databaseName}`, async () => {
1316
+ await expect(`run: ${databaseName}.table('malloytest.state_facts') -> {
1317
+ aggregate:
1318
+ m1 is floor(hll_estimate(hll_accumulate(state))/10)
1319
+ }`).malloyResultMatches(runtime, {m1: 5});
1320
+ });
1321
+
1322
+ it.when(supported)(`hyperloglog combine - ${databaseName}`, async () => {
1323
+ await expect(`run: ${databaseName}.table('malloytest.state_facts') -> {
1324
+ group_by: state
1325
+ aggregate: names_hll is hll_accumulate(popular_name)
1326
+ } -> {
1327
+ aggregate: name_count is hll_estimate(hll_combine(names_hll))
1328
+ }
1329
+ `).malloyResultMatches(runtime, {name_count: 6});
1330
+ });
1331
+
1332
+ it.when(supported)(
1333
+ `hyperloglog import/export - ${databaseName}`,
1334
+ async () => {
1335
+ await expect(`run: ${databaseName}.table('malloytest.state_facts') -> {
1336
+ group_by: state
1337
+ aggregate: names_hll is hll_export(hll_accumulate(popular_name))
1338
+ } -> {
1339
+ aggregate: name_count is hll_estimate(hll_combine(hll_import(names_hll)))
1340
+ }
1341
+ `).malloyResultMatches(runtime, {name_count: 6});
1342
+ }
1343
+ );
1344
+ });
1345
+
1313
1346
  describe('dialect functions', () => {
1314
1347
  describe('duckdb', () => {
1315
1348
  const isDuckdb = databaseName === 'duckdb';