Package com.ocient.cli.extract

# Class ResultSetExtractor

java.lang.Object
com.ocient.cli.extract.ResultSetExtractor

All Implemented Interfaces:
  `RowTransformerFactory`

Direct Known Subclasses:
  `WriteThroughResultSetExtractor`

public abstract class ResultSetExtractor extends Object implements RowTransformerFactory

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`ResultSetExtractor.ExtractTransformer`
Implementation of `RowTransformer` that sanitizes the column values, then formats the row data into a flattened, string-based representation (e.g., CSV, TSV).

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final ExtractConfiguration`
`extractConfig`
`protected final ArrayList<String>`
`headers`
`protected final RecordExtractorFactory`
`recordExtractorFactory`

## Method Summary

Modifier and Type
Method
Description
`RowTransformer`
`acquire()`
Acquires and returns a `RowTransformer` instance.
`abstract void`
`extract(ResultSet resultSet, ResultSetMetaData resultSetMetaData)`
`protected void`
`parseHeader(ResultSetMetaData resultSetMetaData)`
`void`
`release(RowTransformer transformer)`
Releases a `RowTransformer` instance back to the factory.
`protected void`
`sanitizeValues(List<Object> row, ExtractConfiguration config)`
`protected RecordExtractorFactory.WriterHandle`
`startNewWriter(int fileIndex)`
`protected static String`
`unpack(Row row)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### recordExtractorFactory

protected final RecordExtractorFactory recordExtractorFactory

### extractConfig

protected final ExtractConfiguration extractConfig

### headers

protected final ArrayList<String> headers

## Method Details

### extract

public abstract void extract(ResultSet resultSet, ResultSetMetaData resultSetMetaData) throws IllegalStateException, IOException, SQLException

Throws:
  `IllegalStateException`
  `IOException`
  `SQLException`

### startNewWriter

protected RecordExtractorFactory.WriterHandle startNewWriter(int fileIndex) throws IOException

Throws:
  `IOException`

### sanitizeValues

protected void sanitizeValues(List<Object> row, ExtractConfiguration config)

### parseHeader

protected void parseHeader(ResultSetMetaData resultSetMetaData) throws SQLException

Throws:
  `SQLException`

### acquire

public RowTransformer acquire()
Description copied from interface: `RowTransformerFactory`
Acquires and returns a `RowTransformer` instance.

Specified by:
  `acquire` in interface `RowTransformerFactory`

### release

public void release(RowTransformer transformer)
Description copied from interface: `RowTransformerFactory`
Releases a `RowTransformer` instance back to the factory. This method should be called when the transformer is no longer needed.

Specified by:
  `release` in interface `RowTransformerFactory`
Parameters:
  `transformer` - The non-null `RowTransformer` instance, previously obtained from this factory.

### unpack

protected static String unpack(Row row)