Author: shawkins
Date: 2010-06-21 16:21:08 -0400 (Mon, 21 Jun 2010)
New Revision: 2268
Modified:
branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
branches/7.0.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java
Log:
TEIID-171 ensuring that xmlagg is not pushed down and correcting the validation.
Modified:
branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
===================================================================
---
branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-06-21
20:02:43 UTC (rev 2267)
+++
branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-06-21
20:21:08 UTC (rev 2268)
@@ -171,6 +171,8 @@
if(! caps.supportsCapability(Capability.QUERY_AGGREGATES_MAX)) {
return false;
}
+ } else {
+ return false;
}
// Check DISTINCT if necessary
Modified:
branches/7.0.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java
===================================================================
---
branches/7.0.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java 2010-06-21
20:02:43 UTC (rev 2267)
+++
branches/7.0.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java 2010-06-21
20:21:08 UTC (rev 2268)
@@ -75,8 +75,10 @@
String aggregateFunction = obj.getAggregateFunction();
if((aggregateFunction.equals(NonReserved.SUM) ||
aggregateFunction.equals(NonReserved.AVG)) && obj.getType() == null) {
handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0041, new
Object[] {aggregateFunction, obj}), obj);
- } else if (aggregateFunction.equals(Reserved.XMLAGG) && obj.getType() !=
DataTypeManager.DefaultDataClasses.XML) {
-
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_xml",
new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
+ } else if (obj.getType() != DataTypeManager.DefaultDataClasses.NULL) {
+ if (aggregateFunction.equals(Reserved.XMLAGG) && aggExp.getType() !=
DataTypeManager.DefaultDataClasses.XML) {
+
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_xml",
new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
+ }
}
if((obj.isDistinct() || aggregateFunction.equals(NonReserved.MIN) ||
aggregateFunction.equals(NonReserved.MAX)) &&
DataTypeManager.isNonComparable(DataTypeManager.getDataTypeName(aggExp.getType()))) {
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_comparable",
new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
Show replies by date