-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: can't run EXPLAIN(DISTSQL) or EXPLAIN(VEC) on plans that need to see concrete values from subqueries #40677
Comments
I guess the proximate cause is that explain_vec.go does this:
whereas explain_distsql.go leaves And subquery.go
|
Wait, are we looking at different things? Isn't the proximate cause:
which sounds like a window functions thing? |
I haven't looked into this issue, but the error message to me implies that the subquery is not evaluated, so it is a bug with |
Oh, yeah. How annoying. Perhaps |
I think there are two separate issues here then.
cockroach/pkg/sql/distsqlpb/processors.go Line 115 in acdabf6
cockroach/pkg/sql/distsqlpb/processors.go Line 110 in acdabf6
EvalSubquery code I posted above. (This happens before the frame starting offset must not be null error.)
|
I'll look into the internal error (a little bit later). |
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>
What's the status here? |
Nothing has changed, AFAIU it's pretty hard to fix this correctly, if possible, without actually executing the subquery. We could attempt to replace the result of subquery with zeroes, but that also is tricky since we need to have a zero of the "correct" type, probably doable though. |
This works with EXPLAIN and EXPLAIN ANALYZE in 21.1, should we close this issue since we are steering people away from these variants? @RaduBerinde |
I think these are more for our own use (especially VEC). We can now see distsql plans in the EXPLAIN ANALYZE (DEBUG) bundle, even with subqueries. I think the most useful thing we could do here would be to get |
We have marked this issue as stale because it has been inactive for |
The following produces an internal error with EXPLAIN (DISTSQL), even though the query itself runs fine. Not sure if it's related to other invalid index issues like #39433, #40444, or #39438.
This leads to the following error:
EXPLAIN (VEC) gives this:
Jira issue: CRDB-5526
Epic CRDB-14510
The text was updated successfully, but these errors were encountered: