[
https://issues.apache.org/jira/browse/GEODE-7240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16951739#comment-16951739
]
ASF subversion and git services commented on GEODE-7240:
--------------------------------------------------------
Commit db9565d0fb603d6ae5e809cf860e2d2289745be8 in geode's branch
refs/heads/develop from Juan José Ramos
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=db9565d ]
GEODE-7240: Prevent Aggregates in query criteria (#4103)
Unless they are used within a nested SELECT query, aggregate functions
should not be allowed as part of the query criteria. The query parser
now throws an exception whenever the required conditions are not met.
- Fixed minor warnings.
- Replaced usages of 'junit.Assert' by 'assertj'.
- Refactored old test classes to use Geode rules.
> Prevent Usage of Aggregates within WHERE clause
> -----------------------------------------------
>
> Key: GEODE-7240
> URL: https://issues.apache.org/jira/browse/GEODE-7240
> Project: Geode
> Issue Type: Bug
> Components: querying
> Reporter: Juan Ramos
> Assignee: Juan Ramos
> Priority: Major
> Labels: GeodeCommons
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> 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:
> {noformat}
> 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)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)