@malloydata/malloy-tests 0.0.222-dev241212154316 → 0.0.222-dev241212204326

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.222-dev241212154316",
25
- "@malloydata/db-duckdb": "^0.0.222-dev241212154316",
26
- "@malloydata/db-postgres": "^0.0.222-dev241212154316",
27
- "@malloydata/db-snowflake": "^0.0.222-dev241212154316",
28
- "@malloydata/db-trino": "^0.0.222-dev241212154316",
29
- "@malloydata/malloy": "^0.0.222-dev241212154316",
30
- "@malloydata/render": "^0.0.222-dev241212154316",
24
+ "@malloydata/db-bigquery": "^0.0.222-dev241212204326",
25
+ "@malloydata/db-duckdb": "^0.0.222-dev241212204326",
26
+ "@malloydata/db-postgres": "^0.0.222-dev241212204326",
27
+ "@malloydata/db-snowflake": "^0.0.222-dev241212204326",
28
+ "@malloydata/db-trino": "^0.0.222-dev241212204326",
29
+ "@malloydata/malloy": "^0.0.222-dev241212204326",
30
+ "@malloydata/render": "^0.0.222-dev241212204326",
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.222-dev241212154316"
40
+ "version": "0.0.222-dev241212204326"
41
41
  }
@@ -266,4 +266,45 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
266
266
  run: x -> { aggregate: foo; group_by: bar, arr.each }
267
267
  `).malloyResultMatches(runtime, {foo: 0});
268
268
  });
269
+ it('complex nesting composite without join', async () => {
270
+ await expect(`
271
+ ##! experimental.composite_sources
272
+ source: state_facts is ${databaseName}.table('malloytest.state_facts')
273
+ source: x is compose(
274
+ compose(
275
+ state_facts,
276
+ state_facts extend {
277
+ dimension: bar is 1
278
+ }
279
+ ) extend {
280
+ measure: foo is sum(0)
281
+ },
282
+ state_facts extend {
283
+ measure: foo is sum(0) + 1
284
+ dimension: bar is 2
285
+ }
286
+ )
287
+ run: x -> { aggregate: foo; group_by: bar }
288
+ `).malloyResultMatches(runtime, {foo: 0, bar: 1});
289
+ });
290
+ it('complex nesting composite with join', async () => {
291
+ await expect(`
292
+ ##! experimental.composite_sources
293
+ source: state_facts is ${databaseName}.table('malloytest.state_facts')
294
+ source: x is compose(
295
+ compose(
296
+ state_facts,
297
+ state_facts extend {
298
+ dimension: the_state is 'CA'
299
+ }
300
+ ),
301
+ state_facts extend {
302
+ dimension: the_state is 'IL'
303
+ }
304
+ ) extend {
305
+ join_one: state_facts on the_state = state_facts.state
306
+ }
307
+ run: x -> { group_by: state_facts.state }
308
+ `).malloyResultMatches(runtime, {state: 'CA'});
309
+ });
269
310
  });
@@ -313,6 +313,13 @@ describe.each(runtimes.runtimeList)(
313
313
  query: 'first_param=val_one&second_param=2',
314
314
  });
315
315
  });
316
+ test('string split function in tresto', async () => {
317
+ await expect(`
318
+ run: ${databaseName}.sql("SELECT 1 AS N") -> {
319
+ select: some_words is split('hello world', ' ')
320
+ }
321
+ `).malloyResultMatches(runtime, {some_words: ['hello', 'world']});
322
+ });
316
323
  }
317
324
  );
318
325
 
@@ -21,13 +21,13 @@
21
21
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
 
24
- import {composeSQLExpr, StructDef} from '@malloydata/malloy';
24
+ import {composeSQLExpr, SourceDef} from '@malloydata/malloy';
25
25
  import {fToQF} from '../util';
26
26
 
27
27
  // will it build?
28
28
 
29
29
  /** Medicare Model */
30
- export const medicareModel: StructDef = {
30
+ export const medicareModel: SourceDef = {
31
31
  as: 'medicare_test',
32
32
  dialect: 'standardsql',
33
33
  fields: [
@@ -218,7 +218,7 @@ export const medicareModel: StructDef = {
218
218
  tablePath: 'malloydata-org.malloytest.bq_medicare_test',
219
219
  };
220
220
 
221
- export const medicareStateFacts: StructDef = {
221
+ export const medicareStateFacts: SourceDef = {
222
222
  fields: [],
223
223
  name: 'medicare_state_facts',
224
224
  dialect: 'standardsql',