-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
40803: sql: replace an internal error in EXPLAIN (DISTSQL) and EXPLAIN (VEC) r=jordanlewis a=yuzefovich Currently, when we're explaining a query that has a subquery value of which is needed to construct the physical plan, we error out with an internal error. This commit replaces that stack trace with a more user-friendly message saying that explaining such a query is not supported. Addresses: #40677. Release justification: Category 2: Bug fixes and low-risk updates to new functionality. Release note: None Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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,15 @@ | ||
# LogicTest: local local-vec-off | ||
|
||
statement ok | ||
CREATE TABLE t (a INT PRIMARY KEY) | ||
|
||
# Test that EXPLAIN (DISTSQL) on a query with a subquery works. | ||
query T | ||
SELECT url FROM [EXPLAIN (DISTSQL) SELECT * FROM (SELECT avg(a) OVER () FROM t)] | ||
---- | ||
https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkDFLBDEQhXt_xfEqhchttky1VnKNJ6doISniZjgCe0nIzKJy7H-X3RR6womW8ybf-8IcEZOnO3cghnmBhlXIJfXEnMoc1Qcb_w7TKISYR5ljq9CnQjBHSJCBYPDoXgfakfNU1g0UPIkLw1KbSzi48tEJFB6yi2xW17CTQhrlq5DF7QlGT-rv0ucQfXqjstanxpun28tOX0FhO4pZde1ZXfsf3Y44p8h0IjvX3ExWgfye6h05jaWn-5L6RVPH7cItgSeWutV12MS6mj_4Hda_wu0P2E4XnwEAAP__EY6e-w== | ||
|
||
# Test that explaining a query that contains a subquery the result of which is | ||
# needed to make the physical plan is rejected. See #40677. | ||
statement error running EXPLAIN \(DISTSQL\) on this query is unsupported because of the presence of subqueries | ||
EXPLAIN (DISTSQL) SELECT avg(a) OVER (ROWS (SELECT count(*) FROM t) PRECEDING) FROM t |