Package com.facebook.presto.operator

Examples of com.facebook.presto.operator.PageBuilder.build()


                }
            }

            AggregationFunction function = new DeterministicBootstrappedAggregation(createTestingBlockEncodingManager(), LONG_SUM);

            successes += approximateAggregationWithinErrorBound(function, 1, 0.5, (double) sum, builder.build()) ? 1 : 0;
        }

        // Since we used a confidence of 0.5, successes should have a binomial distribution B(n=20, p=0.5)
        assertTrue(binomial.inverseCumulativeProbability(0.01) < successes && successes < binomial.inverseCumulativeProbability(0.99));
    }
View Full Code Here


                // write position to output block
                hashStrategy.appendTo(leftBlockIndex, leftBlockPosition, pageBuilder, 0);
            }

            // verify output block matches
            assertBlockEquals(pageBuilder.build().getBlock(0), leftBlock);
        }
    }

    @Test
    public void testMultiChannel()
View Full Code Here

                // write position to output block
                hashStrategy.appendTo(leftBlockIndex, leftBlockPosition, pageBuilder, 0);
            }

            // verify output block matches
            Page page = pageBuilder.build();
            assertPageEquals(page, new Page(
                    extraChannel.get(leftBlockIndex),
                    varcharChannel.get(leftBlockIndex),
                    longChannel.get(leftBlockIndex),
                    doubleChannel.get(leftBlockIndex),
View Full Code Here

            joinProbe.appendTo(pageBuilder);

            assertEquals(joinProbe.getCurrentJoinPosition(), lookupSource.getJoinPosition(position, probeBlock));
        }
        assertFalse(joinProbe.advanceNextPosition());
        assertBlockEquals(pageBuilder.build().getBlock(0), page.getBlock(0));
    }
}
View Full Code Here

            }
        }

        BootstrappedAggregation function = new BootstrappedAggregation(LONG_SUM);

        assertApproximateAggregation(function, 1, 0.99, sum, 0, builder.build());
    }

    @Test
    public void testErrorBound()
            throws Exception
View Full Code Here

                }
            }

            BootstrappedAggregation function = new BootstrappedAggregation(LONG_SUM);

            successes += approximateAggregationWithinErrorBound(function, 1, 0.5, sum, 0, builder.build()) ? 1 : 0;
        }

        // Since we used a confidence of 0.5, successes should have a binomial distribution B(n=20, p=0.5)
        assertTrue(binomial.inverseCumulativeProbability(0.01) < successes && successes < binomial.inverseCumulativeProbability(0.99));
    }
View Full Code Here

                // write position to output block
                hashStrategy.appendTo(leftBlockIndex, leftBlockPosition, pageBuilder, 0);
            }

            // verify output block matches
            assertBlockEquals(pageBuilder.build().getBlock(0), leftBlock);
        }
    }

    @Test
    public void testMultiChannel()
View Full Code Here

                // write position to output block
                hashStrategy.appendTo(leftBlockIndex, leftBlockPosition, pageBuilder, 0);
            }

            // verify output block matches
            Page page = pageBuilder.build();
            assertPageEquals(page, new Page(
                    extraChannel.get(leftBlockIndex),
                    varcharChannel.get(leftBlockIndex),
                    longChannel.get(leftBlockIndex),
                    doubleChannel.get(leftBlockIndex),
View Full Code Here

            joinProbe.appendTo(pageBuilder);

            assertEquals(joinProbe.getCurrentJoinPosition(), lookupSource.getJoinPosition(probeCursor));
        }
        assertFalse(joinProbe.advanceNextPosition());
        assertBlockEquals(pageBuilder.build().getBlock(0), page.getBlock(0));
    }
}
View Full Code Here

            }
        }

        AggregationFunction function = new DeterministicBootstrappedAggregation(LONG_SUM);

        assertApproximateAggregation(function, 1, 0.99, (double) sum, builder.build());
    }

    @Test
    public void testErrorBound()
            throws Exception
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.