GeoTools
  1. GeoTools
  2. GEOT-3210

Add direct support for unique visitor in jdbc stores

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.7-RC1
    • Fix Version/s: 2.7-RC2
    • Component/s: jdbc
    • Labels:
      None

      Description

      We have direct support for aggregate visitors only for count, min, max, sum (that's what SQLDialect.registerAggregateFunctions registers), leaving out some other well supported examples out: avg, stddev, unique

      We also have a "bounds" visitor that we can bind pretty easily (useful if one has more than one geometry column and needs the bounds of a specific one)

        Activity

        Hide
        Andrea Aime added a comment -
        The attached patch adds support for unique and in the process for any other eventual aggregate function that has multivalued return. Works for me on H2, PostGIS and Oracle.

        Ok to commit?
        Show
        Andrea Aime added a comment - The attached patch adds support for unique and in the process for any other eventual aggregate function that has multivalued return. Works for me on H2, PostGIS and Oracle. Ok to commit?
        Hide
        Justin Deoliveira added a comment -
        +1, looks good.
        Show
        Justin Deoliveira added a comment - +1, looks good.
        Hide
        Andrea Aime added a comment -
        Patch committed on 2.7.x and trunk.
        "unique" is kind of minimum common denominator functionality so I don't expect problems from the db2 side, however if there are any I'm ready to rework the patch
        Show
        Andrea Aime added a comment - Patch committed on 2.7.x and trunk. "unique" is kind of minimum common denominator functionality so I don't expect problems from the db2 side, however if there are any I'm ready to rework the patch
        Hide
        Christian Mueller added a comment -
        In method

             public void testUniqueWithLimitOffset() throws Exception {

        I had to add
                
               if (!dataStore.getSQLDialect().isLimitOffsetSupported()) {
                   return;
               }

        The same if statement is in all other test functions like test*WithLimitOffset

        I already commit the change, nothing to do further, DB2 test are ok

        Show
        Christian Mueller added a comment - In method      public void testUniqueWithLimitOffset() throws Exception { I had to add                 if (!dataStore.getSQLDialect().isLimitOffsetSupported()) {            return;        } The same if statement is in all other test functions like test*WithLimitOffset I already commit the change, nothing to do further, DB2 test are ok
        Hide
        Andrea Aime added a comment -
        Thanks Christian, and sorry for missing that check
        Show
        Andrea Aime added a comment - Thanks Christian, and sorry for missing that check
        Hide
        Andrea Aime added a comment -
        Mass closing all issues that have been in "resolved" state for more than one month without further comments
        Show
        Andrea Aime added a comment - Mass closing all issues that have been in "resolved" state for more than one month without further comments

          People

          • Assignee:
            Andrea Aime
            Reporter:
            Andrea Aime
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: