public class TestNullColumnLoader extends SubOperatorTest
In anticipation of having type information, this mechanism can create the classic nullable Int null column, or one of any other type and mode.
DrillTest.MemWatcherdirTestWatcher, fixturelogOutcome, objectMapper, REPEAT_RULE, thrownException, TIMEOUT| Constructor and Description |
|---|
TestNullColumnLoader() |
| Modifier and Type | Method and Description |
|---|---|
void |
testBasics()
Test the simplest case: default null type, nothing in the vector
cache.
|
void |
testCachedTypesAllowRequired()
Suppose, in the previous test, that one of the columns that
goes missing is a required column.
|
void |
testCachedTypesMapToNullable()
Drill requires "schema persistence": if a scan operator
reads two files, F1 and F2, then the scan operator must
provide the same vectors from both readers.
|
void |
testCustomNullType()
Test the ability to use a type other than nullable INT for null
columns.
|
void |
testDefaultValue()
Test the ability to provide a default value for a "null" column.
|
void |
testNullColumnBuilder()
Test the shim class that adapts between the null column loader
and the projection mechanism.
|
void |
testNullColumnBuilderWithSchema()
Test using an output schema, along with a default value property,
to define a default value for missing columns.
|
void |
testSchemaWithConflicts()
Test the various conflicts that can occur:
Schema is required, but no default value for null column.
Query wants a different type than that in the schema.
Query wants a different mode than that in the schema.
The type and mode provided to the builder is that which would result from
schema smoothing.
|
classSetup, classTeardownescapeJsonString, finishDrillTest, initDrillTestpublic void testBasics()
public void testCustomNullType()
public void testDefaultValue()
public void testCachedTypesMapToNullable()
Test the case in which the reader for F1 found columns (a, b, c) but, F2 found only (a, b), requiring that we fill in column c, filled with nulls, but of the same type that it was in file F1. We use a vector cache to pull off this trick. This test ensures that the null column mechanism looks in that vector cache when asked to create a nullable column.
public void testCachedTypesAllowRequired()
public void testNullColumnBuilder()
public void testNullColumnBuilderWithSchema()
public void testSchemaWithConflicts()
Defaults for null columns are ignored: null columns use NULL as the null value.
Copyright © 2021 The Apache Software Foundation. All rights reserved.