Skip to content

Commit

Permalink
Benchmark different join build sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
sopel39 committed Nov 2, 2021
1 parent 16dfce0 commit 9f202ea
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public class BenchmarkHashBuildAndJoinOperators
public static class BuildContext
{
protected static final int ROWS_PER_PAGE = 1024;
protected static final int BUILD_ROWS_NUMBER = 8_000_000;

@Param({"varchar", "bigint", "all"})
protected String hashColumns = "bigint";
Expand All @@ -111,6 +110,9 @@ public static class BuildContext
@Param({"1", "5"})
protected int buildRowsRepetition = 1;

@Param({"10", "100", "10000", "100000", "1000000", "8000000"})
protected int buildRowsNumber = 8_000_000;

protected ExecutorService executor;
protected ScheduledExecutorService scheduledExecutor;
protected List<Page> buildPages;
Expand Down Expand Up @@ -169,10 +171,10 @@ protected void initializeBuildPages()
{
RowPagesBuilder buildPagesBuilder = rowPagesBuilder(buildHashEnabled, hashChannels, ImmutableList.of(VARCHAR, BIGINT, BIGINT));

int maxValue = BUILD_ROWS_NUMBER / buildRowsRepetition + 40;
int maxValue = buildRowsNumber / buildRowsRepetition + 40;
int rows = 0;
while (rows < BUILD_ROWS_NUMBER) {
int newRows = Math.min(BUILD_ROWS_NUMBER - rows, ROWS_PER_PAGE);
while (rows < buildRowsNumber) {
int newRows = Math.min(buildRowsNumber - rows, ROWS_PER_PAGE);
buildPagesBuilder.addSequencePage(newRows, (rows + 20) % maxValue, (rows + 30) % maxValue, (rows + 40) % maxValue);
buildPagesBuilder.pageBreak();
rows += newRows;
Expand Down Expand Up @@ -269,9 +271,9 @@ protected void initializeProbePages()
while (remainingRows > 0) {
double roll = random.nextDouble();

int columnA = 20 + remainingRows;
int columnB = 30 + remainingRows;
int columnC = 40 + remainingRows;
int columnA = 20 + (remainingRows % buildRowsNumber);
int columnB = 30 + (remainingRows % buildRowsNumber);
int columnC = 40 + (remainingRows % buildRowsNumber);

int rowsCount = 1;
if (matchRate < 1) {
Expand Down

0 comments on commit 9f202ea

Please sign in to comment.