Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a1b14ae
Fix ORDER BY with named aggregates that expand to subqueries (#28)
nicosuave Apr 10, 2026
e25309e
Use find_top_level_keyword for outer SELECT in subquery alias extraction
nicosuave Apr 10, 2026
50e133e
Skip string literals and comments when detecting ORDER BY alias refs
nicosuave Apr 11, 2026
0b32f93
Fix UTF-8 boundary panic and quoted qualifier false positives
nicosuave Apr 11, 2026
c4bb0a6
Merge origin/main and resolve conflicts
nicosuave Apr 11, 2026
e630dbb
Fix uppercase byte-offset mismatch and bare quoted alias detection
nicosuave Apr 11, 2026
7d6f736
Fix char boundary advance and handle whitespace around AS aliases
nicosuave Apr 11, 2026
4ec199d
Relax subquery detection and skip parenthesized alias matches
nicosuave Apr 11, 2026
f83ac55
Match aliases inside parenthesized ORDER BY and support implicit aliases
nicosuave Apr 11, 2026
d430c8a
Require token boundaries for SELECT/WITH subquery checks
nicosuave Apr 11, 2026
7740e27
Skip string literals and comments when detecting subqueries
nicosuave Apr 11, 2026
afd6e29
Skip literals and comments in subquery_alias_from_item depth tracking
nicosuave Apr 11, 2026
ef2686e
Skip comments when splitting SELECT items in alias extraction
nicosuave Apr 12, 2026
0303c34
Skip nested subqueries when scanning ORDER BY for alias references
nicosuave Apr 12, 2026
07389a0
Use uppercased string for all byte indexing in identifier_appears_in
nicosuave Apr 12, 2026
fff8cbc
Derive ORDER BY expression start from actual keyword span
nicosuave Apr 13, 2026
fd5bcd8
Handle spaced qualified quoted names in alias detection
nicosuave Apr 13, 2026
e5f0106
Exclude SQL keywords from implicit subquery alias detection
nicosuave Apr 13, 2026
a993439
Handle spaced qualified identifiers and skip literals in subquery str…
nicosuave Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions test/sql/measures.test
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,49 @@ WHERE year = 2023;
----
150.0

# ORDER BY with named aggregate that expands to a subquery (GH #28)
query IIRR
SEMANTIC SELECT
year,
region,
AGGREGATE(revenue) AS revenue,
AGGREGATE(revenue) AT (ALL region) AS year_total
FROM sales_v
ORDER BY revenue/year_total, year, region;
----
2022 EU 50.0 150.0
2023 EU 75.0 225.0
2022 US 100.0 150.0
2023 US 150.0 225.0

# ORDER BY with simple alias of subquery expression (GH #28)
query IIR
SEMANTIC SELECT
year,
region,
AGGREGATE(revenue) AT (ALL region) AS year_total
FROM sales_v
ORDER BY year_total, year, region;
----
2022 EU 150.0
2022 US 150.0
2023 EU 225.0
2023 US 225.0

# ORDER BY DESC with subquery alias (GH #28)
query IIR
SEMANTIC SELECT
year,
region,
AGGREGATE(revenue) AT (ALL region) AS year_total
FROM sales_v
ORDER BY year_total DESC, year, region;
----
2023 EU 225.0
2023 US 225.0
2022 EU 150.0
2022 US 150.0

# =============================================================================
# Test: Expression dimensions (issue #29)
# =============================================================================
Expand Down
Loading
Loading