Skip to content

Commit d502b99

Browse files
committed
fixes
1 parent 9f7b54e commit d502b99

File tree

7 files changed

+25
-34
lines changed

7 files changed

+25
-34
lines changed

packages/cubejs-schema-compiler/src/compiler/CubeValidator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ const viewSchema = inherit(baseSchema, {
911911
meta: Joi.any(),
912912
})
913913
]))
914-
]),
914+
]).required(),
915915
excludes: Joi.array().items(Joi.string().required()),
916916
}).oxor('split', 'prefix').messages({
917917
'object.oxor': 'Using split together with prefix is not supported'

packages/cubejs-schema-compiler/src/compiler/transpilers/CubePropContextTranspiler.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ export const transpiledFieldsPatterns: Array<RegExp> = [
1919
/^measures\.[_a-zA-Z][_a-zA-Z0-9]*\.(orderBy|order_by)\.[0-9]+\.sql$/,
2020
/^measures\.[_a-zA-Z][_a-zA-Z0-9]*\.(timeShift|time_shift)\.[0-9]+\.(timeDimension|time_dimension)$/,
2121
/^measures\.[_a-zA-Z][_a-zA-Z0-9]*\.(reduceBy|reduce_by|groupBy|group_by|addGroupBy|add_group_by)$/,
22-
/^measures\.[_a-zA-Z][_a-zA-Z0-9]*\.case\.switch$/,
22+
/^(measures|dimensions)\.[_a-zA-Z][_a-zA-Z0-9]*\.case\.switch$/,
2323
/^dimensions\.[_a-zA-Z][_a-zA-Z0-9]*\.(reduceBy|reduce_by|groupBy|group_by|addGroupBy|add_group_by)$/,
24-
/^dimensions\.[_a-zA-Z][_a-zA-Z0-9]*\.case\.switch$/,
2524
/^(preAggregations|pre_aggregations)\.[_a-zA-Z][_a-zA-Z0-9]*\.indexes\.[_a-zA-Z][_a-zA-Z0-9]*\.columns$/,
2625
/^(preAggregations|pre_aggregations)\.[_a-zA-Z][_a-zA-Z0-9]*\.(timeDimensionReference|timeDimension|time_dimension|segments|dimensions|measures|rollups|segmentReferences|dimensionReferences|measureReferences|rollupReferences)$/,
2726
/^(preAggregations|pre_aggregations)\.[_a-zA-Z][_a-zA-Z0-9]*\.(timeDimensions|time_dimensions)\.\d+\.dimension$/,

packages/cubejs-schema-compiler/test/integration/postgres/calc-groups.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,6 @@ views:
17061706
});
17071707
} else {
17081708
// This test is working only in tesseract
1709-
test.skip('calc groups testst', () => { expect(1).toBe(1); });
1709+
test.skip('calc groups tests', () => { expect(1).toBe(1); });
17101710
}
17111711
});

