Vertica documentation is moving! Use our new documentation site at https://docs.rocketsoftware.com/bundle/vertica_24.2/page/index.html

com.vertica.sdk.NoopTypeCoercion Class Reference

Inheritance diagram for com.vertica.sdk.NoopTypeCoercion:

Collaboration diagram for com.vertica.sdk.NoopTypeCoercion:

Public Member Functions
ByteBuffer asBinaryBytes (Object value, int length, VerticaType type)
Boolean asBoolean (Object value, VerticaType type)
ByteBuffer asCharBytes (Object value, int length, VerticaType type)
java.sql.Date asDate (Object value, VerticaType type)
Double asDouble (Object value, VerticaType type)
Long asLong (Object value, VerticaType type)
java.sql.Timestamp asTimestamp (Object value, VerticaType type)
Iterator< Object > getListIterator (Object value)
Iterator< Map.Entry< String, Object > > getMapIterator (Object value)
MetaType getMetaType (Object value)
Set< TypeCoercionPolicy > getPolicy ()
void setPolicy (Collection< TypeCoercionPolicy > policy)
Protected Member Functions
Collection< TypeCoercionPolicy > getDefaultPolicy ()
void invalidInputType (Object value, VerticaType type)
void unsupportedType (Object value, VerticaType type)
void valueTooLarge (Object value, VerticaType type)

Detailed Description

NoopTypeCoercion implements no type conversions, but passes already-valid types to the destination. Values may be truncated if the policy includes TRUNCATE_VALUES.

The default policy favors errors and avoids modifying data. See getDefaultPolicy().

Member Function Documentation

◆asBinaryBytes()

ByteBuffer com.vertica.sdk.NoopTypeCoercion.asBinaryBytes(Object value, int length, VerticaType type)

Generates a ByteBuffer (or null) value out of a sequence of bytes. Acceptable input types are byte array and ByteBuffer. All other types are invalid and will result in null or a TypeCoercionException according to the policy.

In agreement with how 'binary' values are stored in Vertica, values smaller than the target length are right-extended to length with the zero byte.

The value will be truncated to length when necessary if TRUNCATE_VALUES is specified in the policy. Otherwise values that are too long are treated as invalid input values (see FAIL_INVALID_INPUT_VALUE).

See also

VerticaType::isBinary()

Implements com.vertica.sdk.TypeCoercion.

◆asBoolean()

Boolean com.vertica.sdk.NoopTypeCoercion.asBoolean(Object value, VerticaType type)

Generates a Boolean (or null) value out of null objects or Boolean type objects. All other types are invalid and will result in null or a TypeCoercionException according to the policy.

Implements com.vertica.sdk.TypeCoercion.

◆asCharBytes()

ByteBuffer com.vertica.sdk.NoopTypeCoercion.asCharBytes(Object value, int length, VerticaType type)

Generates a ByteBuffer (or null) value out of null objects or String type objects. All other types are invalid and will result in null or a TypeCoercionException according to the policy.

The bytes will not include trailing spaces if the type is 'char'.

The value will be truncated to length when necessary if TRUNCATE_VALUES is specified in the policy. Otherwise values that are too long are treated as invalid input values (see FAIL_INVALID_INPUT_VALUE).

See also

VerticaType::isChar()

Implements com.vertica.sdk.TypeCoercion.

◆asDate()

java.sql.Date com.vertica.sdk.NoopTypeCoercion.asDate(Object value, VerticaType type)

Generate a java.sql.Date (or null) value out of values that are either null, java.sql.Date, or java.util.Date (which includes java.sql.Timestamp and java.sql.Time types).

Note that this is an exception to the general principle of NoopTypeCoercion: some coercion may actually take place here. This is because java.util.Date is so closely related to the java.sql.Date type and much more prevalent.

Implements com.vertica.sdk.TypeCoercion.

◆asDouble()

Double com.vertica.sdk.NoopTypeCoercion.asDouble(Object value, VerticaType type)

Generates a Double (or null) value out of null objects or Double type objects. All other types are invalid and will result in null or a TypeCoercionException according to the policy.

Implements com.vertica.sdk.TypeCoercion.

◆asLong()

Long com.vertica.sdk.NoopTypeCoercion.asLong(Object value, VerticaType type)

Generates a Long (or null) value out of null objects or Long type objects. All other types are invalid and will result in null or a TypeCoercionException according to the policy.

Implements com.vertica.sdk.TypeCoercion.

◆asTimestamp()

java.sql.Timestamp com.vertica.sdk.NoopTypeCoercion.asTimestamp(Object value, VerticaType type)

Generate a java.sql.Timestamp (or null) value out of values that are either null, java.sql.Timestamp, or java.util.Date (which includes java.sql.Date and java.sql.Time types).

Note that this is an exception to the general principle of NoopTypeCoercion; some coercion may actually take place here. This is because java.util.Date is so closely related to the java.sql.Timestamp type and much more prevalent.

Implements com.vertica.sdk.TypeCoercion.

◆getDefaultPolicy()

Collection<TypeCoercionPolicy> com.vertica.sdk.NoopTypeCoercion.getDefaultPolicy()

protected

Provides the default policy installed by the constructor.

For NoopTypeCoercion, the default policy favors errors and avoids modifying data:

  • FAIL_SDK_UNSUPPORTED_TYPE

  • FAIL_UNSUPPORTED_TYPE

  • FAIL_INVALID_INPUT_TYPE

  • FAIL_INVALID_INPUT_VALUE

◆getListIterator()

Iterator<Object> com.vertica.sdk.NoopTypeCoercion.getListIterator(Object value)

Provides an Iterator over Objects for a given Iterable input.

Parameters