@malloydata/malloy-tests 0.0.184 → 0.0.185-dev240919025438
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 +8 -8
- package/src/databases/all/nomodel.spec.ts +1 -1
- package/src/databases/bigquery/double_truncation.spec.ts +1 -1
- package/src/databases/bigquery/handexpr.spec.ts +4 -4
- package/src/databases/bigquery/injestion_time_partitioning.spec.ts +13 -13
- package/src/databases/bigquery/joined_filters.spec.ts +2 -2
- package/src/databases/bigquery/malloy_query.spec.ts +1 -1
- package/src/databases/bigquery/performance.skipped.spec.ts +1 -1
- package/src/databases/bigquery/wildcard_table_names.spec.ts +12 -12
- package/src/databases/streaming/streaming.spec.ts +2 -1
- package/src/models/faa_model.ts +14 -14
- package/src/models/medicare_model.ts +2 -2
- package/src/render/render.spec.ts +1 -1
- package/src/runtimes.ts +1 -1
- package/src/tags.spec.ts +25 -0
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.
|
|
25
|
-
"@malloydata/db-duckdb": "^0.0.
|
|
26
|
-
"@malloydata/db-postgres": "^0.0.
|
|
27
|
-
"@malloydata/db-snowflake": "^0.0.
|
|
28
|
-
"@malloydata/db-trino": "^0.0.
|
|
29
|
-
"@malloydata/malloy": "^0.0.
|
|
30
|
-
"@malloydata/render": "^0.0.
|
|
24
|
+
"@malloydata/db-bigquery": "^0.0.185-dev240919025438",
|
|
25
|
+
"@malloydata/db-duckdb": "^0.0.185-dev240919025438",
|
|
26
|
+
"@malloydata/db-postgres": "^0.0.185-dev240919025438",
|
|
27
|
+
"@malloydata/db-snowflake": "^0.0.185-dev240919025438",
|
|
28
|
+
"@malloydata/db-trino": "^0.0.185-dev240919025438",
|
|
29
|
+
"@malloydata/malloy": "^0.0.185-dev240919025438",
|
|
30
|
+
"@malloydata/render": "^0.0.185-dev240919025438",
|
|
31
31
|
"jsdom": "^22.1.0",
|
|
32
32
|
"luxon": "^2.4.0",
|
|
33
33
|
"madge": "^6.0.0"
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"@types/jsdom": "^21.1.1",
|
|
37
37
|
"@types/luxon": "^2.4.0"
|
|
38
38
|
},
|
|
39
|
-
"version": "0.0.
|
|
39
|
+
"version": "0.0.185-dev240919025438"
|
|
40
40
|
}
|
|
@@ -32,7 +32,7 @@ const runtimes = new RuntimeList(databasesFromEnvironmentOr(allDatabases));
|
|
|
32
32
|
|
|
33
33
|
// No prebuilt shared model, each test is complete. Makes debugging easier.
|
|
34
34
|
function rootDbPath(databaseName: string) {
|
|
35
|
-
return databaseName === 'bigquery' ? '
|
|
35
|
+
return databaseName === 'bigquery' ? 'malloydata-org.' : '';
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// TODO: Figure out how to generalize this.
|
|
@@ -37,7 +37,7 @@ describe('BigQuery double truncation', () => {
|
|
|
37
37
|
expect(runtime).toBeDefined();
|
|
38
38
|
if (runtime) {
|
|
39
39
|
const src = `
|
|
40
|
-
run: bigquery.table('
|
|
40
|
+
run: bigquery.table('malloydata-org.malloytest.flights') -> {
|
|
41
41
|
group_by: takeoff_week is dep_time.week
|
|
42
42
|
}
|
|
43
43
|
`;
|
|
@@ -84,13 +84,13 @@ describe('BigQuery hand-built expression test', () => {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
const modelHandBase: StructDef = {
|
|
87
|
-
name: '
|
|
87
|
+
name: 'malloydata-org.malloytest.aircraft_models',
|
|
88
88
|
as: 'aircraft_models',
|
|
89
89
|
type: 'struct',
|
|
90
90
|
dialect: 'standardsql',
|
|
91
91
|
structSource: {
|
|
92
92
|
type: 'table',
|
|
93
|
-
tablePath: '
|
|
93
|
+
tablePath: 'malloydata-org.malloytest.aircraft_models',
|
|
94
94
|
},
|
|
95
95
|
structRelationship: {type: 'basetable', connectionName: 'bigquery'},
|
|
96
96
|
fields: [
|
|
@@ -191,11 +191,11 @@ describe('BigQuery hand-built expression test', () => {
|
|
|
191
191
|
|
|
192
192
|
const aircraftHandBase: StructDef = {
|
|
193
193
|
type: 'struct',
|
|
194
|
-
name: '
|
|
194
|
+
name: 'malloydata-org.malloytest.aircraft',
|
|
195
195
|
dialect: 'standardsql',
|
|
196
196
|
structSource: {
|
|
197
197
|
type: 'table',
|
|
198
|
-
tablePath: '
|
|
198
|
+
tablePath: 'malloydata-org.malloytest.aircraft',
|
|
199
199
|
},
|
|
200
200
|
structRelationship: {type: 'basetable', connectionName: 'bigquery'},
|
|
201
201
|
fields: [
|
|
@@ -25,7 +25,7 @@ import {RuntimeList} from '../../runtimes';
|
|
|
25
25
|
import {describeIfDatabaseAvailable} from '../../util';
|
|
26
26
|
|
|
27
27
|
const [describe, databases] = describeIfDatabaseAvailable(['bigquery']);
|
|
28
|
-
describe('Wildcard BigQuery Tables', () => {
|
|
28
|
+
describe.skip('Wildcard BigQuery Tables', () => {
|
|
29
29
|
const runtimes = new RuntimeList(databases);
|
|
30
30
|
|
|
31
31
|
afterAll(async () => {
|
|
@@ -39,7 +39,7 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
39
39
|
const result = await runtime
|
|
40
40
|
.loadQuery(
|
|
41
41
|
`
|
|
42
|
-
source: aircraft is bigquery.table('
|
|
42
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.itp_hourly_aircraft') extend {
|
|
43
43
|
primary_key: id
|
|
44
44
|
measure: aircraft_count is count()
|
|
45
45
|
where: _PARTITIONTIME = @2023-03-06 17:00:00 to @2023-03-06 19:00:00
|
|
@@ -62,7 +62,7 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
62
62
|
const result = await runtime
|
|
63
63
|
.loadQuery(
|
|
64
64
|
`
|
|
65
|
-
source: aircraft is bigquery.table('
|
|
65
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.itp_daily_aircraft') extend {
|
|
66
66
|
primary_key: id
|
|
67
67
|
measure: aircraft_count is count()
|
|
68
68
|
where: _PARTITIONTIME = @2023-03-06 00:00:00
|
|
@@ -79,7 +79,7 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
79
79
|
const empty_result = await runtime
|
|
80
80
|
.loadQuery(
|
|
81
81
|
`
|
|
82
|
-
source: aircraft is bigquery.table('
|
|
82
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.itp_daily_aircraft') extend {
|
|
83
83
|
primary_key: id
|
|
84
84
|
measure: aircraft_count is count()
|
|
85
85
|
where: _PARTITIONTIME = @2023-03-06 00:00:01
|
|
@@ -102,7 +102,7 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
102
102
|
const result = await runtime
|
|
103
103
|
.loadQuery(
|
|
104
104
|
`
|
|
105
|
-
source: aircraft is bigquery.table('
|
|
105
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.itp_monthly_aircraft') extend {
|
|
106
106
|
primary_key: id
|
|
107
107
|
measure: aircraft_count is count()
|
|
108
108
|
where: _PARTITIONTIME = @2023-03-01 00:00:00
|
|
@@ -119,7 +119,7 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
119
119
|
const empty_result = await runtime
|
|
120
120
|
.loadQuery(
|
|
121
121
|
`
|
|
122
|
-
source: aircraft is bigquery.table('
|
|
122
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.itp_monthly_aircraft') extend {
|
|
123
123
|
primary_key: id
|
|
124
124
|
measure: aircraft_count is count()
|
|
125
125
|
where: _PARTITIONTIME = @2023-03-01 00:00:01
|
|
@@ -142,12 +142,12 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
142
142
|
const result = await runtime
|
|
143
143
|
.loadQuery(
|
|
144
144
|
`
|
|
145
|
-
source: aircraft is bigquery.table('
|
|
145
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.itp_hourly_aircraft') extend {
|
|
146
146
|
primary_key: id
|
|
147
147
|
measure: aircraft_count is count()
|
|
148
148
|
where: _PARTITIONTIME = @2023-03-06 17:00:00 to @2023-03-06 19:00:00
|
|
149
149
|
}
|
|
150
|
-
source: state_facts is bigquery.table('
|
|
150
|
+
source: state_facts is bigquery.table('malloydata-org.malloytest.state_facts') extend {
|
|
151
151
|
join_many: aircraft on state = aircraft.state
|
|
152
152
|
}
|
|
153
153
|
run: state_facts -> {
|
|
@@ -179,12 +179,12 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
179
179
|
const result = await runtime
|
|
180
180
|
.loadQuery(
|
|
181
181
|
`
|
|
182
|
-
source: aircraft is bigquery.table('
|
|
182
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.itp_hourly_aircraft') extend {
|
|
183
183
|
primary_key: id
|
|
184
184
|
measure: aircraft_count is count()
|
|
185
185
|
where: _PARTITIONTIME = @2023-03-06 17:00:00 to @2023-03-06 19:00:00
|
|
186
186
|
}
|
|
187
|
-
source: state_facts is bigquery.table('
|
|
187
|
+
source: state_facts is bigquery.table('malloydata-org.malloytest.state_facts') extend {
|
|
188
188
|
join_many: aircraft on state = aircraft.state
|
|
189
189
|
}
|
|
190
190
|
run: state_facts -> {
|
|
@@ -212,7 +212,7 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
212
212
|
const result = await runtime
|
|
213
213
|
.loadQuery(
|
|
214
214
|
`
|
|
215
|
-
source: aircraft is bigquery.table('
|
|
215
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.itp_daily_aircraft') extend {
|
|
216
216
|
primary_key: id
|
|
217
217
|
measure: aircraft_count is count()
|
|
218
218
|
where: _PARTITIONDATE = @2023-03-06
|
|
@@ -235,7 +235,7 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
235
235
|
runtime
|
|
236
236
|
.loadQuery(
|
|
237
237
|
`
|
|
238
|
-
source: aircraft is bigquery.table('
|
|
238
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.itp_hourly_aircraft') extend {
|
|
239
239
|
primary_key: id
|
|
240
240
|
measure: aircraft_count is count()
|
|
241
241
|
where: _PARTITIONDATE = @2023-03-06
|
|
@@ -251,7 +251,7 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
251
251
|
runtime
|
|
252
252
|
.loadQuery(
|
|
253
253
|
`
|
|
254
|
-
source: aircraft is bigquery.table('
|
|
254
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.itp_monthly_aircraft') extend {
|
|
255
255
|
primary_key: id
|
|
256
256
|
measure: aircraft_count is count()
|
|
257
257
|
where: _PARTITIONDATE = @2023-03-06
|
|
@@ -26,12 +26,12 @@ import {describeIfDatabaseAvailable} from '../../util';
|
|
|
26
26
|
|
|
27
27
|
function sourceCodeWithFilter(filter: string) {
|
|
28
28
|
return `
|
|
29
|
-
source: aircraft_models is bigquery.table('
|
|
29
|
+
source: aircraft_models is bigquery.table('malloydata-org.malloytest.aircraft_models') extend {
|
|
30
30
|
primary_key: aircraft_model_code
|
|
31
31
|
where: ${filter}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
source: aircraft is bigquery.table('
|
|
34
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.aircraft') extend {
|
|
35
35
|
primary_key: tail_num
|
|
36
36
|
measure: aircraft_count is count()
|
|
37
37
|
join_one: aircraft_models with aircraft_model_code
|
|
@@ -597,7 +597,7 @@ describe('BigQuery expression tests', () => {
|
|
|
597
597
|
});
|
|
598
598
|
|
|
599
599
|
const airportModelText = `
|
|
600
|
-
source: airports is bigquery.table('
|
|
600
|
+
source: airports is bigquery.table('malloydata-org.malloytest.airports') extend {
|
|
601
601
|
primary_key: code
|
|
602
602
|
measure: airport_count is count()
|
|
603
603
|
|
|
@@ -34,7 +34,7 @@ it.skip('accessors are not too expensive', async () => {
|
|
|
34
34
|
if (runtime) {
|
|
35
35
|
const result = await runtime
|
|
36
36
|
.loadQuery(
|
|
37
|
-
"source '
|
|
37
|
+
"source 'malloydata-org.malloytest.flights' | reduce inner is (reduce top 1000000 distance id2)"
|
|
38
38
|
)
|
|
39
39
|
.run();
|
|
40
40
|
let noAccessorTime;
|
|
@@ -39,7 +39,7 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
39
39
|
const result = await runtime
|
|
40
40
|
.loadQuery(
|
|
41
41
|
`
|
|
42
|
-
source: aircraft is bigquery.table('
|
|
42
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.wildcard_aircraft_*') extend {
|
|
43
43
|
primary_key: id
|
|
44
44
|
measure: aircraft_count is count()
|
|
45
45
|
}
|
|
@@ -61,7 +61,7 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
61
61
|
const result = await runtime
|
|
62
62
|
.loadQuery(
|
|
63
63
|
`
|
|
64
|
-
source: aircraft is bigquery.table('
|
|
64
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.wildcard_aircraft_*') extend {
|
|
65
65
|
primary_key: id
|
|
66
66
|
measure: aircraft_count is count()
|
|
67
67
|
where: _TABLE_SUFFIX = '01'
|
|
@@ -84,11 +84,11 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
84
84
|
const result = await runtime
|
|
85
85
|
.loadQuery(
|
|
86
86
|
`
|
|
87
|
-
source: aircraft is bigquery.table('
|
|
87
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.wildcard_aircraft_*') extend {
|
|
88
88
|
primary_key: id
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
source: state_facts is bigquery.table('
|
|
91
|
+
source: state_facts is bigquery.table('malloydata-org.malloytest.state_facts') extend {
|
|
92
92
|
join_many: aircraft on state = aircraft.state
|
|
93
93
|
}
|
|
94
94
|
run: state_facts -> {
|
|
@@ -120,12 +120,12 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
120
120
|
const result = await runtime
|
|
121
121
|
.loadQuery(
|
|
122
122
|
`
|
|
123
|
-
source: aircraft is bigquery.table('
|
|
123
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.wildcard_aircraft_*') extend {
|
|
124
124
|
primary_key: id
|
|
125
125
|
where: _TABLE_SUFFIX = '02'
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
source: state_facts is bigquery.table('
|
|
128
|
+
source: state_facts is bigquery.table('malloydata-org.malloytest.state_facts') extend {
|
|
129
129
|
join_many: aircraft on state = aircraft.state
|
|
130
130
|
}
|
|
131
131
|
run: state_facts -> {
|
|
@@ -154,8 +154,8 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
154
154
|
const result = await runtime
|
|
155
155
|
.loadQuery(
|
|
156
156
|
`
|
|
157
|
-
source: aircraft is bigquery.table('
|
|
158
|
-
join_many: state_facts is bigquery.table('
|
|
157
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.wildcard_aircraft_*') extend {
|
|
158
|
+
join_many: state_facts is bigquery.table('malloydata-org.malloytest.state_facts')
|
|
159
159
|
on state_facts.state = state
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -180,12 +180,12 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
180
180
|
const result = await runtime
|
|
181
181
|
.loadQuery(
|
|
182
182
|
`
|
|
183
|
-
source: aircraft is bigquery.table('
|
|
183
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.wildcard_aircraft_*') extend {
|
|
184
184
|
primary_key: id
|
|
185
185
|
where: _TABLE_SUFFIX = '02'
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
source: state_facts is bigquery.table('
|
|
188
|
+
source: state_facts is bigquery.table('malloydata-org.malloytest.state_facts') extend {
|
|
189
189
|
join_many: aircraft on state = aircraft.state
|
|
190
190
|
}
|
|
191
191
|
run: state_facts -> {
|
|
@@ -210,12 +210,12 @@ describe('Wildcard BigQuery Tables', () => {
|
|
|
210
210
|
const result = await runtime
|
|
211
211
|
.loadQuery(
|
|
212
212
|
`
|
|
213
|
-
source: aircraft is bigquery.table('
|
|
213
|
+
source: aircraft is bigquery.table('malloydata-org.malloytest.wildcard_aircraft_*') extend {
|
|
214
214
|
primary_key: id
|
|
215
215
|
where: _TABLE_SUFFIX = '02'
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
source: state_facts is bigquery.table('
|
|
218
|
+
source: state_facts is bigquery.table('malloydata-org.malloytest.state_facts') extend {
|
|
219
219
|
join_many: aircraft on state = aircraft.state
|
|
220
220
|
}
|
|
221
221
|
run: state_facts -> {
|
package/src/models/faa_model.ts
CHANGED
|
@@ -47,12 +47,12 @@ function withJoin(leftKey: string, rightKey: string): StructRelationship {
|
|
|
47
47
|
/** Flight Model */
|
|
48
48
|
export const FLIGHTS_EXPLORE: StructDef = {
|
|
49
49
|
type: 'struct',
|
|
50
|
-
name: '
|
|
50
|
+
name: 'malloydata-org.malloytest.flights',
|
|
51
51
|
as: 'flights',
|
|
52
52
|
dialect: 'standardsql',
|
|
53
53
|
structSource: {
|
|
54
54
|
type: 'table',
|
|
55
|
-
tablePath: '
|
|
55
|
+
tablePath: 'malloydata-org.malloytest.flights',
|
|
56
56
|
},
|
|
57
57
|
structRelationship: {type: 'basetable', connectionName: 'bigquery'},
|
|
58
58
|
primaryKey: 'id2',
|
|
@@ -93,12 +93,12 @@ export const FLIGHTS_EXPLORE: StructDef = {
|
|
|
93
93
|
// carriers
|
|
94
94
|
{
|
|
95
95
|
type: 'struct',
|
|
96
|
-
name: '
|
|
96
|
+
name: 'malloydata-org.malloytest.carriers',
|
|
97
97
|
as: 'carriers',
|
|
98
98
|
dialect: 'standardsql',
|
|
99
99
|
structSource: {
|
|
100
100
|
type: 'table',
|
|
101
|
-
tablePath: '
|
|
101
|
+
tablePath: 'malloydata-org.malloytest.carriers',
|
|
102
102
|
},
|
|
103
103
|
structRelationship: {
|
|
104
104
|
type: 'one',
|
|
@@ -120,12 +120,12 @@ export const FLIGHTS_EXPLORE: StructDef = {
|
|
|
120
120
|
// aircraft
|
|
121
121
|
{
|
|
122
122
|
type: 'struct',
|
|
123
|
-
name: '
|
|
123
|
+
name: 'malloydata-org.malloytest.aircraft',
|
|
124
124
|
as: 'aircraft',
|
|
125
125
|
dialect: 'standardsql',
|
|
126
126
|
structSource: {
|
|
127
127
|
type: 'table',
|
|
128
|
-
tablePath: '
|
|
128
|
+
tablePath: 'malloydata-org.malloytest.aircraft',
|
|
129
129
|
},
|
|
130
130
|
structRelationship: withJoin('tail_num', 'aircraft.tail_num'),
|
|
131
131
|
primaryKey: 'tail_num',
|
|
@@ -183,13 +183,13 @@ export const FLIGHTS_EXPLORE: StructDef = {
|
|
|
183
183
|
// subjoin aircraft models
|
|
184
184
|
{
|
|
185
185
|
type: 'struct',
|
|
186
|
-
name: '
|
|
186
|
+
name: 'malloydata-org.malloytest.aircraft_models',
|
|
187
187
|
as: 'aircraft_models',
|
|
188
188
|
dialect: 'standardsql',
|
|
189
189
|
primaryKey: 'aircraft_model_code',
|
|
190
190
|
structSource: {
|
|
191
191
|
type: 'table',
|
|
192
|
-
tablePath: '
|
|
192
|
+
tablePath: 'malloydata-org.malloytest.aircraft_models',
|
|
193
193
|
},
|
|
194
194
|
structRelationship: withJoin(
|
|
195
195
|
'aircraft_model_code',
|
|
@@ -237,12 +237,12 @@ export const FLIGHTS_EXPLORE: StructDef = {
|
|
|
237
237
|
// origin
|
|
238
238
|
{
|
|
239
239
|
type: 'struct',
|
|
240
|
-
name: '
|
|
240
|
+
name: 'malloydata-org.malloytest.airports',
|
|
241
241
|
as: 'origin',
|
|
242
242
|
dialect: 'standardsql',
|
|
243
243
|
structSource: {
|
|
244
244
|
type: 'table',
|
|
245
|
-
tablePath: '
|
|
245
|
+
tablePath: 'malloydata-org.malloytest.airports',
|
|
246
246
|
},
|
|
247
247
|
structRelationship: withJoin('origin_code', 'origin.code'),
|
|
248
248
|
primaryKey: 'code',
|
|
@@ -286,12 +286,12 @@ export const FLIGHTS_EXPLORE: StructDef = {
|
|
|
286
286
|
// destination
|
|
287
287
|
{
|
|
288
288
|
type: 'struct',
|
|
289
|
-
name: '
|
|
289
|
+
name: 'malloydata-org.malloytest.airports',
|
|
290
290
|
as: 'destination',
|
|
291
291
|
dialect: 'standardsql',
|
|
292
292
|
structSource: {
|
|
293
293
|
type: 'table',
|
|
294
|
-
tablePath: '
|
|
294
|
+
tablePath: 'malloydata-org.malloytest.airports',
|
|
295
295
|
},
|
|
296
296
|
structRelationship: withJoin('destination_code', 'destination.code'),
|
|
297
297
|
primaryKey: 'code',
|
|
@@ -924,12 +924,12 @@ export const FLIGHTS_EXPLORE: StructDef = {
|
|
|
924
924
|
|
|
925
925
|
const tableAirports: StructDef = {
|
|
926
926
|
type: 'struct',
|
|
927
|
-
name: '
|
|
927
|
+
name: 'malloydata-org.malloytest.airports',
|
|
928
928
|
as: 'table_airports',
|
|
929
929
|
dialect: 'standardsql',
|
|
930
930
|
structSource: {
|
|
931
931
|
type: 'table',
|
|
932
|
-
tablePath: '
|
|
932
|
+
tablePath: 'malloydata-org.malloytest.airports',
|
|
933
933
|
},
|
|
934
934
|
structRelationship: {type: 'basetable', connectionName: 'bigquery'},
|
|
935
935
|
primaryKey: 'code',
|
|
@@ -211,12 +211,12 @@ export const medicareModel: StructDef = {
|
|
|
211
211
|
],
|
|
212
212
|
},
|
|
213
213
|
],
|
|
214
|
-
name: '
|
|
214
|
+
name: 'malloydata-org.malloytest.bq_medicare_test',
|
|
215
215
|
primaryKey: 'id',
|
|
216
216
|
structRelationship: {type: 'basetable', connectionName: 'bigquery'},
|
|
217
217
|
structSource: {
|
|
218
218
|
type: 'table',
|
|
219
|
-
tablePath: '
|
|
219
|
+
tablePath: 'malloydata-org.malloytest.bq_medicare_test',
|
|
220
220
|
},
|
|
221
221
|
type: 'struct',
|
|
222
222
|
};
|
|
@@ -75,7 +75,7 @@ describe('rendering results', () => {
|
|
|
75
75
|
expect(runtime).toBeDefined();
|
|
76
76
|
if (runtime) {
|
|
77
77
|
const src = `
|
|
78
|
-
run: bigquery.table('
|
|
78
|
+
run: bigquery.table('malloydata-org.malloytest.flights') -> {
|
|
79
79
|
group_by: carrier
|
|
80
80
|
aggregate: flight_count is count()
|
|
81
81
|
}
|
package/src/runtimes.ts
CHANGED
package/src/tags.spec.ts
CHANGED
|
@@ -522,4 +522,29 @@ describe('tags in results', () => {
|
|
|
522
522
|
expect(plotTag!.numeric('x')).toEqual(2);
|
|
523
523
|
expect(x).toEqual(2);
|
|
524
524
|
});
|
|
525
|
+
test('nested fields of same field do not share tags', async () => {
|
|
526
|
+
const loaded = runtime.loadQuery(`
|
|
527
|
+
source: one is duckdb.sql("SELECT 1 as one")
|
|
528
|
+
run: one -> {
|
|
529
|
+
nest: a is {
|
|
530
|
+
# a
|
|
531
|
+
group_by: one
|
|
532
|
+
}
|
|
533
|
+
nest: b is {
|
|
534
|
+
# b
|
|
535
|
+
group_by: one
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
`);
|
|
539
|
+
const result = await loaded.run();
|
|
540
|
+
const shape = result.resultExplore;
|
|
541
|
+
const a = shape.getFieldByName('a');
|
|
542
|
+
expect(a.isExploreField()).toBe(true);
|
|
543
|
+
if (a.isExploreField()) {
|
|
544
|
+
const one = a.getFieldByName('one');
|
|
545
|
+
expect(one.tagParse().tag).tagsAre({
|
|
546
|
+
a: {},
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
});
|
|
525
550
|
});
|