Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-7240

Prevent Usage of Aggregates within WHERE clause

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.11.0
    • querying

    Description

      Aggregate functions shouldn't be allowed as part of the WHERE clause.
      Currently, instead of rejecting the query, we throw a ClassCastException while trying to evaluate the condition:

      org.apache.geode.cache.query.TypeMismatchException: Unable to use a relational comparison operator to compare an instance of class ' org.apache.geode.cache.query.internal.aggregate.XXX ' with an instance of ' java.lang.XXX '
      	at org.apache.geode.cache.query.internal.types.TypeUtils$ComparisonStrategy.get(TypeUtils.java:144)
      	at org.apache.geode.cache.query.internal.types.TypeUtils.compare(TypeUtils.java:499)
      	at org.apache.geode.cache.query.internal.CompiledComparison.evaluate(CompiledComparison.java:137)
      	at org.apache.geode.cache.query.internal.CompiledSelect.evaluate(CompiledSelect.java:438)
      	at org.apache.geode.cache.query.internal.CompiledSelect.evaluate(CompiledSelect.java:53)
      	at org.apache.geode.cache.query.internal.DefaultQuery.executeUsingContext(DefaultQuery.java:432)
      	at org.apache.geode.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:267)
      	at org.apache.geode.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:199)
      

      Attachments

        Issue Links

          Activity

            People

              jjramos Juan Ramos
              jjramos Juan Ramos
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m