public class TestDirectConverter extends SubOperatorTest
DrillTest.MemWatcherdirTestWatcher, fixturelogOutcome, objectMapper, REPEAT_RULE, thrownException, TIMEOUT| Constructor and Description |
|---|
TestDirectConverter() |
| Modifier and Type | Method and Description |
|---|---|
static BigDecimal |
dec(int value) |
void |
testBasicConversionType()
Test the conversion type for a subset of type pairs.
|
void |
testBlankOptions()
Test the properties for how to handle blanks on string-to-number
conversions.
|
void |
testBooleanToFromString()
Test conversion to/from Java-style Booleans.
|
void |
testDateTimeToString() |
void |
testDecimalFromString() |
void |
testDecimalOverflow() |
void |
testImplicitConversion()
Tests the implicit conversions provided by the column writer itself.
|
void |
testImplicitConversionDoubleClamp()
Implicit conversion from double (or float) follows the Java Math.round
rules: round to the closest long value.
|
void |
testImplicitConversionIntOverflow()
Overflow from double-to-int is detected.
|
void |
testImplicitConversionIntTruncation()
The column accessors provide only int setters.
|
void |
testIntervalToString() |
void |
testNumberToStringConversion()
Test the standard string-to-type conversion using an ad-hoc conversion
from the input type (the type used by the row set builder) to the output
(vector) type.
|
void |
testSchemaMerge() |
void |
testSpecialConversionType()
Test the specialized types: conversation to/from string.
|
void |
testStringToDateTimeCustom() |
void |
testStringToDateTimeDefault()
Test VARCHAR to DATE, TIME and TIMESTAMP conversion
using default ISO formats.
|
void |
testStringToInterval()
Implicit conversion from String to period using default ISO
format.
|
void |
testStringToNumberConversion()
Test the standard string-to-type conversion using an ad-hoc conversion
from the input type (the type used by the row set builder) to the output
(vector) type.
|
void |
testStringToNumberConversionError() |
classSetup, classTeardownescapeJsonString, finishDrillTest, initDrillTestpublic void testSchemaMerge()
public void testStringToNumberConversion()
public void testNumberToStringConversion()
public void testStringToNumberConversionError()
public static BigDecimal dec(int value)
public void testImplicitConversion()
public void testImplicitConversionIntTruncation()
The assumption is, if the reader or other code expects that overflow might occur, that code should be implemented in the client (or in a type conversion shim), leaving the normal code path to optimize for the 99% of the cases where the value is in the proper range.
public void testImplicitConversionIntOverflow()
public void testImplicitConversionDoubleClamp()
public void testStringToInterval()
public void testIntervalToString()
public void testStringToDateTimeDefault()
public void testStringToDateTimeCustom()
public void testDateTimeToString()
public void testBooleanToFromString()
public void testDecimalFromString()
public void testDecimalOverflow()
public void testBasicConversionType()
public void testSpecialConversionType()
public void testBlankOptions()
Copyright © 2021 The Apache Software Foundation. All rights reserved.