public class JdbcToArrowConfigBuilder extends Object
JdbcToArrowConfig
s.Constructor and Description |
---|
JdbcToArrowConfigBuilder()
Default constructor for the
JdbcToArrowConfigBuilder} . |
JdbcToArrowConfigBuilder(BufferAllocator allocator,
Calendar calendar)
Constructor for the
JdbcToArrowConfigBuilder . |
JdbcToArrowConfigBuilder(BufferAllocator allocator,
Calendar calendar,
boolean includeMetadata)
Constructor for the
JdbcToArrowConfigBuilder . |
Modifier and Type | Method and Description |
---|---|
JdbcToArrowConfig |
build()
|
JdbcToArrowConfigBuilder |
setAllocator(BufferAllocator allocator)
Sets the memory allocator to use when constructing the Arrow vectors from the ResultSet.
|
JdbcToArrowConfigBuilder |
setArraySubTypeByColumnIndexMap(Map<Integer,JdbcFieldInfo> map)
Sets the mapping of column-index-to-
JdbcFieldInfo used for columns of type Types.ARRAY . |
JdbcToArrowConfigBuilder |
setArraySubTypeByColumnNameMap(Map<String,JdbcFieldInfo> map)
Sets the mapping of column-name-to-
JdbcFieldInfo used for columns of type Types.ARRAY . |
JdbcToArrowConfigBuilder |
setCalendar(Calendar calendar)
Sets the
Calendar to use when constructing timestamp fields in the
Arrow schema, and reading time-based fields from the JDBC ResultSet . |
JdbcToArrowConfigBuilder |
setIncludeMetadata(boolean includeMetadata)
Sets whether to include JDBC ResultSet field metadata in the Arrow Schema field metadata.
|
JdbcToArrowConfigBuilder |
setJdbcToArrowTypeConverter(Function<JdbcFieldInfo,ArrowType> jdbcToArrowTypeConverter) |
JdbcToArrowConfigBuilder |
setReuseVectorSchemaRoot(boolean reuseVectorSchemaRoot) |
JdbcToArrowConfigBuilder |
setTargetBatchSize(int targetBatchSize) |
public JdbcToArrowConfigBuilder()
JdbcToArrowConfigBuilder}
.
Use the setter methods for the allocator and calendar; the allocator must be
set. Otherwise, build()
will throw a NullPointerException
.public JdbcToArrowConfigBuilder(BufferAllocator allocator, Calendar calendar)
JdbcToArrowConfigBuilder
. The
allocator is required, and a NullPointerException
will be thrown if it is null
.
The allocator is used to construct Arrow vectors from the JDBC ResultSet.
The calendar is used to determine the time zone of Timestamp
fields and convert Date
, Time
, and
Timestamp
fields to a single, common time zone when reading
from the result set.
allocator
- The Arrow Vector memory allocator.calendar
- The calendar to use when constructing timestamp fields.public JdbcToArrowConfigBuilder(BufferAllocator allocator, Calendar calendar, boolean includeMetadata)
JdbcToArrowConfigBuilder
. Both the
allocator and calendar are required. A NullPointerException
will be thrown if either of those arguments is null
.
The allocator is used to construct Arrow vectors from the JDBC ResultSet.
The calendar is used to determine the time zone of Timestamp
fields and convert Date
, Time
, and
Timestamp
fields to a single, common time zone when reading
from the result set.
The includeMetadata
argument, if true
will cause
various information about each database field to be added to the Vector
Schema's field metadata.
allocator
- The Arrow Vector memory allocator.calendar
- The calendar to use when constructing timestamp fields.public JdbcToArrowConfigBuilder setAllocator(BufferAllocator allocator)
allocator
- the allocator to set.NullPointerException
- if allocator
is null.public JdbcToArrowConfigBuilder setCalendar(Calendar calendar)
Calendar
to use when constructing timestamp fields in the
Arrow schema, and reading time-based fields from the JDBC ResultSet
.calendar
- the calendar to set.public JdbcToArrowConfigBuilder setIncludeMetadata(boolean includeMetadata)
includeMetadata
- Whether to include or exclude JDBC metadata in the Arrow Schema field metadata.JdbcToArrowConfig
, for chaining.public JdbcToArrowConfigBuilder setArraySubTypeByColumnIndexMap(Map<Integer,JdbcFieldInfo> map)
JdbcFieldInfo
used for columns of type Types.ARRAY
.
The column index is 1-based, to match the JDBC column index.map
- The mapping.JdbcToArrowConfig
, for chaining.public JdbcToArrowConfigBuilder setArraySubTypeByColumnNameMap(Map<String,JdbcFieldInfo> map)
JdbcFieldInfo
used for columns of type Types.ARRAY
.map
- The mapping.JdbcToArrowConfig
, for chaining.public JdbcToArrowConfigBuilder setTargetBatchSize(int targetBatchSize)
public JdbcToArrowConfigBuilder setJdbcToArrowTypeConverter(Function<JdbcFieldInfo,ArrowType> jdbcToArrowTypeConverter)
public JdbcToArrowConfigBuilder setReuseVectorSchemaRoot(boolean reuseVectorSchemaRoot)
public JdbcToArrowConfig build()
JdbcToArrowConfig
NullPointerException
- if either the allocator or calendar was not set.Copyright © 2022 The Apache Software Foundation. All rights reserved.