public class DrillTestWrapper extends Object
To construct an instance easily, look at the TestBuilder class. From an implementation of the BaseTestQuery class, and instance of the builder is accessible through the testBuilder() method.
Modifier and Type | Class and Description |
---|---|
static interface |
DrillTestWrapper.TestServices |
Modifier and Type | Field and Description |
---|---|
static int |
EXPECTED_BATCH_COUNT_NOT_SET |
static int |
EXPECTED_NUM_RECORDS_NOT_SET |
Constructor and Description |
---|
DrillTestWrapper(TestBuilder testBuilder,
DrillTestWrapper.TestServices services,
Object query,
UserBitShared.QueryType queryType,
String baselineOptionSettingQueries,
String testOptionSettingQueries,
UserBitShared.QueryType baselineQueryType,
boolean ordered,
boolean approximateEquality,
double tolerance,
boolean highPerformanceComparison,
String[] baselineColumns,
List<Map<String,Object>> baselineRecords,
int expectedNumBatches,
int expectedNumRecords) |
Modifier and Type | Method and Description |
---|---|
static int |
addToCombinedVectorResults(Iterable<VectorAccessible> batches,
BatchSchema expectedSchema,
Long expectedBatchSize,
Integer expectedNumBatches,
Map<String,List<Object>> combinedVectors,
Integer expectedTotalRecords)
Add to result vectors and compare batch schema against expected schema while iterating batches.
|
static Map<String,List<Object>> |
addToCombinedVectorResults(Iterable<VectorAccessible> batches,
Long expectedBatchSize,
Integer expectedNumBatches,
Integer expectedTotalRecords)
Iterate over batches, and combine the batches into a map, where key is schema path, and value is
the list of column values across all the batches.
|
static void |
addToMaterializedResults(List<Map<String,Object>> materializedRecords,
List<QueryDataBatch> records,
RecordBatchLoader loader) |
void |
checkColumnDef(BatchSchema batchSchema) |
void |
compareMergedOnHeapVectors() |
static void |
compareMergedVectors(Map<String,List<Object>> expectedRecords,
Map<String,List<Object>> actualRecords) |
protected void |
compareOrderedResults()
Use this method only if necessary to validate one query against another.
|
void |
compareResultsHyperVector() |
protected void |
compareSchemaOnly() |
protected void |
compareUnorderedResults()
Use this method only if necessary to validate one query against another.
|
static boolean |
compareValues(Object expected,
Object actual,
int counter,
String column) |
static boolean |
compareValues(Object expected,
Object actual,
int counter,
String column,
boolean approximateEquality,
double tolerance) |
static boolean |
compareValuesErrorOnMismatch(Object expected,
Object actual,
int counter,
String column) |
void |
run() |
static Map<String,List<Object>> |
translateRecordListToHeapVectors(List<Map<String,Object>> records) |
public static final int EXPECTED_BATCH_COUNT_NOT_SET
public static final int EXPECTED_NUM_RECORDS_NOT_SET
public DrillTestWrapper(TestBuilder testBuilder, DrillTestWrapper.TestServices services, Object query, UserBitShared.QueryType queryType, String baselineOptionSettingQueries, String testOptionSettingQueries, UserBitShared.QueryType baselineQueryType, boolean ordered, boolean approximateEquality, double tolerance, boolean highPerformanceComparison, String[] baselineColumns, List<Map<String,Object>> baselineRecords, int expectedNumBatches, int expectedNumRecords)
public static void compareMergedVectors(Map<String,List<Object>> expectedRecords, Map<String,List<Object>> actualRecords) throws Exception
Exception
public static Map<String,List<Object>> addToCombinedVectorResults(Iterable<VectorAccessible> batches, Long expectedBatchSize, Integer expectedNumBatches, Integer expectedTotalRecords) throws SchemaChangeException, UnsupportedEncodingException
batches
- expectedTotalRecords
- SchemaChangeException
UnsupportedEncodingException
public static int addToCombinedVectorResults(Iterable<VectorAccessible> batches, BatchSchema expectedSchema, Long expectedBatchSize, Integer expectedNumBatches, Map<String,List<Object>> combinedVectors, Integer expectedTotalRecords) throws SchemaChangeException, UnsupportedEncodingException
batches
- expectedSchema:
- the expected schema the batches should contain. Through SchemaChangeException
if encounter different batch schema.combinedVectors:
- the vectors to hold the values when iterate the batches.SchemaChangeException
UnsupportedEncodingException
protected void compareUnorderedResults() throws Exception
Exception
public void checkColumnDef(BatchSchema batchSchema) throws Exception
Exception
protected void compareOrderedResults() throws Exception
Exception
public void compareMergedOnHeapVectors() throws Exception
Exception
public static Map<String,List<Object>> translateRecordListToHeapVectors(List<Map<String,Object>> records)
public void compareResultsHyperVector() throws Exception
Exception
public static void addToMaterializedResults(List<Map<String,Object>> materializedRecords, List<QueryDataBatch> records, RecordBatchLoader loader) throws SchemaChangeException, UnsupportedEncodingException
public static boolean compareValuesErrorOnMismatch(Object expected, Object actual, int counter, String column) throws Exception
Exception
public static boolean compareValues(Object expected, Object actual, int counter, String column) throws Exception
Exception
Copyright © 2021 The Apache Software Foundation. All rights reserved.