Class JdbcToArrowConfigBuilder
JdbcToArrowConfigs.- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor for theJdbcToArrowConfigBuilder}.JdbcToArrowConfigBuilder(BufferAllocator allocator, Calendar calendar) Constructor for theJdbcToArrowConfigBuilder.JdbcToArrowConfigBuilder(BufferAllocator allocator, Calendar calendar, boolean includeMetadata) Constructor for theJdbcToArrowConfigBuilder.
- 
Method SummaryModifier and TypeMethodDescriptionbuild()setAllocator(BufferAllocator allocator) Sets the memory allocator to use when constructing the Arrow vectors from the ResultSet.Sets the mapping of column-index-to-JdbcFieldInfoused for columns of typeTypes.ARRAY.Sets the mapping of column-name-to-JdbcFieldInfoused for columns of typeTypes.ARRAY.setBigDecimalRoundingMode(RoundingMode bigDecimalRoundingMode) Set the rounding mode used when the scale of the actual value does not match the declared scale.setCalendar(Calendar calendar) Sets theCalendarto use when constructing timestamp fields in the Arrow schema, and reading time-based fields from the JDBCResultSet.Set metadata from columnIndex->meta map on per field basis.Sets the mapping of column-index-to-JdbcFieldInfoused for column types.Sets the mapping of column-name-to-JdbcFieldInfoused for column types.setIncludeMetadata(boolean includeMetadata) Sets whether to include JDBC ResultSet field metadata in the Arrow Schema field metadata.setJdbcConsumerGetter(JdbcToArrowConfig.JdbcConsumerFactory jdbcConsumerGetter) Set the function used to get a JDBC consumer for a given type.setJdbcToArrowTypeConverter(Function<JdbcFieldInfo, ArrowType> jdbcToArrowTypeConverter) Set the function used to convert JDBC types to Arrow types.setReuseVectorSchemaRoot(boolean reuseVectorSchemaRoot) Set whether to use the sameVectorSchemaRootinstance on each iteration, or to allocate a new one.setSchemaMetadata(Map<String, String> schemaMetadata) Set metadata for schema.setTargetBatchSize(int targetBatchSize) Set the target number of rows to convert at once.
- 
Constructor Details- 
JdbcToArrowConfigBuilderpublic JdbcToArrowConfigBuilder()Default constructor for theJdbcToArrowConfigBuilder}. Use the setter methods for the allocator and calendar; the allocator must be set. Otherwise,build()will throw aNullPointerException.
- 
JdbcToArrowConfigBuilderConstructor for theJdbcToArrowConfigBuilder. The allocator is required, and aNullPointerExceptionwill be thrown if it isnull.The allocator is used to construct Arrow vectors from the JDBC ResultSet. The calendar is used to determine the time zone of Timestampfields and convertDate,Time, andTimestampfields to a single, common time zone when reading from the result set.- Parameters:
- allocator- The Arrow Vector memory allocator.
- calendar- The calendar to use when constructing timestamp fields.
 
- 
JdbcToArrowConfigBuilderpublic JdbcToArrowConfigBuilder(BufferAllocator allocator, Calendar calendar, boolean includeMetadata) Constructor for theJdbcToArrowConfigBuilder. Both the allocator and calendar are required. ANullPointerExceptionwill be thrown if either of those arguments isnull.The allocator is used to construct Arrow vectors from the JDBC ResultSet. The calendar is used to determine the time zone of Timestampfields and convertDate,Time, andTimestampfields to a single, common time zone when reading from the result set.The includeMetadataargument, iftruewill cause various information about each database field to be added to the Vector Schema's field metadata.- Parameters:
- allocator- The Arrow Vector memory allocator.
- calendar- The calendar to use when constructing timestamp fields.
 
 
- 
- 
Method Details- 
setAllocatorSets the memory allocator to use when constructing the Arrow vectors from the ResultSet.- Parameters:
- allocator- the allocator to set.
- Throws:
- NullPointerException- if- allocatoris null.
 
- 
setCalendarSets theCalendarto use when constructing timestamp fields in the Arrow schema, and reading time-based fields from the JDBCResultSet.- Parameters:
- calendar- the calendar to set.
 
- 
setIncludeMetadataSets whether to include JDBC ResultSet field metadata in the Arrow Schema field metadata.- Parameters:
- includeMetadata- Whether to include or exclude JDBC metadata in the Arrow Schema field metadata.
- Returns:
- This instance of the JdbcToArrowConfig, for chaining.
 
- 
setArraySubTypeByColumnIndexMapSets the mapping of column-index-to-JdbcFieldInfoused for columns of typeTypes.ARRAY. The column index is 1-based, to match the JDBC column index.- Parameters:
- map- The mapping.
- Returns:
- This instance of the JdbcToArrowConfig, for chaining.
 
- 
setArraySubTypeByColumnNameMapSets the mapping of column-name-to-JdbcFieldInfoused for columns of typeTypes.ARRAY.- Parameters:
- map- The mapping.
- Returns:
- This instance of the JdbcToArrowConfig, for chaining.
 
- 
setExplicitTypesByColumnIndexSets the mapping of column-index-to-JdbcFieldInfoused for column types.This can be useful to override type information from JDBC drivers that provide incomplete type info, e.g. DECIMAL with precision = scale = 0. The column index is 1-based, to match the JDBC column index. - Parameters:
- map- The mapping.
 
- 
setExplicitTypesByColumnNameSets the mapping of column-name-to-JdbcFieldInfoused for column types.This can be useful to override type information from JDBC drivers that provide incomplete type info, e.g. DECIMAL with precision = scale = 0. - Parameters:
- map- The mapping.
 
- 
setTargetBatchSizeSet the target number of rows to convert at once.Use JdbcToArrowConfig.NO_LIMIT_BATCH_SIZEto read all rows at once.
- 
setJdbcToArrowTypeConverterpublic JdbcToArrowConfigBuilder setJdbcToArrowTypeConverter(Function<JdbcFieldInfo, ArrowType> jdbcToArrowTypeConverter) Set the function used to convert JDBC types to Arrow types.Defaults to wrapping JdbcToArrowUtils.getArrowTypeFromJdbcType(JdbcFieldInfo, Calendar).- See Also:
- 
- JdbcToArrowUtils#reportUnsupportedTypesAsUnknown(Function)
 
 
- 
setJdbcConsumerGetterpublic JdbcToArrowConfigBuilder setJdbcConsumerGetter(JdbcToArrowConfig.JdbcConsumerFactory jdbcConsumerGetter) Set the function used to get a JDBC consumer for a given type.Defaults to wrapping JdbcToArrowUtils#getConsumer(ArrowType, Integer, Boolean, FieldVector, JdbcToArrowConfig).
- 
setReuseVectorSchemaRootSet whether to use the sameVectorSchemaRootinstance on each iteration, or to allocate a new one.
- 
setSchemaMetadataSet metadata for schema.
- 
setColumnMetadataByColumnIndexpublic JdbcToArrowConfigBuilder setColumnMetadataByColumnIndex(Map<Integer, Map<String, String>> columnMetadataByColumnIndex) Set metadata from columnIndex->meta map on per field basis.
- 
setBigDecimalRoundingModeSet the rounding mode used when the scale of the actual value does not match the declared scale.By default, an error is raised in such cases. 
- 
build- Returns:
- The built JdbcToArrowConfig
- Throws:
- NullPointerException- if either the allocator or calendar was not set.
 
 
-