packages/cubejs-testing-drivers/src/tests/testQueries.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,7 +2134,7 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
21342134
execute('querying SwitchSourceTest: simple cross join', async () => {
21352135
const response = await client.load({
21362136
dimensions: [
2137-
"SwitchSourceTest.city"
2137+
'SwitchSourceTest.city'
21382138
],
21392139
measures: [
21402140
'SwitchSourceTest.totalSalesA',
@@ -2146,7 +2146,7 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
21462146
}],
21472147
order: {
21482148
'SwitchSourceTest.orderDate': 'asc',
2149-
'SwitchSourceTest.city' : 'asc'
2149+
'SwitchSourceTest.city': 'asc'
21502150
}
21512151
});
21522152
expect(response.rawData()).toMatchSnapshot();
@@ -2155,7 +2155,7 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
21552155
execute('querying SwitchSourceTest: full cross join', async () => {
21562156
const response = await client.load({
21572157
dimensions: [
2158-
"SwitchSourceTest.city"
2158+
'SwitchSourceTest.city'
21592159
],
21602160
measures: [
21612161
'SwitchSourceTest.totalSales',
@@ -2167,7 +2167,7 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
21672167
}],
21682168
order: {
21692169
'SwitchSourceTest.orderDate': 'asc',
2170-
'SwitchSourceTest.city' : 'asc'
2170+
'SwitchSourceTest.city': 'asc'
21712171
}
21722172
});
21732173
expect(response.rawData()).toMatchSnapshot();
@@ -2176,7 +2176,7 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
21762176
execute('querying SwitchSourceTest: filter by switch dimensions', async () => {
21772177
const response = await client.load({
21782178
dimensions: [
2179-
"SwitchSourceTest.city"
2179+
'SwitchSourceTest.city'
21802180
],
21812181
measures: [
21822182
'SwitchSourceTest.totalSales',
@@ -2200,7 +2200,7 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
22002200
}],
22012201
order: {
22022202
'SwitchSourceTest.orderDate': 'asc',
2203-
'SwitchSourceTest.city' : 'asc'
2203+
'SwitchSourceTest.city': 'asc'
22042204
}
22052205
});
22062206
expect(response.rawData()).toMatchSnapshot();

packages/cubejs-testing-drivers/test/__snapshots__/databricks-jdbc-full.test.ts.snap

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16337,31 +16337,31 @@ Array [
1633716337
"SwitchSourceTest.city": "Detroit",
1633816338
"SwitchSourceTest.orderDate": "2020-01-01T00:00:00.000",
1633916339
"SwitchSourceTest.orderDate.month": "2020-01-01T00:00:00.000",
16340-
"SwitchSourceTest.totalSales": "210.98000",
16340+
"SwitchSourceTest.totalSales": 210.98,
1634116341
},
1634216342
Object {
1634316343
"SwitchSourceTest.city": "Lorain",
1634416344
"SwitchSourceTest.orderDate": "2020-01-01T00:00:00.000",
1634516345
"SwitchSourceTest.orderDate.month": "2020-01-01T00:00:00.000",
16346-
"SwitchSourceTest.totalSales": "48.89600",
16346+
"SwitchSourceTest.totalSales": 48.896,
1634716347
},
1634816348
Object {
1634916349
"SwitchSourceTest.city": "Decatur",
1635016350
"SwitchSourceTest.orderDate": "2020-02-01T00:00:00.000",
1635116351
"SwitchSourceTest.orderDate.month": "2020-02-01T00:00:00.000",
16352-
"SwitchSourceTest.totalSales": "18.36800",
16352+
"SwitchSourceTest.totalSales": 18.368,
1635316353
},
1635416354
Object {
1635516355
"SwitchSourceTest.city": "Houston",
1635616356
"SwitchSourceTest.orderDate": "2020-03-01T00:00:00.000",
1635716357
"SwitchSourceTest.orderDate.month": "2020-03-01T00:00:00.000",
16358-
"SwitchSourceTest.totalSales": "2399.96000",
16358+
"SwitchSourceTest.totalSales": 2399.96,
1635916359
},
1636016360
Object {
1636116361
"SwitchSourceTest.city": "New York City",
1636216362
"SwitchSourceTest.orderDate": "2020-03-01T00:00:00.000",
1636316363
"SwitchSourceTest.orderDate.month": "2020-03-01T00:00:00.000",
16364-
"SwitchSourceTest.totalSales": "71.60000",
16364+
"SwitchSourceTest.totalSales": 71.6,
1636516365
},
1636616366
]
1636716367
`;
@@ -16372,31 +16372,31 @@ Array [
1637216372
"SwitchSourceTest.city": "Detroit",
1637316373
"SwitchSourceTest.orderDate": "2020-01-01T00:00:00.000",
1637416374
"SwitchSourceTest.orderDate.month": "2020-01-01T00:00:00.000",
16375-
"SwitchSourceTest.totalSales": "1265.88000",
16375+
"SwitchSourceTest.totalSales": 1265.88,
1637616376
},
1637716377
Object {
1637816378
"SwitchSourceTest.city": "Lorain",
1637916379
"SwitchSourceTest.orderDate": "2020-01-01T00:00:00.000",
1638016380
"SwitchSourceTest.orderDate.month": "2020-01-01T00:00:00.000",
16381-
"SwitchSourceTest.totalSales": "293.37600",
16381+
"SwitchSourceTest.totalSales": 293.376,
1638216382
},
1638316383
Object {
1638416384
"SwitchSourceTest.city": "Decatur",
1638516385
"SwitchSourceTest.orderDate": "2020-02-01T00:00:00.000",
1638616386
"SwitchSourceTest.orderDate.month": "2020-02-01T00:00:00.000",
16387-
"SwitchSourceTest.totalSales": "110.20800",
16387+
"SwitchSourceTest.totalSales": 110.208,
1638816388
},
1638916389
Object {
1639016390
"SwitchSourceTest.city": "Houston",
1639116391
"SwitchSourceTest.orderDate": "2020-03-01T00:00:00.000",
1639216392
"SwitchSourceTest.orderDate.month": "2020-03-01T00:00:00.000",
16393-
"SwitchSourceTest.totalSales": "14399.76000",
16393+
"SwitchSourceTest.totalSales": 14399.76,
1639416394
},
1639516395
Object {
1639616396
"SwitchSourceTest.city": "New York City",
1639716397
"SwitchSourceTest.orderDate": "2020-03-01T00:00:00.000",
1639816398
"SwitchSourceTest.orderDate.month": "2020-03-01T00:00:00.000",
16399-
"SwitchSourceTest.totalSales": "429.60000",
16399+
"SwitchSourceTest.totalSales": 429.6,
1640016400
},
1640116401
]
1640216402
`;
@@ -16407,31 +16407,31 @@ Array [
1640716407
"SwitchSourceTest.city": "Detroit",
1640816408
"SwitchSourceTest.orderDate": "2020-01-01T00:00:00.000",
1640916409
"SwitchSourceTest.orderDate.month": "2020-01-01T00:00:00.000",
16410-
"SwitchSourceTest.totalSalesA": "421.96000",
16410+
"SwitchSourceTest.totalSalesA": 421.96,
1641116411
},
1641216412
Object {
1641316413
"SwitchSourceTest.city": "Lorain",
1641416414
"SwitchSourceTest.orderDate": "2020-01-01T00:00:00.000",
1641516415
"SwitchSourceTest.orderDate.month": "2020-01-01T00:00:00.000",
16416-
"SwitchSourceTest.totalSalesA": "97.79200",
16416+
"SwitchSourceTest.totalSalesA": 97.792,
1641716417
},
1641816418
Object {
1641916419
"SwitchSourceTest.city": "Decatur",
1642016420
"SwitchSourceTest.orderDate": "2020-02-01T00:00:00.000",
1642116421
"SwitchSourceTest.orderDate.month": "2020-02-01T00:00:00.000",
16422-
"SwitchSourceTest.totalSalesA": "36.73600",
16422+
"SwitchSourceTest.totalSalesA": 36.736,
1642316423
},
1642416424
Object {
1642516425
"SwitchSourceTest.city": "Houston",
1642616426
"SwitchSourceTest.orderDate": "2020-03-01T00:00:00.000",
1642716427
"SwitchSourceTest.orderDate.month": "2020-03-01T00:00:00.000",
16428-
"SwitchSourceTest.totalSalesA": "4799.92000",
16428+
"SwitchSourceTest.totalSalesA": 4799.92,
1642916429
},
1643016430
Object {
1643116431
"SwitchSourceTest.city": "New York City",
1643216432
"SwitchSourceTest.orderDate": "2020-03-01T00:00:00.000",
1643316433
"SwitchSourceTest.orderDate.month": "2020-03-01T00:00:00.000",
16434-
"SwitchSourceTest.totalSalesA": "143.20000",
16434+
"SwitchSourceTest.totalSalesA": 143.2,
1643516435
},
1643616436
]
1643716437
`;

rust/cubesqlplanner/cubesqlplanner/src/physical_plan_builder/processors/full_key_aggregate.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,6 @@ impl FullKeyAggregateStrategy for KeysFullKeyAggregateStrategy<'_> {
111111
data_queries.push(data_select);
112112
}
113113
if data_queries.is_empty() {
114-
/* return Err(CubeError::internal(format!(
115-
"FullKeyAggregate should have at least one source: {}",
116-
pretty_print(full_key_aggregate)
117-
))); */
118114
let empty_join = LogicalJoin::builder().build();
119115
return self.builder.process_node(&empty_join, context);
120116
}
@@ -255,10 +251,6 @@ impl FullKeyAggregateStrategy for InnerJoinFullKeyAggregateStrategy<'_> {
255251
}
256252

257253
if data_queries.is_empty() {
258-
/* return Err(CubeError::internal(format!(
259-
"FullKeyAggregate should have at least one source: {}",
260-
pretty_print(full_key_aggregate)
261-
))); */
262254
let empty_join = LogicalJoin::builder().build();
263255
return self.builder.process_node(&empty_join, context);
264256
}

rust/cubesqlplanner/cubesqlplanner/src/physical_plan_builder/processors/keys_sub_query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl<'a> LogicalNodeProcessor<'a, KeysSubQuery> for KeysSubQueryProcessor<'a> {
3737
.builder
3838
.process_node(keys_subquery.source().as_ref(), &context)?;
3939

40-
//FIXME dublication with QueryProcessor
40+
//FIXME duplication with QueryProcessor
4141
let all_symbols = all_symbols(&keys_subquery.schema(), &keys_subquery.filter());
4242
let calc_group_dims = collect_calc_group_dims_from_nodes(all_symbols.iter())?;
4343

0 commit comments

Comments
 (0)