public class TestCsvWithHeaders extends BaseCsvTest
Open issues:
TestHeaderBuilderDrillTest.MemWatcherBIG_COL_SIZE, EMPTY_FILE, FILE_N_NAME, NESTED_DIR, NESTED_FILE, PART_DIR, ROOT_FILE, SCHEMA_BATCH_ENABLED, secondFile, testDir, validHeadersclient, cluster, dirTestWatcherlogOutcome, objectMapper, REPEAT_RULE, thrownException, TIMEOUT| Constructor and Description |
|---|
TestCsvWithHeaders() |
| Modifier and Type | Method and Description |
|---|---|
void |
doTestExplicitPartitionsMultiFiles()
Test using partition columns with partitioned files in V3.
|
static void |
setup() |
void |
testColsWithWildcard() |
void |
testColumnsCol()
The column name `columns` is treated as a plain old
column when using column headers.
|
void |
testColumnsIndex()
The column name `columns` is treated as a plain old
column when using column headers.
|
void |
testColumnsIndexMissing()
If columns[x] is used, then this can't possibly match a valid
text reader column, so raise an error instead.
|
void |
testColumnsMissing() |
void |
testCsvHeadersCaseInsensitive() |
void |
testDataNoNewline() |
void |
testDupColumn() |
void |
testEmptyBody()
A file with a header has a schema, but has no rows.
|
void |
testEmptyCsvHeaders()
Trivial case: empty header.
|
void |
testEmptyFile()
An empty file with schema is invalid: there is no header line
and so there is no schema.
|
void |
testHeadersNoNewline() |
void |
testHeadersOnly() |
void |
testHugeColumn() |
void |
testImplicitColsExplicitSelect()
Verify that implicit columns are recognized and populated.
|
void |
testImplicitColWildcard()
Verify that implicit columns are recognized and populated.
|
void |
testInvalidCsvHeaders() |
void |
testPartitionColsExplicit()
V3 allows the use of partition columns, even for a non-partitioned file.
|
void |
testPartitionExpansion()
Test partition expansion.
|
void |
testRaggedRows()
Test that ragged rows result in the "missing" columns being filled
in with the moral equivalent of a null column for CSV: a blank string.
|
void |
testValidCsvHeaders() |
void |
testWildcard()
Verify that the wildcard expands columns to the header names, including
case
|
void |
testWildcardAndPartitionsMultiFiles()
Test the use of partition columns with the wildcard.
|
buildBigColFile, buildFile, buildFile, buildNestedTable, buildTable, enableMultiScan, enableSchema, enableSchemaSupport, resetMultiScan, resetSchema, resetSchemaSupport, setup, setupgetFile, queryBuilder, run, runAndLog, runAndPrint, runAndPrint, shutdown, startCluster, testBuilderescapeJsonString, finishDrillTest, initDrillTestpublic void testEmptyFile()
throws IOException
Prior research revealed that most DB engines can handle a null
empty result set: no schema, no rows. For example:
SELECT * FROM VALUES ();
The implementation tested here follows that pattern.
IOExceptionTestCsvWithoutHeaders.testEmptyFile()public void testEmptyCsvHeaders()
throws IOException
IOExceptionpublic void testHeadersNoNewline()
throws IOException
IOExceptionpublic void testEmptyBody()
throws IOException
IOExceptionpublic void testValidCsvHeaders()
throws IOException
IOExceptionpublic void testInvalidCsvHeaders()
throws IOException
IOExceptionpublic void testCsvHeadersCaseInsensitive()
throws IOException
IOExceptionpublic void testWildcard()
throws IOException
IOExceptionpublic void testDataNoNewline()
throws IOException
IOExceptionpublic void testImplicitColsExplicitSelect()
throws IOException
IOExceptionpublic void testImplicitColWildcard()
throws IOException
IOExceptionpublic void testColsWithWildcard()
throws IOException
IOExceptionpublic void testPartitionColsExplicit()
throws IOException
IOExceptionpublic void testDupColumn()
throws IOException
IOExceptionpublic void testRaggedRows()
throws IOException
IOExceptionpublic void testPartitionExpansion()
This test is tricky because it will return two data batches (preceded by an empty schema batch.) File read order is random so we have to expect the files in either order.
V3 puts partition columns after data columns (so that data columns don't shift positions if files are nested to another level.)
public void testWildcardAndPartitionsMultiFiles()
public void doTestExplicitPartitionsMultiFiles()
TestPartitionRace to show that the types and schemas
are consistent even when used across multiple scans.public void testColumnsCol()
throws IOException
IOExceptionpublic void testColumnsIndex()
throws Exception
Exceptionpublic void testColumnsMissing()
throws IOException
IOExceptionpublic void testColumnsIndexMissing()
throws Exception
Exceptionpublic void testHugeColumn()
throws IOException
IOExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.