Pivot
  1. Pivot
  2. PIVOT-93

Create a pivot.sql.ResultList class

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5
    • Component/s: core-sql
    • Labels:
      None

      Description

      This class will implement List<Map<String, Object>> and will allow callers to wrap JDBC results in a collection that is serializable by JSONSerializer and CSVSerializer.

      We'll need a way to specify the columns and types that should be extracted, possibly via a column name to Class<?> mapping. We should also make the resulting map key configurable.

        Activity

        Hide
        Todd Volkert added a comment -

        Note that java.sql.ResultSet doesn't provide access to the number of results in the set, so this might be tough to achieve. I'g suggesst maybe limiting this ticket to wrapping a javax.sql.RowSet (subinterface of ResultSet), which goves such metadata.

        Show
        Todd Volkert added a comment - Note that java.sql.ResultSet doesn't provide access to the number of results in the set, so this might be tough to achieve. I'g suggesst maybe limiting this ticket to wrapping a javax.sql.RowSet (subinterface of ResultSet), which goves such metadata.
        Hide
        Greg Brown added a comment -

        My JDBC knowledge is a bit dated. Is RowSet considered a more modern replacement for ResultSet? Is it in widespread use? If so, that makes sense.

        Otherwise, we might have to rely on an iterator to enumerate the contents of the result set. This implies that we'd have to update JSONSerializer and CSVSerializer to use the iterator rather than get to walk the list's contents.

        Show
        Greg Brown added a comment - My JDBC knowledge is a bit dated. Is RowSet considered a more modern replacement for ResultSet? Is it in widespread use? If so, that makes sense. Otherwise, we might have to rely on an iterator to enumerate the contents of the result set. This implies that we'd have to update JSONSerializer and CSVSerializer to use the iterator rather than get to walk the list's contents.
        Hide
        Greg Brown added a comment -

        This feature will not be implemented. It is more efficient to implement such logic at the application level.

        Show
        Greg Brown added a comment - This feature will not be implemented. It is more efficient to implement such logic at the application level.
        Hide
        Greg Brown added a comment -

        ResultList will report a length of -1 indicating that it is not a random-access list and must be accessed via an iterator. JSONSerializer and CSVSerializer have already been updated to use iterators instead of indexes when writing data.

        Show
        Greg Brown added a comment - ResultList will report a length of -1 indicating that it is not a random-access list and must be accessed via an iterator. JSONSerializer and CSVSerializer have already been updated to use iterators instead of indexes when writing data.
        Hide
        Sandro Martini added a comment -

        add support also for some common standard SQL types like CHAR, DATE, TIMESTAMP,
        but probably this has no sense on *LOB

        Show
        Sandro Martini added a comment - add support also for some common standard SQL types like CHAR, DATE, TIMESTAMP, but probably this has no sense on *LOB
        Hide
        Greg Brown added a comment -

        I added support for java.util.Date. I did not add support for Character since this type is not natively supported by java.sql.ResultSet.

        Show
        Greg Brown added a comment - I added support for java.util.Date. I did not add support for Character since this type is not natively supported by java.sql.ResultSet.

          People

          • Assignee:
            Greg Brown
            Reporter:
            Greg Brown
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development