Skip to content
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

vtexplain support select distinct and other expressions #5139

Merged
merged 3 commits into from
Aug 30, 2019

Conversation

demmer
Copy link
Member

@demmer demmer commented Aug 27, 2019

Summary

Add support for select distinct, substr, case, and more expressions to vtexplain.

Description

Part of the vtexplain execution engine fabricates query results, and so it needs to know the type of each column that should be in the result set.

Rework the analyzer that infers the column type from the select expression so that it handles parenthesized expressions like substr and select distinct(col), as well as case expressions.

Also change the engine so that it logs an error instead of failing outright if it can't resolve an expression to a column type, since the column values aren't always needed for it to effectively simulate a query.

Rework the vtexplain simulated mysql to handle more expression types
when calculating fake column results based on inferences off the select
expression.

Also change the engine so that it logs an error instead of failing
outright, since the column values aren't always needed for it to
effectively simulate a query.

Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
@demmer demmer requested a review from sougou as a code owner August 27, 2019 03:57
@demmer demmer requested a review from rafael August 27, 2019 03:58
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
@sougou sougou merged commit 7d77f7d into vitessio:master Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants