Repository navigation
feat(compliance): add Layer 3 wide table query cases #716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
|
|
||
| Wide table compliance tests | ||
| =========================== | ||
|
|
||
| Compliance tests for the | ||
| [Wide Table Query Interface](../../core-spec/wide_table_semantics.md) | ||
| (Layer 3). All cases use the same data and Ossie model. The data and the | ||
| expected results come from the examples of the specification: Section 1.3, | ||
| Section 5.2, Section 6.1, and Appendix B. | ||
|
|
||
| The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are to be | ||
| interpreted as described in BCP 14 | ||
| ([RFC 2119](https://www.rfc-editor.org/rfc/rfc2119), | ||
| [RFC 8174](https://www.rfc-editor.org/rfc/rfc8174)) when they appear in | ||
| uppercase. | ||
|
|
||
| Layout | ||
| ------ | ||
|
|
||
| | Path | Contents | | ||
| |------|----------| | ||
| | [`retail/retail.sql`](retail/retail.sql) | Schema and data: customers, orders, returns, visits, and tickets | | ||
| | [`retail/retail_model.ossie.yaml`](retail/retail_model.ossie.yaml) | Ossie model with relationships and metrics | | ||
| | `cases/<case>/query.json` | Query under test, in the JSON binding of Section 3.7 | | ||
| | `cases/<case>/expected.json` | Expected result or error | | ||
|
|
||
| Cases `a*` return rows. Cases `e*` raise an error; they follow the order of | ||
| the table in Section 8, and `e20` and `e21` test that order. | ||
|
|
||
| A case passes when an implementation loads the data and the model, submits | ||
| `query.json`, and either returns a result equal to the expected rows (see | ||
| "Comparing results") or raises the expected error. | ||
|
|
||
| Case files | ||
| ---------- | ||
|
|
||
| `query.json` is the query as a consumer submits it. It has only the parts of | ||
| Section 3.2. | ||
|
|
||
| `expected.json` describes the case and its result: | ||
|
|
||
| - `title`: what the case shows. | ||
| - `question`: what the query asks, in English. It helps a reader; the query is | ||
| the ground truth. | ||
| - `behavior`: the rule under test, and why the result has its values. | ||
| - `spec`: the sections of the specification that define the result. | ||
| - `columns` and `rows`: the expected result, with the output names of Section | ||
| 3.3 in query order. Or `error`: the code from Section 8 that the engine | ||
| MUST raise. | ||
|
|
||
| ```json | ||
| { | ||
| "title": "Groups come from the metric's dataset", | ||
| "question": "What is the order amount by customer region?", | ||
| "behavior": "One branch from orders. NORTH has no orders, so it is not a group.", | ||
| "spec": ["5.4", "6.1"], | ||
| "columns": ["region", "total_revenue"], | ||
| "rows": [ | ||
| ["EAST", 350], | ||
| ["WEST", 300] | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| For codes 13, 14, and 16, Section 8 also requires the error to identify the | ||
| dimension or the filter, and a metric or the anchor that does not reach its | ||
| dataset. `behavior` names them. How an engine reports them depends on its | ||
| binding, so the cases check only the code. | ||
|
|
||
| Result semantics | ||
| ---------------- | ||
|
|
||
| The rules of [`../query/README.md`](../query/README.md), "Result semantics", | ||
| apply. For example, `SUM` over no rows is NULL and `COUNT(*)` over no rows is | ||
| 0, which gives the empty-input values of Section 5.2. | ||
|
|
||
| Comparing results | ||
| ----------------- | ||
|
|
||
| Results are compared as in [`../query/README.md`](../query/README.md), | ||
| "Comparing results". Rows have no defined order (Section 3.6). In | ||
| `expected.json`: | ||
|
|
||
| - A JSON number without a fraction or an exponent is an exact numeric. Any | ||
| other JSON number is an approximate numeric. | ||
| - A JSON `null` is SQL NULL. |
12 changes: 12 additions & 0 deletions
12
compliance/wide_table/cases/a01_shared_dimension/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "title": "Two metrics share a dimension", | ||
| "question": "What are the order and return amounts by customer region?", | ||
| "behavior": "Each metric is a branch from its own dataset to customers. The keys are the regions of either branch; a region missing from a branch takes the empty-input value of SUM, NULL.", | ||
| "spec": ["1.3", "5.4", "5.5"], | ||
| "columns": ["region", "total_revenue", "total_returns"], | ||
| "rows": [ | ||
| ["EAST", 350, 25], | ||
| ["WEST", 300, null], | ||
| ["NORTH", null, 10] | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "dimensions": ["customers.region"], | ||
| "metrics": ["orders.total_revenue", "returns.total_returns"] | ||
| } |
12 changes: 12 additions & 0 deletions
12
compliance/wide_table/cases/a02_count_empty_input/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "title": "A missing branch row takes the empty-input value of COUNT(*)", | ||
| "question": "What is the order amount and the number of returns by customer region?", | ||
| "behavior": "WEST has orders and no returns. Its return_count is the empty-input value of COUNT(*), 0, not NULL.", | ||
| "spec": ["5.2", "5.5", "B.1"], | ||
| "columns": ["region", "total_revenue", "return_count"], | ||
| "rows": [ | ||
| ["EAST", 350, 1], | ||
| ["WEST", 300, 0], | ||
| ["NORTH", null, 1] | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "dimensions": ["customers.region"], | ||
| "metrics": ["orders.total_revenue", "returns.return_count"] | ||
| } |
12 changes: 12 additions & 0 deletions
12
compliance/wide_table/cases/a03_three_branches/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "title": "Three branches give each key once", | ||
| "question": "What are the order amount, return amount, and number of visits by customer region?", | ||
| "behavior": "Each branch supplies some regions. NORTH is in the returns and visits branches but not in the orders branch, and appears once.", | ||
| "spec": ["5.5", "B.2"], | ||
| "columns": ["region", "total_revenue", "total_returns", "visit_count"], | ||
| "rows": [ | ||
| ["EAST", 350, 25, 0], | ||
| ["WEST", 300, null, 1], | ||
| ["NORTH", null, 10, 2] | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "dimensions": ["customers.region"], | ||
| "metrics": ["orders.total_revenue", "returns.total_returns", "visits.visit_count"] | ||
| } |
11 changes: 11 additions & 0 deletions
11
compliance/wide_table/cases/a04_filter_on_dimension/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "title": "A filter on the dimension dataset applies to every branch", | ||
| "question": "What are the order and return amounts by customer region, outside EAST?", | ||
| "behavior": "Both metrics reach customers, so the filter applies to both branches. The filter removes groups and adds none.", | ||
| "spec": ["3.4", "5.3", "6", "B.1"], | ||
| "columns": ["region", "total_revenue", "total_returns"], | ||
| "rows": [ | ||
| ["WEST", 300, null], | ||
| ["NORTH", null, 10] | ||
| ] | ||
| } |
5 changes: 5 additions & 0 deletions
5
compliance/wide_table/cases/a04_filter_on_dimension/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "dimensions": ["customers.region"], | ||
| "metrics": ["orders.total_revenue", "returns.total_returns"], | ||
| "filter": "customers.region <> 'EAST'" | ||
| } |
11 changes: 11 additions & 0 deletions
11
compliance/wide_table/cases/a05_groups_from_orders/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "title": "Groups come from the metric's dataset", | ||
| "question": "What is the order amount by customer region?", | ||
| "behavior": "One branch from orders. NORTH has no orders, so it is not a group.", | ||
| "spec": ["5.4", "6.1"], | ||
| "columns": ["region", "total_revenue"], | ||
| "rows": [ | ||
| ["EAST", 350], | ||
| ["WEST", 300] | ||
| ] | ||
| } |
4 changes: 4 additions & 0 deletions
4
compliance/wide_table/cases/a05_groups_from_orders/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "dimensions": ["customers.region"], | ||
| "metrics": ["orders.total_revenue"] | ||
| } |
11 changes: 11 additions & 0 deletions
11
compliance/wide_table/cases/a06_groups_from_returns/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "title": "Another metric gives other groups", | ||
| "question": "What is the return amount by customer region?", | ||
| "behavior": "One branch from returns. WEST has no returns, so it is not a group.", | ||
| "spec": ["5.4", "6.1"], | ||
| "columns": ["region", "total_returns"], | ||
| "rows": [ | ||
| ["EAST", 25], | ||
| ["NORTH", 10] | ||
| ] | ||
| } |
4 changes: 4 additions & 0 deletions
4
compliance/wide_table/cases/a06_groups_from_returns/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "dimensions": ["customers.region"], | ||
| "metrics": ["returns.total_returns"] | ||
| } |
12 changes: 12 additions & 0 deletions
12
compliance/wide_table/cases/a07_dimension_only/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "title": "A query without metrics uses an anchor", | ||
| "question": "Which customer regions are there?", | ||
| "behavior": "The anchor is customers, the dataset of the only dimension. The result has its distinct regions.", | ||
| "spec": ["3.2", "5.6", "6.1"], | ||
| "columns": ["region"], | ||
| "rows": [ | ||
| ["EAST"], | ||
| ["WEST"], | ||
| ["NORTH"] | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "dimensions": ["customers.region"] | ||
| } |
10 changes: 10 additions & 0 deletions
10
compliance/wide_table/cases/a08_model_metric_components/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "title": "Each component of a model-scoped metric aggregates its own dataset", | ||
| "question": "What is the order amount per customer?", | ||
| "behavior": "The metric has a component on orders and one on customers. Each is a branch of its own, so the customer count includes C4, which has no orders: 650 / 4.", | ||
| "spec": ["5.2", "5.5"], | ||
| "columns": ["revenue_per_customer"], | ||
| "rows": [ | ||
| [162.5] | ||
| ] | ||
| } |
3 changes: 3 additions & 0 deletions
3
compliance/wide_table/cases/a08_model_metric_components/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "metrics": ["revenue_per_customer"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "title": "Aliases name the output columns", | ||
| "question": "What is the order amount by customer region?", | ||
| "behavior": "The object form gives each entry an alias, and the alias is its output name.", | ||
| "spec": ["3.3", "3.6", "3.7"], | ||
| "columns": ["area", "revenue"], | ||
| "rows": [ | ||
| ["EAST", 350], | ||
| ["WEST", 300] | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "dimensions": [{"field": "customers.region", "alias": "area"}], | ||
| "metrics": [{"metric": "orders.total_revenue", "alias": "revenue"}] | ||
| } |
10 changes: 10 additions & 0 deletions
10
compliance/wide_table/cases/a10_filter_without_dimension/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "title": "A filter on a dataset the metric reaches", | ||
| "question": "What is the order amount of customers in EAST?", | ||
| "behavior": "The branch from orders joins customers for the filter. Without dimensions, the result has one row.", | ||
| "spec": ["3.4", "5.4", "B.5"], | ||
| "columns": ["total_revenue"], | ||
| "rows": [ | ||
| [350] | ||
| ] | ||
| } |
4 changes: 4 additions & 0 deletions
4
compliance/wide_table/cases/a10_filter_without_dimension/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "metrics": ["orders.total_revenue"], | ||
| "filter": "customers.region = 'EAST'" | ||
| } |
11 changes: 11 additions & 0 deletions
11
compliance/wide_table/cases/a11_filter_on_home_dataset/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "title": "A filter on the metric's own dataset", | ||
| "question": "What is the amount of orders over 100 by customer region?", | ||
| "behavior": "The filter removes O1 and O3 before aggregation.", | ||
| "spec": ["3.4", "5.4", "B.5"], | ||
| "columns": ["region", "total_revenue"], | ||
| "rows": [ | ||
| ["EAST", 200], | ||
| ["WEST", 300] | ||
| ] | ||
| } |
5 changes: 5 additions & 0 deletions
5
compliance/wide_table/cases/a11_filter_on_home_dataset/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "dimensions": ["customers.region"], | ||
| "metrics": ["orders.total_revenue"], | ||
| "filter": "orders.amount > 100" | ||
| } |
11 changes: 11 additions & 0 deletions
11
compliance/wide_table/cases/a12_anchor_from_dimensions/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "title": "The anchor is the dimension dataset that reaches the others", | ||
| "question": "Which orders over 100 are there, with the region of their customer?", | ||
| "behavior": "orders reaches customers, and customers does not reach orders, so the anchor is orders.", | ||
| "spec": ["5.6", "B.5"], | ||
| "columns": ["order_id", "region"], | ||
| "rows": [ | ||
| ["O2", "EAST"], | ||
| ["O4", "WEST"] | ||
| ] | ||
| } |
4 changes: 4 additions & 0 deletions
4
compliance/wide_table/cases/a12_anchor_from_dimensions/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "dimensions": ["orders.order_id", "customers.region"], | ||
| "filter": "orders.amount > 100" | ||
| } |
8 changes: 8 additions & 0 deletions
8
compliance/wide_table/cases/a13_filter_false_with_dimension/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "title": "A filter that removes every row leaves no groups", | ||
| "question": "What is the order amount by customer region, when no order is kept?", | ||
| "behavior": "The branch has no rows, so there are no keys and no rows.", | ||
| "spec": ["3.4", "5.5", "B.5"], | ||
| "columns": ["region", "total_revenue"], | ||
| "rows": [] | ||
| } |
5 changes: 5 additions & 0 deletions
5
compliance/wide_table/cases/a13_filter_false_with_dimension/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "dimensions": ["customers.region"], | ||
| "metrics": ["orders.total_revenue"], | ||
| "filter": "FALSE" | ||
| } |
10 changes: 10 additions & 0 deletions
10
compliance/wide_table/cases/a14_filter_false_without_dimension/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "title": "Without dimensions, the result has one row", | ||
| "question": "What is the order amount, when no order is kept?", | ||
| "behavior": "The only key is the empty tuple. The value is the empty-input value of SUM, NULL.", | ||
| "spec": ["3.6", "5.5", "B.5"], | ||
| "columns": ["total_revenue"], | ||
| "rows": [ | ||
| [null] | ||
| ] | ||
| } |
4 changes: 4 additions & 0 deletions
4
compliance/wide_table/cases/a14_filter_false_without_dimension/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "metrics": ["orders.total_revenue"], | ||
| "filter": "FALSE" | ||
| } |
10 changes: 10 additions & 0 deletions
10
compliance/wide_table/cases/a15_unconnected_filter_false/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "title": "A filter without a dataset applies to unconnected metrics", | ||
| "question": "What are the order amount and the number of tickets, when no row is kept?", | ||
| "behavior": "FALSE reads no dataset, so it needs no path. Each metric takes its empty-input value: NULL for SUM, 0 for COUNT(*).", | ||
| "spec": ["3.4", "5.3", "B.4"], | ||
| "columns": ["total_revenue", "ticket_count"], | ||
| "rows": [ | ||
| [null, 0] | ||
| ] | ||
| } |
4 changes: 4 additions & 0 deletions
4
compliance/wide_table/cases/a15_unconnected_filter_false/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "metrics": ["orders.total_revenue", "tickets.ticket_count"], | ||
| "filter": "FALSE" | ||
| } |
7 changes: 7 additions & 0 deletions
7
compliance/wide_table/cases/e01_invalid_query_unknown_key/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "title": "An unsupported part is malformed", | ||
| "question": "What is the order amount, limited to 10 rows?", | ||
| "behavior": "limit is not a part of this version. The engine rejects it rather than ignore it.", | ||
| "spec": ["3.5", "3.7", "8"], | ||
| "error": "E_INVALID_QUERY" | ||
| } |
4 changes: 4 additions & 0 deletions
4
compliance/wide_table/cases/e01_invalid_query_unknown_key/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "metrics": ["orders.total_revenue"], | ||
| "limit": 10 | ||
| } |
7 changes: 7 additions & 0 deletions
7
compliance/wide_table/cases/e02_invalid_query_null/expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "title": "A null value is malformed", | ||
| "question": "What is the order amount, with a null filter?", | ||
| "behavior": "The JSON binding treats null values as malformed.", | ||
| "spec": ["3.7", "8"], | ||
| "error": "E_INVALID_QUERY" | ||
| } |
4 changes: 4 additions & 0 deletions
4
compliance/wide_table/cases/e02_invalid_query_null/query.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "metrics": ["orders.total_revenue"], | ||
| "filter": null | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These details probably belong alongside the query or test setup. As a first step, we could capture them in READMEs in the test folders, then eventually migrate them into comments in the .ost test cases.