public class JDBCStream extends TupleStream implements Expressible
ResultSetMetaData.getColumnClassName(int)
.
The exception are Types.DATE
, Types.TIME
or Types.TIMESTAMP
which are determined by the JDBC type.
Java or JDBC Type | Tuple Type | Notes |
---|---|---|
Boolean | Boolean | |
String | String | |
Short, Integer, Long | Long | |
Float, Double | Double | |
Clob and subclasses |
String | Clobs up to length 231-1 are supported. |
Other subclasses of Number |
Long, Double | Tuple Type based on BigDecimal.scale() . |
JDBC Types.DATE |
String | yyyy-MM-dd, calls Date.toString() |
JDBC Types.TIME |
String | hh:mm:ss, calls Time.toString() |
JDBC Types.TIMESTAMP |
String | See DateTimeFormatter.ISO_INSTANT |
Modifier and Type | Class and Description |
---|---|
static interface |
JDBCStream.ResultSetValueSelector |
TupleStream.IgnoreException
MapWriter.EntryWriter
Modifier and Type | Field and Description |
---|---|
protected ResultSet |
resultSet |
protected String |
sep |
protected StreamContext |
streamContext |
Constructor and Description |
---|
JDBCStream(StreamExpression expression,
StreamFactory factory) |
JDBCStream(String connectionUrl,
String sqlQuery,
StreamComparator definedSort) |
JDBCStream(String connectionUrl,
String sqlQuery,
StreamComparator definedSort,
Properties connectionProperties,
String driverClassName) |
Modifier and Type | Method and Description |
---|---|
List<TupleStream> |
children() |
void |
close()
Closes the JDBCStream
|
protected JDBCStream.ResultSetValueSelector |
determineValueSelector(int columnIdx,
ResultSetMetaData metadata) |
StreamComparator |
getStreamSort() |
void |
open()
Opens the JDBCStream
|
Tuple |
read() |
void |
setStreamContext(StreamContext context) |
Explanation |
toExplanation(StreamFactory factory)
Returns an explanation about the stream object
|
StreamExpressionParameter |
toExpression(StreamFactory factory) |
getCost, getShards, getShards, getStreamNodeId, writeMap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
protected ResultSet resultSet
protected transient StreamContext streamContext
protected String sep
public JDBCStream(String connectionUrl, String sqlQuery, StreamComparator definedSort) throws IOException
IOException
public JDBCStream(String connectionUrl, String sqlQuery, StreamComparator definedSort, Properties connectionProperties, String driverClassName) throws IOException
IOException
public JDBCStream(StreamExpression expression, StreamFactory factory) throws IOException
IOException
public void setStreamContext(StreamContext context)
setStreamContext
in class TupleStream
public void open() throws IOException
open
in class TupleStream
IOException
protected JDBCStream.ResultSetValueSelector determineValueSelector(int columnIdx, ResultSetMetaData metadata) throws SQLException
SQLException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class TupleStream
IOException
public Tuple read() throws IOException
read
in class TupleStream
IOException
public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException
toExpression
in interface Expressible
IOException
public Explanation toExplanation(StreamFactory factory) throws IOException
Expressible
toExplanation
in interface Expressible
toExplanation
in class TupleStream
factory
- Stream factory for this, contains information about the function nameIOException
- throw on any errorpublic List<TupleStream> children()
children
in class TupleStream
public StreamComparator getStreamSort()
getStreamSort
in class TupleStream
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.