This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 115
[PROPOSAL]: Gold Standard #334
Comments
apoorvedave1
added
proposal
This is the default tag for a newly created design proposal
untriaged
This is the default tag for a newly created issue
labels
Jan 26, 2021
Thank you! Can you follow the outline from here please? I think you have most of it already. |
Can you explain |
Thanks @rapoth , yeah I will fix it before merging. the general idea is we will have lot's of approved simplified plans for different configs. Just as an example, with and without hybrid scan enabled, we will have very different "simplifiedApprovedPlans". so I used e.g.
tpcdsBasic/.../q1Simplified.txt:
tpcdsOther/.../q1Simplified.txt:
|
This was referenced Jan 27, 2021
Open
@imback82 @pirz @thugsatbay @sezruby please take a look at the latest changes for gold standard |
This was referenced Mar 12, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Problem Statement
#282 Gold Standard
Design for plan validation for TPCDS queries, with features for extensibility to more data sets and various tpcds configs
Proposed solution
Attaching class diagram and E2E workflow of the gold standard test setup for hyperspace. This plan should have a basic setup for tpcds query plan validation as well as extension points for more query/data/config combinations.
File Structure:
/ApprovedSimplifiedPlans/
The
approvedSimplifiedPlans
directory will contain two files for each tpcds query:explain.txt
andsimplified.txt
.explain.txt: this file contains df.explain() output of a query. This is only for display and comparison purposes for the user. This file is not used for comparison in the tests.
simplified.txt: this file is a simplified plan. it normalizes references and cleans up locations. This plan is used in comparison and fails tests if string matching fails.
Test Class Diagram and File Structure
Workflow of DataGenerator and IndexGenerator
End to End Test Workflow
Complete pdf with above diagrams in high def:
Class Diagrams and Test Workflow.pdf
Implementation
Who/When: @apoorvedave1 , 3 weeks from date of start (5-6 weeks for merge) not including interruptions.
PRs
Tasks:
MockTPCDSDataGenerator Tasks:
Index Generator Tasks:
Comparator Tasks:
PlanStabilityStuite Tasks:
Implemented by subclasses. e.g. for TPCDSBasicSuite (extends PlanStabilitySuite), this would be "src/test/resources/tpcdsbasic/"
Use configs and query id to get spark query from query file at "src/test/resources/tpcdsbasic/queries/"
Run query.explain to generate simplified plan.
normalize and return
For all queries to test
generateSimplifiedPlans and save at test location
create normalized plan for query
if (regenerateApprovedPlans) copy plan to approvedPlans location
else compare with approvedPlans location and return result
TpcdsBasicSuite Tasks:
Use dataGenerator and IndexGenerator to create data and index. >> E.g. for refresh index/hybrid scan, use this differently.
Updating Approved Plans
It is possible that with addition of new rules or indexes, we expect updated query plans. This would lead to test failures if we fail to update the approvedSimplifiedPlan for those queries.
Regression: Defining Regression and Test Failure
If a test starts failing, it means the expected plan is different from actual plan for a failed query. For now it's a manual step to resolve this issue.
We have two options at this point:
Adding New Test Suites
Based on the current design, it's pretty easy to add new suites to Gold Standard.
Performance Implications (if applicable)
None
Open issues (if applicable)
Additional context (if applicable)
Similar to Spark's Plan Stability Suite
https://github.com/apache/spark/blob/master/sql/core/src/test/scala/org/apache/spark/sql/PlanStabilitySuite.scala
The text was updated successfully, but these errors were encountered: