Class SQLDataSource<T extends Output<T>>
java.lang.Object
org.tribuo.data.columnar.ColumnarDataSource<T>
org.tribuo.data.sql.SQLDataSource<T>
- All Implemented Interfaces:
- com.oracle.labs.mlrg.olcut.config.Configurable,- com.oracle.labs.mlrg.olcut.provenance.Provenancable<DataSourceProvenance>,- AutoCloseable,- Iterable<Example<T>>,- ConfigurableDataSource<T>,- DataSource<T>
public class SQLDataSource<T extends Output<T>>
extends ColumnarDataSource<T>
implements AutoCloseable
A 
DataSource for loading columnar data from a database
 and applying FieldProcessors to it.
 The Connections it creates are closed when the iterator is empty
 (ie. when hasNext is called and returns false). Calling close() on SQLDatasource itself closes all connections
 created since close was last called.
 N.B. This class accepts raw SQL strings and executes them directly via JDBC. It DOES NOT perform any SQL escaping or other injection prevention. It is the user's responsibility to ensure that SQL passed to this class performs as desired.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields inherited from class org.tribuo.data.columnar.ColumnarDataSourceoutputRequired, rowProcessor
- 
Constructor SummaryConstructorsConstructorDescriptionSQLDataSource(String sqlString, SQLDBConfig sqlConfig, OutputFactory<T> outputFactory, RowProcessor<T> rowProcessor, boolean outputRequired) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()The iterator that emitsColumnarIterator.Rowobjects from the underlying data source.toString()Methods inherited from class org.tribuo.data.columnar.ColumnarDataSourcegetMetadataTypes, getOutputFactory, iteratorMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.labs.mlrg.olcut.config.ConfigurablepostConfigMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
SQLDataSourcepublic SQLDataSource(String sqlString, SQLDBConfig sqlConfig, OutputFactory<T> outputFactory, RowProcessor<T> rowProcessor, boolean outputRequired) throws SQLException - Throws:
- SQLException
 
 
- 
- 
Method Details- 
toString
- 
rowIteratorDescription copied from class:ColumnarDataSourceThe iterator that emitsColumnarIterator.Rowobjects from the underlying data source.- Specified by:
- rowIteratorin class- ColumnarDataSource<T extends Output<T>>
- Returns:
- The row level iterator.
 
- 
close- Specified by:
- closein interface- AutoCloseable
 
- 
getProvenance
 
-