Skip to content

Commit 7ffbf22

Browse files
authored
Remove SEMANTIC prefix from README examples (#35)
1 parent be64a96 commit 7ffbf22

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

README.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ SELECT
5252
FROM sales;
5353

5454
-- Query with AGGREGATE() and AT modifiers
55-
-- SEMANTIC is required for AGGREGATE() without AT, optional for AT queries
56-
SEMANTIC SELECT
55+
SELECT
5756
year,
5857
region,
5958
AGGREGATE(revenue) AS revenue,
@@ -62,15 +61,15 @@ SEMANTIC SELECT
6261
FROM sales_v;
6362

6463
-- Variance from the global average
65-
SEMANTIC SELECT
64+
SELECT
6665
region,
6766
AGGREGATE(revenue) AS revenue,
6867
AGGREGATE(revenue) AT (ALL) / 4.0 AS expected_if_equal, -- 4 regions
6968
AGGREGATE(revenue) - (AGGREGATE(revenue) AT (ALL) / 4.0) AS variance
7069
FROM sales_v;
7170

7271
-- Nested percentages (% of year, and that year's % of total)
73-
SEMANTIC SELECT
72+
SELECT
7473
year,
7574
region,
7675
AGGREGATE(revenue) AS revenue,
@@ -79,15 +78,15 @@ SEMANTIC SELECT
7978
FROM sales_v;
8079

8180
-- Compare 2024 performance to 2023 baseline for each region
82-
SEMANTIC SELECT
81+
SELECT
8382
region,
8483
AGGREGATE(revenue) AT (SET year = 2024) AS rev_2024,
8584
AGGREGATE(revenue) AT (SET year = 2023) AS rev_2023,
8685
AGGREGATE(revenue) AT (SET year = 2024) - AGGREGATE(revenue) AT (SET year = 2023) AS growth
8786
FROM sales_v;
8887

8988
-- Filter to specific segments
90-
SEMANTIC SELECT
89+
SELECT
9190
year,
9291
AGGREGATE(revenue) AS total_revenue,
9392
AGGREGATE(revenue) AT (SET region = 'North') AS north_revenue,
@@ -127,21 +126,14 @@ Yardstick automatically handles the grouping. All DuckDB aggregate functions are
127126

128127
### Querying Measures
129128

130-
Queries using `AGGREGATE()` without AT modifiers must use the `SEMANTIC` prefix. If an `AT (...)` modifier is present, the query can run without `SEMANTIC` because the AT syntax routes the statement through the extension parser.
131-
132129
```sql
133-
SEMANTIC SELECT
130+
SELECT
134131
dimensions,
135132
AGGREGATE(measure_name) [AT modifier]
136133
FROM view_name;
137134
```
138135

139-
```sql
140-
SELECT
141-
dimensions,
142-
AGGREGATE(measure_name) AT (ALL)
143-
FROM view_name;
144-
```
136+
On DuckDB 1.5+, queries containing `AGGREGATE()` are automatically intercepted by the extension's parser override, so no special prefix is needed. On older versions, the `SEMANTIC` prefix is still supported as a fallback.
145137

146138
### AT Modifiers
147139

0 commit comments

Comments
 (0)