Skip to content

vtexplain support select distinct and other expressions#5139

Merged
sougou merged 3 commits intovitessio:masterfrom
tinyspeck:vtexplain-support-select-distinct
Aug 30, 2019
Merged

vtexplain support select distinct and other expressions#5139
sougou merged 3 commits intovitessio:masterfrom
tinyspeck:vtexplain-support-select-distinct

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
demmer added 2 commits August 27, 2019 10:24
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