commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Foxman <a...@thefoxmans.net>
Subject [csv] streaming proposal
Date Mon, 29 Jul 2013 04:35:32 GMT
Hi all,

Have you considered building a stream-based version of CSVPrinter's
printRecords(ResultSet ...)?

ResultSet is unique in that it is not fully materialized, or may not be.
 Users reading tabular database results may want to stream them on to
another process in a larger ETL pipeline, and having a "csv transform"
would be nice.

I'd like to build this if the development team is interested.  I'm thinking
this is a separate class which implements InputStream and accepts a
ResultSet and other params (like charset) in its ctor.  As bytes are read,
rows are read from the ResultSet and transformed into CSV lines.

There are variations on this, such as exposing a character-based stream
instead of a byte stream, or exposing a line-based stream of records.

The fundamental difference of this work is that it is centered around
pulling data, rather than having the caller drive the operation using
CSVPrinter with an Appendable.

Adam

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message