Class DefaultAvroSqlWriter
java.lang.Object
org.apache.nifi.processors.standard.sql.DefaultAvroSqlWriter
- All Implemented Interfaces:
SqlWriter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a map of attribute key/value pairs to be added to any outgoing flow file(s).Returns the MIME type of the output format.voidwriteEmptyResultSet(OutputStream outputStream, org.apache.nifi.logging.ComponentLog logger) Writes an empty result set to the output stream.longwriteResultSet(ResultSet resultSet, OutputStream outputStream, org.apache.nifi.logging.ComponentLog logger, JdbcCommon.ResultSetRowCallback callback) Writes the given result set out to the given output stream, possibly applying a callback as each row is processed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.nifi.processors.standard.sql.SqlWriter
updateCounters
-
Field Details
-
options
-
attributesToAdd
-
-
Constructor Details
-
DefaultAvroSqlWriter
-
-
Method Details
-
writeResultSet
public long writeResultSet(ResultSet resultSet, OutputStream outputStream, org.apache.nifi.logging.ComponentLog logger, JdbcCommon.ResultSetRowCallback callback) throws Exception Description copied from interface:SqlWriterWrites the given result set out to the given output stream, possibly applying a callback as each row is processed.- Specified by:
writeResultSetin interfaceSqlWriter- Parameters:
resultSet- the ResultSet to be writtenoutputStream- the OutputStream to write the result set tologger- a common logger that can be used to log messages during writecallback- a MaxValueResultSetRowCollector that may be called as each row in the ResultSet is processed- Returns:
- the number of rows written to the output stream
- Throws:
Exception- if any errors occur during the writing of the result set to the output stream
-
getAttributesToAdd
Description copied from interface:SqlWriterReturns a map of attribute key/value pairs to be added to any outgoing flow file(s). The default implementation is to return an empty map.- Specified by:
getAttributesToAddin interfaceSqlWriter- Returns:
- a map of attribute key/value pairs
-
writeEmptyResultSet
public void writeEmptyResultSet(OutputStream outputStream, org.apache.nifi.logging.ComponentLog logger) throws IOException Description copied from interface:SqlWriterWrites an empty result set to the output stream. In some cases a ResultSet might not have any viable rows, but will throw an error or behave unexpectedly if rows are attempted to be retrieved. This method indicates the implementation should write whatever output is appropriate for a result set with no rows.- Specified by:
writeEmptyResultSetin interfaceSqlWriter- Parameters:
outputStream- the OutputStream to write the empty result set tologger- a common logger that can be used to log messages during write- Throws:
IOException- if any errors occur during the writing of an empty result set to the output stream
-
getMimeType
Description copied from interface:SqlWriterReturns the MIME type of the output format. This can be used in FlowFile attributes or to perform format-specific processing as necessary.- Specified by:
getMimeTypein interfaceSqlWriter- Returns:
- the MIME type string of the output format.
-