Search in sources :

Example 1 with CountCollectorTestOperator

use of org.apache.hadoop.hive.ql.exec.util.collectoroperator.CountCollectorTestOperator in project hive by apache.

the class TestMapJoinOperator method executeTestImplementation.

private void executeTestImplementation(MapJoinTestImplementation mapJoinImplementation, MapJoinTestDescription testDesc, MapJoinTestData testData, RowTestObjectsMultiSet expectedTestRowMultiSet) throws Exception {
    System.out.println("*BENCHMARK* Starting " + mapJoinImplementation + " test");
    // UNDONE: Parameterize for implementation variation?
    MapJoinDesc mapJoinDesc = MapJoinTestConfig.createMapJoinDesc(testDesc);
    final boolean isVectorOutput = isVectorOutput(mapJoinImplementation);
    RowTestObjectsMultiSet outputTestRowMultiSet = new RowTestObjectsMultiSet();
    Operator<? extends OperatorDesc> testCollectorOperator = (!isVectorOutput ? new TestMultiSetCollectorOperator(testDesc.outputObjectInspectors, outputTestRowMultiSet) : new TestMultiSetVectorCollectorOperator(testDesc.outputTypeInfos, testDesc.outputObjectInspectors, outputTestRowMultiSet));
    MapJoinOperator operator = MapJoinTestConfig.createMapJoinImplementation(mapJoinImplementation, testDesc, testCollectorOperator, testData, mapJoinDesc);
    if (!isVectorOutput) {
        MapJoinTestData.driveBigTableData(testDesc, testData, operator);
    } else {
        MapJoinTestData.driveVectorBigTableData(testDesc, testData, operator);
    }
    System.out.println("*BENCHMARK* executeTestImplementation row count " + ((CountCollectorTestOperator) testCollectorOperator).getRowCount());
    // Verify the output!
    if (!expectedTestRowMultiSet.verify(outputTestRowMultiSet)) {
        System.out.println("*BENCHMARK* verify failed for " + mapJoinImplementation);
    } else {
        System.out.println("*BENCHMARK* verify succeeded for " + mapJoinImplementation);
    }
}
Also used : MapJoinOperator(org.apache.hadoop.hive.ql.exec.MapJoinOperator) VectorMapJoinOperator(org.apache.hadoop.hive.ql.exec.vector.VectorMapJoinOperator) MapJoinDesc(org.apache.hadoop.hive.ql.plan.MapJoinDesc) VectorMapJoinDesc(org.apache.hadoop.hive.ql.plan.VectorMapJoinDesc) CountCollectorTestOperator(org.apache.hadoop.hive.ql.exec.util.collectoroperator.CountCollectorTestOperator) RowTestObjectsMultiSet(org.apache.hadoop.hive.ql.exec.util.rowobjects.RowTestObjectsMultiSet)

Example 2 with CountCollectorTestOperator

use of org.apache.hadoop.hive.ql.exec.util.collectoroperator.CountCollectorTestOperator in project hive by apache.

the class AbstractMapJoin method setupBenchmarkImplementation.

protected static MapJoinOperator setupBenchmarkImplementation(MapJoinTestImplementation mapJoinImplementation, MapJoinTestDescription testDesc, MapJoinTestData testData) throws Exception {
    // UNDONE: Parameterize for implementation variation?
    MapJoinDesc mapJoinDesc = MapJoinTestConfig.createMapJoinDesc(testDesc);
    final boolean isVectorOutput = isVectorOutput(mapJoinImplementation);
    // This collector is just a row counter.
    Operator<? extends OperatorDesc> testCollectorOperator = (!isVectorOutput ? new CountCollectorTestOperator() : new CountVectorCollectorTestOperator());
    MapJoinOperator operator = MapJoinTestConfig.createMapJoinImplementation(mapJoinImplementation, testDesc, testCollectorOperator, testData, mapJoinDesc);
    return operator;
}
Also used : MapJoinOperator(org.apache.hadoop.hive.ql.exec.MapJoinOperator) MapJoinDesc(org.apache.hadoop.hive.ql.plan.MapJoinDesc) CountCollectorTestOperator(org.apache.hadoop.hive.ql.exec.util.collectoroperator.CountCollectorTestOperator) CountVectorCollectorTestOperator(org.apache.hadoop.hive.ql.exec.util.collectoroperator.CountVectorCollectorTestOperator)

Aggregations

MapJoinOperator (org.apache.hadoop.hive.ql.exec.MapJoinOperator)2 CountCollectorTestOperator (org.apache.hadoop.hive.ql.exec.util.collectoroperator.CountCollectorTestOperator)2 MapJoinDesc (org.apache.hadoop.hive.ql.plan.MapJoinDesc)2 CountVectorCollectorTestOperator (org.apache.hadoop.hive.ql.exec.util.collectoroperator.CountVectorCollectorTestOperator)1 RowTestObjectsMultiSet (org.apache.hadoop.hive.ql.exec.util.rowobjects.RowTestObjectsMultiSet)1 VectorMapJoinOperator (org.apache.hadoop.hive.ql.exec.vector.VectorMapJoinOperator)1 VectorMapJoinDesc (org.apache.hadoop.hive.ql.plan.VectorMapJoinDesc)1