public class TestResultSetLoaderProtocol extends SubOperatorTest
Run this test first to do a sanity check of the result set loader after making changes.
You will find that the result set loader creates a very complex tree of objects that can be quite hard to understand and debug. Please read the material in the various subsystems to see how the classes fit together to implement Drill's rich JSON-like data model.
To aid in debugging, you can also dump the result set loader, and all its child objects as follows:
((ResultSetLoaderImpl) rsLoader).dump(new HierarchicalPrinter());
Simply insert that line into these tests anywhere you want to visualize
the structure. The object tree will show all the components and their
current state.dirTestWatcher, fixture| Constructor and Description |
|---|
TestResultSetLoaderProtocol() |
| Modifier and Type | Method and Description |
|---|---|
void |
testBasics() |
void |
testCaseInsensitiveSchema()
Schemas are case insensitive by default.
|
void |
testCloseWithoutHarvest()
Test that memory is released if the loader is closed with an active
batch (that is, before the batch is harvested.)
|
void |
testInitialSchema()
Provide a schema up front to the loader; schema is built before
the first row.
|
void |
testOverwriteRow()
The writer protocol allows a client to write to a row any number of times
before invoking
save(). |
classSetup, classTeardownpublic void testBasics()
public void testCaseInsensitiveSchema()
The tests here and elsewhere build columns from a MaterializedField. Doing so is rather old-school; better to use the newer ColumnMetadata which provides additional information. The code here simply uses the MaterializedField to create a ColumnMetadata implicitly.
public void testInitialSchema()
Also verifies the test-time method to set a row of values using a single method.
public void testOverwriteRow()
save(). In this case, each new value simply
overwrites the previous value. Here, we test the most basic case: a simple,
flat tuple with no arrays. We use a very large Varchar that would, if
overwrite were not working, cause vector overflow.
The ability to overwrite rows is seldom needed except in one future use case: writing a row, then applying a filter "in-place" to discard unwanted rows, without having to send the row downstream.
Because of this use case, specific rules apply when discarding row or overwriting values.
public void testCloseWithoutHarvest()
Copyright © 2022 The Apache Software Foundation. All rights reserved.