public final class JdbcToArrowConfig extends Object
The allocator is used to construct the VectorSchemaRoot,
and the calendar is used to define the time zone of any
ArrowType.Timestamp
fields that are created during the conversion. Neither field may be null.
If the includeMetadata flag is set, the Arrow field metadata will contain information
from the corresponding ResultSetMetaData that was used to create the
FieldType of the corresponding
FieldVector.
If there are any Types.ARRAY fields in the ResultSet, the corresponding
JdbcFieldInfo for the array's contents must be defined here. Unfortunately, the sub-type
information cannot be retrieved from all JDBC implementations (H2 for example, returns
Types.NULL for the array sub-type), so it must be configured here. The column index
or name can be used to map to a JdbcFieldInfo, and that will be used for the conversion.
| Modifier and Type | Class and Description |
|---|---|
static interface |
JdbcToArrowConfig.JdbcConsumerFactory
Interface for a function that gets a JDBC consumer for the given values.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_TARGET_BATCH_SIZE |
static int |
NO_LIMIT_BATCH_SIZE |
| Modifier and Type | Method and Description |
|---|---|
BufferAllocator |
getAllocator()
The Arrow memory allocator.
|
JdbcFieldInfo |
getArraySubTypeByColumnIndex(int index)
Returns the array sub-type
JdbcFieldInfo defined for the provided column index. |
JdbcFieldInfo |
getArraySubTypeByColumnName(String name)
Returns the array sub-type
JdbcFieldInfo defined for the provided column name. |
RoundingMode |
getBigDecimalRoundingMode() |
Calendar |
getCalendar()
|
Map<Integer,Map<String,String>> |
getColumnMetadataByColumnIndex()
Return metadata from columnIndex->meta map on per field basis
or null if not provided.
|
JdbcFieldInfo |
getExplicitTypeByColumnIndex(int index)
Returns the type
JdbcFieldInfo explicitly defined for the provided column index. |
JdbcFieldInfo |
getExplicitTypeByColumnName(String name)
Returns the type
JdbcFieldInfo explicitly defined for the provided column name. |
JdbcToArrowConfig.JdbcConsumerFactory |
getJdbcConsumerGetter()
Gets the JDBC consumer getter.
|
Function<JdbcFieldInfo,ArrowType> |
getJdbcToArrowTypeConverter()
Gets the mapping between JDBC type information to Arrow type.
|
Map<String,String> |
getSchemaMetadata()
Return schema level metadata or null if not provided.
|
int |
getTargetBatchSize()
Get the target batch size for partial read.
|
boolean |
isReuseVectorSchemaRoot()
Get whether it is allowed to reuse the vector schema root.
|
boolean |
shouldIncludeMetadata()
Whether to include JDBC ResultSet field metadata in the Arrow Schema field metadata.
|
public static final int DEFAULT_TARGET_BATCH_SIZE
public static final int NO_LIMIT_BATCH_SIZE
public Calendar getCalendar()
Date, Time, or Timestamp
data types from the ResultSet, or null if not converting.public BufferAllocator getAllocator()
public boolean shouldIncludeMetadata()
true to include field metadata, false to exclude it.public int getTargetBatchSize()
public boolean isReuseVectorSchemaRoot()
public Function<JdbcFieldInfo,ArrowType> getJdbcToArrowTypeConverter()
public JdbcToArrowConfig.JdbcConsumerFactory getJdbcConsumerGetter()
public JdbcFieldInfo getArraySubTypeByColumnIndex(int index)
JdbcFieldInfo defined for the provided column index.index - The ResultSetMetaData column index of an Types.ARRAY type.JdbcFieldInfo for that array's sub-type, or null if not defined.public JdbcFieldInfo getArraySubTypeByColumnName(String name)
JdbcFieldInfo defined for the provided column name.name - The ResultSetMetaData column name of an Types.ARRAY type.JdbcFieldInfo for that array's sub-type, or null if not defined.public JdbcFieldInfo getExplicitTypeByColumnIndex(int index)
JdbcFieldInfo explicitly defined for the provided column index.index - The ResultSetMetaData column index to evaluate for explicit type mapping.JdbcFieldInfo defined for the column, or null if not defined.public JdbcFieldInfo getExplicitTypeByColumnName(String name)
JdbcFieldInfo explicitly defined for the provided column name.name - The ResultSetMetaData column name to evaluate for explicit type mapping.JdbcFieldInfo defined for the column, or null if not defined.public Map<String,String> getSchemaMetadata()
public Map<Integer,Map<String,String>> getColumnMetadataByColumnIndex()
public RoundingMode getBigDecimalRoundingMode()
Copyright © 2024 The Apache Software Foundation. All rights reserved.