Skip to content

Commit

Permalink
Fix BenchmarkPlanner
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Jul 31, 2020
1 parent 349dc7c commit 0ae4c1c
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.VerboseMode;
import org.openjdk.jmh.runner.options.WarmupMode;
import org.testng.annotations.Test;

import java.io.IOException;
import java.net.URL;
Expand All @@ -51,6 +52,7 @@
import static io.prestosql.sql.planner.LogicalPlanner.Stage.OPTIMIZED;
import static io.prestosql.testing.TestingSession.testSessionBuilder;
import static java.lang.String.format;
import static org.testng.Assert.assertEquals;

@SuppressWarnings("MethodMayBeStatic")
@State(Scope.Benchmark)
Expand Down Expand Up @@ -88,7 +90,7 @@ public void setup()
queries = IntStream.rangeClosed(1, 22)
.boxed()
.filter(i -> i != 15) // q15 has two queries in it
.map(i -> readResource(format("/io/airlift/tpch/queries/q%d.sql", i)))
.map(i -> readResource(format("/io/prestosql/tpch/queries/q%d.sql", i)))
.collect(toImmutableList());
}

Expand Down Expand Up @@ -122,6 +124,15 @@ public List<Plan> planQueries(BenchmarkData benchmarkData)
});
}

@Test
public void verify()
{
BenchmarkData data = new BenchmarkData();
data.setup();
BenchmarkPlanner benchmark = new BenchmarkPlanner();
assertEquals(benchmark.planQueries(data).size(), 21);
}

public static void main(String[] args)
throws Exception
{
Expand Down

0 comments on commit 0ae4c1c

Please sign in to comment.