Add test for CBO decisions on TPC-H, TPC-DS queries#11665
Add test for CBO decisions on TPC-H, TPC-DS queries#11665kokosing merged 2 commits intoprestodb:masterfrom kokosing:origin/master/035_cbo_tests
Conversation
|
Applied comments from #11267 |
There was a problem hiding this comment.
In a follow up I would like to extract this concept and use it (replace the usage) instead of com.facebook.presto.sql.planner.assertions.PlanMatchPattern. This is much more easier to debug and maintain.
presto-benchto-queries/README.md
Outdated
There was a problem hiding this comment.
I think this readme file should remain in presto-benchto-benchmarks
presto-benchto-queries/pom.xml
Outdated
pom.xml
Outdated
There was a problem hiding this comment.
Move it to the previous commit
pom.xml
Outdated
There was a problem hiding this comment.
Move it to the previous commit
presto-benchto-queries/pom.xml
Outdated
There was a problem hiding this comment.
Move it to the previous commit
There was a problem hiding this comment.
You don't need this. Use Resources.toString()
There was a problem hiding this comment.
Scan queries in the classpath instead.
Reflections reflections = new Reflections("some.package", new ResourcesScanner());
Set<String> fileNames = reflections.getResources(Pattern.compile("q(\\d+)\.sql"));
There was a problem hiding this comment.
I would prefer not to drag new dependency just for this
There was a problem hiding this comment.
Sorry, i thought this is the class from Guava. Nevermind than.
There was a problem hiding this comment.
Extract ID from query file Pattern.compile("q(\\d+)\.sql")
There was a problem hiding this comment.
Scan resources from the resource path, so you don't need to do this hack
Thanks to this extraction queries could be use from other modules, without copying query files or dragging any not needed dependencies.
|
Comments applied. |
There was a problem hiding this comment.
Make it String. Path object implies a reference to a real file system.
There was a problem hiding this comment.
How about
private String getQueryPlanResourcePath(String queryResourcePath)
{
return queryResourcePath.replace("\.sql$", ".plan");
}
There was a problem hiding this comment.
static import getResource. Also you can use getResource(string). Context class loader should be fine here.
There was a problem hiding this comment.
Context class loader should be fine here.
It does not work.
There was a problem hiding this comment.
Move it before the JoinOrderPrinter. Class definition come last.
kokosing
left a comment
There was a problem hiding this comment.
Comments addressed. Thanks!
There was a problem hiding this comment.
Context class loader should be fine here.
It does not work.
|
Was it an intentional change that i can no longer just run |
|
Also, the exception is misleading. IntelliJ was setting presto source dir as working directory by default. |
Add test for CBO decisions on TPC-H, TPC-DS queries