Search in sources :

Example 1 with VectorBatchGenerator

use of org.apache.hadoop.hive.ql.exec.vector.util.batchgen.VectorBatchGenerator in project hive by apache.

the class TestVectorBatchGenerate method testTryIt.

@Test
public void testTryIt() throws Exception {
    GenerateType[] generateTypes = new GenerateType[] { new GenerateType(GenerateCategory.INT), new GenerateType(GenerateCategory.BYTE) };
    VectorBatchGenerator generator = new VectorBatchGenerator(generateTypes);
    VectorizedRowBatch batch = generator.createBatch();
    Random random = new Random();
    generator.generateBatch(batch, random, VectorizedRowBatch.DEFAULT_SIZE);
    VectorBatchDebug.debugDisplayBatch(batch, "testTryIt");
}
Also used : VectorizedRowBatch(org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch) Random(java.util.Random) GenerateType(org.apache.hadoop.hive.ql.exec.vector.util.batchgen.VectorBatchGenerator.GenerateType) VectorBatchGenerator(org.apache.hadoop.hive.ql.exec.vector.util.batchgen.VectorBatchGenerator) Test(org.junit.Test)

Example 2 with VectorBatchGenerator

use of org.apache.hadoop.hive.ql.exec.vector.util.batchgen.VectorBatchGenerator in project hive by apache.

the class TestVectorBatchGenerate method testTryIt2.

@Test
public void testTryIt2() throws Exception {
    GenerateType[] generateTypes = new GenerateType[] { new GenerateType(GenerateCategory.BOOLEAN), new GenerateType(GenerateCategory.LONG), new GenerateType(GenerateCategory.DOUBLE) };
    VectorBatchGenerator generator = new VectorBatchGenerator(generateTypes);
    VectorizedRowBatch batch = generator.createBatch();
    Random random = new Random();
    generator.generateBatch(batch, random, VectorizedRowBatch.DEFAULT_SIZE);
    VectorBatchDebug.debugDisplayBatch(batch, "testTryIt2");
}
Also used : VectorizedRowBatch(org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch) Random(java.util.Random) GenerateType(org.apache.hadoop.hive.ql.exec.vector.util.batchgen.VectorBatchGenerator.GenerateType) VectorBatchGenerator(org.apache.hadoop.hive.ql.exec.vector.util.batchgen.VectorBatchGenerator) Test(org.junit.Test)

Aggregations

Random (java.util.Random)2 VectorizedRowBatch (org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch)2 VectorBatchGenerator (org.apache.hadoop.hive.ql.exec.vector.util.batchgen.VectorBatchGenerator)2 GenerateType (org.apache.hadoop.hive.ql.exec.vector.util.batchgen.VectorBatchGenerator.GenerateType)2 Test (org.junit.Test)2