teiid SVN: r2280 - in trunk/engine/src: test/java/org/teiid/query/optimizer and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-22 15:56:42 -0400 (Tue, 22 Jun 2010)
New Revision: 2280
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinOptimization.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java
Log:
TEIID-1107 adding the ability to raise criteria if it's been pushed too far.
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2010-06-22 19:24:56 UTC (rev 2279)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2010-06-22 19:56:42 UTC (rev 2280)
@@ -164,10 +164,66 @@
return performRaise(rootNode, accessNode, parentNode);
case NodeConstants.Types.SELECT:
{
- if (!parentNode.hasBooleanProperty(NodeConstants.Info.IS_DEPENDENT_SET) && canRaiseOverSelect(accessNode, metadata, capFinder, parentNode)) {
+ if (parentNode.hasBooleanProperty(NodeConstants.Info.IS_DEPENDENT_SET)) {
+ return null;
+ }
+ if (canRaiseOverSelect(accessNode, metadata, capFinder, parentNode)) {
RulePushSelectCriteria.satisfyAccessPatterns(parentNode, accessNode);
return performRaise(rootNode, accessNode, parentNode);
- }
+ }
+ //determine if we should push the select back up
+ if (parentNode.getParent() == null) {
+ return null;
+ }
+ PlanNode selectRoot = parentNode;
+ while (selectRoot.getParent() != null && selectRoot.getParent().getType() == NodeConstants.Types.SELECT) {
+ selectRoot = selectRoot.getParent();
+ }
+ if (selectRoot.getParent() == null || selectRoot.getParent().getType() == NodeConstants.Types.PROJECT) {
+ return null;
+ }
+ PlanNode grandParent = selectRoot.getParent();
+ boolean isLeft = false;
+ isLeft = grandParent.getFirstChild() == selectRoot;
+ if (grandParent.getType() == NodeConstants.Types.JOIN) {
+ JoinType jt = (JoinType)grandParent.getProperty(NodeConstants.Info.JOIN_TYPE);
+ if (jt == JoinType.JOIN_FULL_OUTER || (jt == JoinType.JOIN_LEFT_OUTER && !isLeft)) {
+ return null;
+ }
+ }
+ grandParent.removeChild(selectRoot);
+ if (isLeft) {
+ grandParent.addFirstChild(accessNode);
+ } else {
+ grandParent.addLastChild(accessNode);
+ }
+ PlanNode newParent = grandParent.getParent();
+ //TODO: use costing or heuristics instead of always raising
+ PlanNode newRoot = raiseAccessNode(rootNode, accessNode, metadata, capFinder, afterJoinPlanning);
+ if (newRoot == null) {
+ //return the tree to its original state
+ parentNode.addFirstChild(accessNode);
+ if (isLeft) {
+ grandParent.addFirstChild(selectRoot);
+ } else {
+ grandParent.addLastChild(selectRoot);
+ }
+ } else {
+ //attach the select nodes above the access node
+ accessNode = grandParent.getParent();
+ if (newParent != null) {
+ isLeft = newParent.getFirstChild() == accessNode;
+ if (isLeft) {
+ newParent.addFirstChild(selectRoot);
+ } else {
+ newParent.addLastChild(selectRoot);
+ }
+ } else {
+ newRoot = selectRoot;
+ }
+ parentNode.addFirstChild(accessNode);
+ return newRoot;
+ }
return null;
}
case NodeConstants.Types.SOURCE:
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinOptimization.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinOptimization.java 2010-06-22 19:24:56 UTC (rev 2279)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinOptimization.java 2010-06-22 19:56:42 UTC (rev 2280)
@@ -922,5 +922,84 @@
0 // UnionAll
});
}
+
+
+ /**
+ * Test for Case 836073:
+ */
+ @Test public void testForCase836073_1() {
+ String sql = "select bqt1.smalla.intkey, bqt1.smallb.intkey from bqt1.smalla, bqt1.smallb WHERE formatdate(bqt1.smalla.DateValue,'yyyyMM') = '200309' AND bqt1.smalla.intkey = bqt1.smallb.intkey"; //$NON-NLS-1$
+
+ // Plan query
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), new String[] {"SELECT bqt1.smalla.DateValue, bqt1.smalla.intkey, bqt1.smallb.intkey FROM bqt1.smalla, bqt1.smallb WHERE bqt1.smalla.intkey = bqt1.smallb.intkey"}); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 1, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // Join
+ 0, // MergeJoin
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 1, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+ }
+
+ @Test public void testForCase836073_2() {
+ String sql = "select bqt1.smalla.intkey, bqt1.smallb.intkey from bqt1.smalla left outer join bqt1.smallb on bqt1.smalla.intkey = bqt1.smallb.intkey WHERE formatdate(bqt1.smalla.DateValue,'yyyyMM') = '200309'"; //$NON-NLS-1$
+ // Plan query
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), new String[] {"SELECT bqt1.smalla.DateValue, bqt1.smalla.intkey, bqt1.smallb.intkey FROM bqt1.smalla LEFT OUTER JOIN bqt1.smallb ON bqt1.smalla.intkey = bqt1.smallb.intkey"}); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 1, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // Join
+ 0, // MergeJoin
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 1, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+ }
+
+ /**
+ * Note that we don't allow pushdown here because the criteria placement matters
+ */
+ @Test public void testForCase836073_3() {
+ String sql = "select bqt1.smalla.intkey, b.intkey from bqt1.smalla left outer join (select * from bqt1.smallb where formatdate(bqt1.smallb.DateValue,'yyyyMM') = '200309') b on bqt1.smalla.intkey = b.intkey"; //$NON-NLS-1$
+
+ // Plan query
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), new String[] {"SELECT g_0.intkey AS c_0 FROM bqt1.smalla AS g_0 ORDER BY c_0", "SELECT g_0.DateValue AS c_0, g_0.IntKey AS c_1 FROM bqt1.smallb AS g_0 ORDER BY c_1"}); //$NON-NLS-1$ //$NON-NLS-2$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 2, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // Join
+ 1, // MergeJoin
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 1, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+ }
+
}
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java 2010-06-22 19:24:56 UTC (rev 2279)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java 2010-06-22 19:56:42 UTC (rev 2280)
@@ -4386,17 +4386,17 @@
"SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE (BQT1.SmallA.IntKey = lookup('BQT1.SmallB', 'IntKey', 'StringKey', BQT1.SmallB.StringKey)) AND (BQT1.SmallA.IntKey = 1)", //$NON-NLS-1$
metadata,
null, capFinder,
- new String[] {"SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA WHERE BQT1.SmallA.IntKey = 1", "SELECT BQT1.SmallB.StringKey FROM BQT1.SmallB"}, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] {"SELECT g_1.StringKey, g_0.IntKey FROM BQT1.SmallA AS g_0, BQT1.SmallB AS g_1 WHERE g_0.IntKey = 1"}, //$NON-NLS-1$ //$NON-NLS-2$
SHOULD_SUCCEED );
checkNodeTypes(plan, new int[] {
- 2, // Access
+ 1, // Access
0, // DependentAccess
0, // DependentSelect
0, // DependentProject
0, // DupRemove
0, // Grouping
- 1, // NestedLoopJoinStrategy
+ 0, // NestedLoopJoinStrategy
0, // MergeJoinStrategy
0, // Null
0, // PlanExecution
14 years, 6 months
teiid SVN: r2279 - in branches/7.0.x/documentation/admin-guide/src/main/docbook/en-US: content and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-22 15:24:56 -0400 (Tue, 22 Jun 2010)
New Revision: 2279
Added:
branches/7.0.x/documentation/admin-guide/src/main/docbook/en-US/content/appendix-c.xml
Modified:
branches/7.0.x/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml
Log:
TEIID-1016 adding an appending about system properties
Modified: branches/7.0.x/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml
===================================================================
--- branches/7.0.x/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml 2010-06-22 19:11:30 UTC (rev 2278)
+++ branches/7.0.x/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml 2010-06-22 19:24:56 UTC (rev 2279)
@@ -53,6 +53,6 @@
<xi:include href="content/adminshell.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/appendix-a.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/appendix-b.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
+ <xi:include href="content/appendix-c.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</book>
Added: branches/7.0.x/documentation/admin-guide/src/main/docbook/en-US/content/appendix-c.xml
===================================================================
--- branches/7.0.x/documentation/admin-guide/src/main/docbook/en-US/content/appendix-c.xml (rev 0)
+++ branches/7.0.x/documentation/admin-guide/src/main/docbook/en-US/content/appendix-c.xml 2010-06-22 19:24:56 UTC (rev 2279)
@@ -0,0 +1,21 @@
+<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % CustomDTD SYSTEM "../../../../../../docbook/custom.dtd">
+%CustomDTD;
+]>
+<appendix id="system_properties">
+ <title>System Properties</title>
+ <para>Some of Teiid's low-level behavior can be configured via system properties, rather than through configuration files.
+ A typical place to set system properties for JBoss AS launches is in the <jboss-install>/bin/run.conf. A property setting
+ has the format -Dproperty=value</para>
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>org.teiid.allowNanInfinity</emphasis> - defaults to false. Set to true to allow numeric functions
+ to return NaN (Not A Number) and +-Infinity. Note that these values are not covered by the SQL specification.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>org.teiid.useValueCache</emphasis> - defaults to true. Set to false to disable the value cache.
+ Value caching is used dynamically when buffer memory is running low to reuse identical values, but at a computational cost.
+ If there is memory available, you should first increase the buffer memory rather than disabling value caching.</para>
+ </listitem>
+ </itemizedlist>
+</appendix>
\ No newline at end of file
Property changes on: branches/7.0.x/documentation/admin-guide/src/main/docbook/en-US/content/appendix-c.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 6 months
teiid SVN: r2278 - in branches/7.0.x/engine/src: main/java/org/teiid/query/rewriter and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-22 15:11:30 -0400 (Tue, 22 Jun 2010)
New Revision: 2278
Modified:
branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleCollapseSource.java
branches/7.0.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java
branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestInlineView.java
branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java
Log:
TEIID-339 modifying the add distinct logic to consider the presence of a group by
Modified: branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleCollapseSource.java
===================================================================
--- branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleCollapseSource.java 2010-06-22 19:08:30 UTC (rev 2277)
+++ branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleCollapseSource.java 2010-06-22 19:11:30 UTC (rev 2278)
@@ -159,8 +159,10 @@
if (queryCommand instanceof SetQuery) {
((SetQuery)queryCommand).setAll(false);
} else if (!NewCalculateCostUtil.usesKey(accessNode, queryCommand.getProjectedSymbols(), metadata) && CapabilitiesUtil.supports(Capability.QUERY_SELECT_DISTINCT, RuleRaiseAccess.getModelIDFromAccess(accessNode, metadata), metadata, capFinder)) {
- //TODO: could check for group by and a select clause containing all group by expressions
- ((Query)queryCommand).getSelect().setDistinct(true);
+ Query query = (Query)queryCommand;
+ if (!QueryRewriter.isDistinctWithGroupBy(query)) {
+ ((Query)queryCommand).getSelect().setDistinct(true);
+ }
}
}
Modified: branches/7.0.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- branches/7.0.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-06-22 19:08:30 UTC (rev 2277)
+++ branches/7.0.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-06-22 19:11:30 UTC (rev 2278)
@@ -653,6 +653,9 @@
if (query.getGroupBy() == null) {
return query;
}
+ if (isDistinctWithGroupBy(query)) {
+ query.getSelect().setDistinct(false);
+ }
// we check for group by expressions here to create an ANSI SQL plan
boolean hasExpression = false;
for (final Iterator iterator = query.getGroupBy().getSymbols().iterator(); !hasExpression && iterator.hasNext();) {
@@ -723,6 +726,23 @@
rewriteExpressions(innerSelect);
return query;
}
+
+ public static boolean isDistinctWithGroupBy(Query query) {
+ GroupBy groupBy = query.getGroupBy();
+ if (groupBy == null) {
+ return false;
+ }
+ HashSet<Expression> selectExpressions = new HashSet<Expression>();
+ for (SingleElementSymbol selectExpr : (List<SingleElementSymbol>)query.getSelect().getProjectedSymbols()) {
+ selectExpressions.add(SymbolMap.getExpression(selectExpr));
+ }
+ for (SingleElementSymbol groupByExpr : (List<SingleElementSymbol>)groupBy.getSymbols()) {
+ if (!selectExpressions.contains(groupByExpr)) {
+ return false;
+ }
+ }
+ return true;
+ }
private void rewriteExpressions(LanguageObject obj) throws TeiidComponentException, TeiidProcessingException{
if (obj == null) {
Modified: branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java
===================================================================
--- branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java 2010-06-22 19:08:30 UTC (rev 2277)
+++ branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java 2010-06-22 19:11:30 UTC (rev 2278)
@@ -204,7 +204,7 @@
ProcessorPlan plan = TestOptimizer.helpPlan(sql,
metadata,
null, getAggregatesFinder(),
- new String[] {"SELECT DISTINCT g_0.p_productid AS c_0 FROM m2.product AS g_0 WHERE g_0.p_divid = 100 ORDER BY c_0", "SELECT DISTINCT g_0.o_productid AS c_0, g_0.o_dealerid AS c_1, SUM(g_0.o_amount) AS c_2 FROM m1.\"order\" AS g_0, m1.dealer AS g_1 WHERE (g_0.o_dealerid = g_1.d_dealerid) AND (g_1.d_state = 'CA') AND (g_0.o_productid IN (<dependent values>)) GROUP BY g_0.o_productid, g_0.o_dealerid ORDER BY c_0"}, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] {"SELECT DISTINCT g_0.p_productid AS c_0 FROM m2.product AS g_0 WHERE g_0.p_divid = 100 ORDER BY c_0", "SELECT g_0.o_productid AS c_0, g_0.o_dealerid AS c_1, SUM(g_0.o_amount) AS c_2 FROM m1.\"order\" AS g_0, m1.dealer AS g_1 WHERE (g_0.o_dealerid = g_1.d_dealerid) AND (g_1.d_state = 'CA') AND (g_0.o_productid IN (<dependent values>)) GROUP BY g_0.o_productid, g_0.o_dealerid ORDER BY c_0"}, //$NON-NLS-1$ //$NON-NLS-2$
TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING );
TestOptimizer.checkNodeTypes(plan, new int[] {
@@ -234,7 +234,7 @@
ProcessorPlan plan = TestOptimizer.helpPlan(sql,
metadata,
null, getAggregatesFinder(),
- new String[] {"SELECT DISTINCT g_0.p_productid AS c_0 FROM m2.product AS g_0 WHERE g_0.p_divid = 100 ORDER BY c_0", "SELECT DISTINCT g_0.o_productid AS c_0, g_0.o_dealerid AS c_1, MAX(g_0.o_amount) AS c_2, SUM(g_0.o_amount) AS c_3 FROM m1.\"order\" AS g_0, m1.dealer AS g_1 WHERE (g_0.o_dealerid = g_1.d_dealerid) AND (g_1.d_state = 'CA') AND (g_0.o_productid IN (<dependent values>)) GROUP BY g_0.o_productid, g_0.o_dealerid ORDER BY c_0"}, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] {"SELECT DISTINCT g_0.p_productid AS c_0 FROM m2.product AS g_0 WHERE g_0.p_divid = 100 ORDER BY c_0", "SELECT g_0.o_productid AS c_0, g_0.o_dealerid AS c_1, MAX(g_0.o_amount) AS c_2, SUM(g_0.o_amount) AS c_3 FROM m1.\"order\" AS g_0, m1.dealer AS g_1 WHERE (g_0.o_dealerid = g_1.d_dealerid) AND (g_1.d_state = 'CA') AND (g_0.o_productid IN (<dependent values>)) GROUP BY g_0.o_productid, g_0.o_dealerid ORDER BY c_0"}, //$NON-NLS-1$ //$NON-NLS-2$
TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING );
TestOptimizer.checkNodeTypes(plan, new int[] {
@@ -569,7 +569,7 @@
metadata,
null, capFinder,
new String[] {"SELECT g_0.\"MONTH\", g_0.\"YEAR\" FROM msModel.\"TIME\" AS g_0 WHERE g_0.\"YEAR\" = '1999'", //$NON-NLS-1$
- "SELECT DISTINCT g_0.\"MONTH\" AS c_0, g_0.CITY AS c_1, SUM(g_0.SALES) AS c_2 FROM db2model.SALES AS g_0 WHERE (g_0.\"MONTH\" IN (<dependent values>)) AND (g_0.CITY IN (<dependent values>)) GROUP BY g_0.\"MONTH\", g_0.CITY ORDER BY c_0, c_1", //$NON-NLS-1$
+ "SELECT g_0.\"MONTH\" AS c_0, g_0.CITY AS c_1, SUM(g_0.SALES) AS c_2 FROM db2model.SALES AS g_0 WHERE (g_0.\"MONTH\" IN (<dependent values>)) AND (g_0.CITY IN (<dependent values>)) GROUP BY g_0.\"MONTH\", g_0.CITY ORDER BY c_0, c_1", //$NON-NLS-1$
"SELECT g_0.CITY, g_0.REGION FROM oraclemodel.GEOGRAPHY AS g_0 WHERE g_0.REGION IN ('BORDEAUX', 'POLINESIA')"}, //$NON-NLS-1$
ComparisonMode.EXACT_COMMAND_STRING );
@@ -617,7 +617,7 @@
metadata,
null, capFinder,
new String[] {"SELECT g_0.\"MONTH\", g_0.\"YEAR\" FROM msModel.\"TIME\" AS g_0 WHERE g_0.\"YEAR\" = '1999'", //$NON-NLS-1$
- "SELECT DISTINCT g_0.\"MONTH\" AS c_0, g_0.CITY AS c_1, SUM(g_0.SALES) AS c_2 FROM db2model.SALES AS g_0 WHERE (g_0.\"MONTH\" IN (<dependent values>)) AND (g_0.CITY IN (<dependent values>)) GROUP BY g_0.\"MONTH\", g_0.CITY ORDER BY c_0, c_1", //$NON-NLS-1$
+ "SELECT g_0.\"MONTH\" AS c_0, g_0.CITY AS c_1, SUM(g_0.SALES) AS c_2 FROM db2model.SALES AS g_0 WHERE (g_0.\"MONTH\" IN (<dependent values>)) AND (g_0.CITY IN (<dependent values>)) GROUP BY g_0.\"MONTH\", g_0.CITY ORDER BY c_0, c_1", //$NON-NLS-1$
"SELECT g_0.CITY, g_0.REGION FROM oraclemodel.GEOGRAPHY AS g_0 WHERE g_0.REGION IN ('BORDEAUX', 'POLINESIA')"}, //$NON-NLS-1$
ComparisonMode.EXACT_COMMAND_STRING );
@@ -664,7 +664,7 @@
ProcessorPlan plan = helpPlan(sql,
metadata,
null, capFinder,
- new String[] {"SELECT DISTINCT g_0.\"MONTH\" AS c_0, g_1.REGION AS c_1, SUM(g_0.SALES) AS c_2 FROM db2model.SALES AS g_0, db2model.GEOGRAPHY2 AS g_1 WHERE (g_0.CITY = g_1.CITY) AND (g_1.REGION IN ('BORDEAUX', 'POLINESIA')) AND (g_0.\"MONTH\" IN (<dependent values>)) GROUP BY g_0.\"MONTH\", g_1.REGION ORDER BY c_0", //$NON-NLS-1$
+ new String[] {"SELECT g_0.\"MONTH\" AS c_0, g_1.REGION AS c_1, SUM(g_0.SALES) AS c_2 FROM db2model.SALES AS g_0, db2model.GEOGRAPHY2 AS g_1 WHERE (g_0.CITY = g_1.CITY) AND (g_1.REGION IN ('BORDEAUX', 'POLINESIA')) AND (g_0.\"MONTH\" IN (<dependent values>)) GROUP BY g_0.\"MONTH\", g_1.REGION ORDER BY c_0", //$NON-NLS-1$
"SELECT g_0.\"MONTH\" AS c_0, g_0.\"YEAR\" AS c_1 FROM msModel.\"TIME\" AS g_0 WHERE g_0.\"YEAR\" = '1999' ORDER BY c_0"}, //$NON-NLS-1$
ComparisonMode.EXACT_COMMAND_STRING );
Modified: branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestInlineView.java
===================================================================
--- branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestInlineView.java 2010-06-22 19:08:30 UTC (rev 2277)
+++ branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestInlineView.java 2010-06-22 19:11:30 UTC (rev 2278)
@@ -135,7 +135,7 @@
public static InlineViewCase createInlineViewWithDistinctAndOrderBy() throws Exception {
String userQuery = "select Q1.a from (select distinct count(bqt1.smalla.intkey) as a, bqt1.smalla.intkey from bqt1.smalla group by bqt1.smalla.intkey order by bqt1.smalla.intkey) q1 inner join bqt1.smallb as q2 on q1.intkey = q2.intkey where q1.a = 1 and q1.a + q1.intkey = 2"; //$NON-NLS-1$
- String optimizedQuery = "SELECT v_0.c_0 FROM (SELECT DISTINCT COUNT(g_0.intkey) AS c_0, g_0.intkey AS c_1 FROM bqt1.smalla AS g_0 GROUP BY g_0.intkey HAVING ((COUNT(g_0.intkey) + g_0.intkey) = 2) AND (COUNT(g_0.intkey) = 1)) AS v_0, bqt1.smallb AS g_1 WHERE v_0.c_1 = g_1.intkey"; //$NON-NLS-1$
+ String optimizedQuery = "SELECT v_0.c_1 FROM (SELECT g_0.intkey AS c_0, COUNT(g_0.intkey) AS c_1 FROM bqt1.smalla AS g_0 GROUP BY g_0.intkey HAVING ((COUNT(g_0.intkey) + g_0.intkey) = 2) AND (COUNT(g_0.intkey) = 1)) AS v_0, bqt1.smallb AS g_1 WHERE v_0.c_0 = g_1.intkey"; //$NON-NLS-1$
List expectedResults = new ArrayList();
List row1 = new ArrayList();
@@ -173,7 +173,7 @@
public static InlineViewCase createInlineViewWithOuterOrderAndGroup() throws Exception {
String userQuery = "select count(Q1.a) b from (select distinct count(bqt1.smalla.intkey) as a, bqt1.smalla.intkey from bqt1.smalla group by bqt1.smalla.intkey order by bqt1.smalla.intkey) q1 inner join bqt1.smallb as q2 on q1.intkey = q2.intkey where q1.a = 1 and q1.a + q1.intkey = 2 group by Q1.a order by b"; //$NON-NLS-1$
- String optimizedQuery = "SELECT COUNT(v_0.c_0) AS c_0 FROM (SELECT DISTINCT COUNT(g_0.intkey) AS c_0, g_0.intkey AS c_1 FROM bqt1.smalla AS g_0 GROUP BY g_0.intkey HAVING ((COUNT(g_0.intkey) + g_0.intkey) = 2) AND (COUNT(g_0.intkey) = 1)) AS v_0, bqt1.smallb AS g_1 WHERE v_0.c_1 = g_1.intkey GROUP BY v_0.c_0 ORDER BY c_0"; //$NON-NLS-1$
+ String optimizedQuery = "SELECT COUNT(v_0.c_1) AS c_0 FROM (SELECT g_0.intkey AS c_0, COUNT(g_0.intkey) AS c_1 FROM bqt1.smalla AS g_0 GROUP BY g_0.intkey HAVING ((COUNT(g_0.intkey) + g_0.intkey) = 2) AND (COUNT(g_0.intkey) = 1)) AS v_0, bqt1.smallb AS g_1 WHERE v_0.c_0 = g_1.intkey GROUP BY v_0.c_1 ORDER BY c_0"; //$NON-NLS-1$
List expectedResults = new ArrayList();
List row1 = new ArrayList();
@@ -193,7 +193,7 @@
public static InlineViewCase crateInlineViewsInUnions() throws Exception {
String userQuery = "select q1.a from (select count(bqt1.smalla.intkey) as a, bqt1.smalla.intkey from bqt1.smalla group by bqt1.smalla.intkey) q1 left outer join bqt1.smallb on q1.a = bqt1.smallb.intkey where q1.intkey = 1 union all (select count(Q1.a) b from (select distinct count(bqt1.smalla.intkey) as a, bqt1.smalla.intkey from bqt1.smalla group by bqt1.smalla.intkey order by bqt1.smalla.intkey) q1 inner join bqt1.smallb as q2 on q1.intkey = q2.intkey where q1.a = 1 and q1.a + q1.intkey = 2 group by Q1.a order by b)"; //$NON-NLS-1$
- String optimizedQuery = "SELECT v_1.c_0 FROM (SELECT COUNT(g_2.intkey) AS c_0 FROM bqt1.smalla AS g_2 WHERE g_2.intkey = 1 GROUP BY g_2.intkey) AS v_1 LEFT OUTER JOIN bqt1.smallb AS g_3 ON v_1.c_0 = g_3.intkey UNION ALL SELECT COUNT(v_0.c_0) AS c_0 FROM (SELECT DISTINCT COUNT(g_0.IntKey) AS c_0, g_0.IntKey AS c_1 FROM bqt1.smalla AS g_0 GROUP BY g_0.IntKey HAVING ((COUNT(g_0.IntKey) + g_0.IntKey) = 2) AND (COUNT(g_0.IntKey) = 1)) AS v_0, bqt1.smallb AS g_1 WHERE v_0.c_1 = g_1.intkey GROUP BY v_0.c_0"; //$NON-NLS-1$
+ String optimizedQuery = "SELECT v_1.c_0 FROM (SELECT COUNT(g_2.intkey) AS c_0 FROM bqt1.smalla AS g_2 WHERE g_2.intkey = 1 GROUP BY g_2.intkey) AS v_1 LEFT OUTER JOIN bqt1.smallb AS g_3 ON v_1.c_0 = g_3.intkey UNION ALL SELECT COUNT(v_0.c_1) AS c_0 FROM (SELECT g_0.IntKey AS c_0, COUNT(g_0.IntKey) AS c_1 FROM bqt1.smalla AS g_0 GROUP BY g_0.IntKey HAVING ((COUNT(g_0.IntKey) + g_0.IntKey) = 2) AND (COUNT(g_0.IntKey) = 1)) AS v_0, bqt1.smallb AS g_1 WHERE v_0.c_0 = g_1.intkey GROUP BY v_0.c_1"; //$NON-NLS-1$
List expectedResults = new ArrayList();
List row1 = new ArrayList();
@@ -218,7 +218,7 @@
public static InlineViewCase createUnionInInlineView() throws Exception{
String userQuery = "select t1.intkey from (select case when q1.a=1 then 2 else 1 end as a from (select count(bqt1.smalla.intkey) as a, bqt1.smalla.intkey from bqt1.smalla group by bqt1.smalla.intkey) q1 left outer join bqt1.smallb on q1.a = bqt1.smallb.intkey where q1.intkey = 1 union all (select count(Q1.a) b from (select distinct count(bqt1.smalla.intkey) as a, bqt1.smalla.intkey from bqt1.smalla group by bqt1.smalla.intkey order by bqt1.smalla.intkey) q1 inner join bqt1.smallb as q2 on q1.intkey = q2.intkey where q1.a = 1 and q1.a + q1.intkey = 2 group by Q1.a order by b)) as q3, bqt1.smallb as t1 where q3.a = t1.intkey order by t1.intkey"; //$NON-NLS-1$
- String optimizedQuery = "SELECT g_4.intkey AS c_0 FROM (SELECT CASE WHEN v_1.c_0 = 1 THEN 2 ELSE 1 END AS c_0 FROM (SELECT COUNT(g_2.intkey) AS c_0 FROM bqt1.smalla AS g_2 WHERE g_2.intkey = 1 GROUP BY g_2.intkey) AS v_1 LEFT OUTER JOIN bqt1.smallb AS g_3 ON v_1.c_0 = g_3.intkey UNION ALL SELECT COUNT(v_0.c_0) AS c_0 FROM (SELECT DISTINCT COUNT(g_0.IntKey) AS c_0, g_0.IntKey AS c_1 FROM bqt1.smalla AS g_0 GROUP BY g_0.IntKey HAVING ((COUNT(g_0.IntKey) + g_0.IntKey) = 2) AND (COUNT(g_0.IntKey) = 1)) AS v_0, bqt1.smallb AS g_1 WHERE v_0.c_1 = g_1.intkey GROUP BY v_0.c_0) AS v_2, bqt1.smallb AS g_4 WHERE v_2.c_0 = g_4.intkey ORDER BY c_0"; //$NON-NLS-1$
+ String optimizedQuery = "SELECT g_4.intkey AS c_0 FROM (SELECT CASE WHEN v_1.c_0 = 1 THEN 2 ELSE 1 END AS c_0 FROM (SELECT COUNT(g_2.intkey) AS c_0 FROM bqt1.smalla AS g_2 WHERE g_2.intkey = 1 GROUP BY g_2.intkey) AS v_1 LEFT OUTER JOIN bqt1.smallb AS g_3 ON v_1.c_0 = g_3.intkey UNION ALL SELECT COUNT(v_0.c_1) AS c_0 FROM (SELECT g_0.IntKey AS c_0, COUNT(g_0.IntKey) AS c_1 FROM bqt1.smalla AS g_0 GROUP BY g_0.IntKey HAVING ((COUNT(g_0.IntKey) + g_0.IntKey) = 2) AND (COUNT(g_0.IntKey) = 1)) AS v_0, bqt1.smallb AS g_1 WHERE v_0.c_0 = g_1.intkey GROUP BY v_0.c_1) AS v_2, bqt1.smallb AS g_4 WHERE v_2.c_0 = g_4.intkey ORDER BY c_0"; //$NON-NLS-1$
List expectedResults = new ArrayList();
List row1 = new ArrayList();
@@ -257,7 +257,7 @@
QueryMetadataInterface metadata = createInlineViewMetadata(capFinder);
ProcessorPlan plan = helpPlan("select a, b from (select distinct count(intNum) a, count(stringKey), bqt1.smalla.intkey as b from bqt1.smalla group by bqt1.smalla.intkey) q1 order by q1.a", //$NON-NLS-1$
- metadata, null, capFinder, new String[] {"SELECT a, b FROM (SELECT DISTINCT COUNT(intNum) AS a, COUNT(stringKey) AS count1, bqt1.smalla.intkey AS b FROM bqt1.smalla GROUP BY bqt1.smalla.intkey) AS q1 ORDER BY a"}, true); //$NON-NLS-1$
+ metadata, null, capFinder, new String[] {"SELECT COUNT(g_0.intNum) AS c_0, g_0.intkey AS c_1 FROM bqt1.smalla AS g_0 GROUP BY g_0.intkey ORDER BY c_0"}, true); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
}
Modified: branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java
===================================================================
--- branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java 2010-06-22 19:08:30 UTC (rev 2277)
+++ branches/7.0.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java 2010-06-22 19:11:30 UTC (rev 2278)
@@ -50,10 +50,10 @@
}
@Test public void testSimpleMergeGroupBy1() {
- ProcessorPlan plan = TestOptimizer.helpPlan("SELECT x FROM (SELECT distinct e1, max(e2) as x FROM pm1.g1 GROUP BY e1) AS z", //$NON-NLS-1$
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT x FROM (SELECT distinct min(e1), max(e2) as x FROM pm1.g1 GROUP BY e1) AS z", //$NON-NLS-1$
FakeMetadataFactory.example1Cached(), null, TestAggregatePushdown.getAggregatesFinder(),
new String[] {
- "SELECT v_0.c_1 FROM (SELECT DISTINCT g_0.e1 AS c_0, MAX(g_0.e2) AS c_1 FROM pm1.g1 AS g_0 GROUP BY g_0.e1) AS v_0"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
+ "SELECT v_0.c_1 FROM (SELECT DISTINCT MIN(g_0.e1) AS c_0, MAX(g_0.e2) AS c_1 FROM pm1.g1 AS g_0 GROUP BY g_0.e1) AS v_0"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
@@ -75,10 +75,10 @@
@Test public void testSimpleMergeGroupBy3() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- ProcessorPlan plan = TestOptimizer.helpPlan("SELECT distinct x, e1 FROM (SELECT e1, max(e2) as x FROM pm1.g1 GROUP BY e1) AS z", //$NON-NLS-1$
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT distinct x, e1 FROM (SELECT min(e1) as e1, max(e2) as x FROM pm1.g1 GROUP BY e1) AS z", //$NON-NLS-1$
metadata, null, TestAggregatePushdown.getAggregatesFinder(),
new String[] {
- "SELECT DISTINCT MAX(e2) AS x, e1 FROM pm1.g1 GROUP BY e1"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
+ "SELECT DISTINCT MAX(e2) AS x, MIN(e1) FROM pm1.g1 GROUP BY e1"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
@@ -113,10 +113,10 @@
@Test public void testSimpleMergeGroupBy7() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- ProcessorPlan plan = TestOptimizer.helpPlan("SELECT distinct x, e1 FROM (SELECT distinct e1, max(e2) as x FROM pm1.g1 GROUP BY e1) AS z", //$NON-NLS-1$
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT distinct x, e1 FROM (SELECT distinct min(e1) as e1, max(e2) as x FROM pm1.g1 GROUP BY e1) AS z", //$NON-NLS-1$
metadata, null, TestAggregatePushdown.getAggregatesFinder(),
new String[] {
- "SELECT DISTINCT MAX(e2) AS x, e1 FROM pm1.g1 GROUP BY e1"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
+ "SELECT DISTINCT MAX(e2) AS x, MIN(e1) FROM pm1.g1 GROUP BY e1"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
14 years, 6 months
teiid SVN: r2277 - branches/7.0.x/documentation/reference/src/main/docbook/en-US/content.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-22 15:08:30 -0400 (Tue, 22 Jun 2010)
New Revision: 2277
Modified:
branches/7.0.x/documentation/reference/src/main/docbook/en-US/content/translators.xml
Log:
TEIID-1131 adding a note about oracle sequence handling to the reference
Modified: branches/7.0.x/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- branches/7.0.x/documentation/reference/src/main/docbook/en-US/content/translators.xml 2010-06-22 18:58:30 UTC (rev 2276)
+++ branches/7.0.x/documentation/reference/src/main/docbook/en-US/content/translators.xml 2010-06-22 19:08:30 UTC (rev 2277)
@@ -143,7 +143,9 @@
<para><emphasis>mysql5</emphasis> - for use with MySQL version 5 or later.</para>
</listitem>
<listitem>
-<para><emphasis>oracle</emphasis> - for use with Oracle 9i or later.</para>
+<para><emphasis>oracle</emphasis> - for use with Oracle 9i or later. Sequences may be used with the Oracle translator.
+A sequence may be modeled as a table with a name in source of DUAL and columns with the name in source set to <sequencesequence name>.[nextval|currentval].
+You can use a sequence as the default value for insert columns by setting the column to autoincrement and the name in source to <element name>:SEQUENCE=<sequence name>.<sequence value>.</para>
</listitem>
<listitem>
<para><emphasis>postgresql</emphasis> - for use with 8.0 or later clients and 7.1 or later server. Setting the specific 8.x version improves pushdown support - see the DatabaseVersion execution property.</para>
14 years, 6 months
teiid SVN: r2276 - in trunk: api/src/main/java/org/teiid/translator and 35 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-22 14:58:30 -0400 (Tue, 22 Jun 2010)
New Revision: 2276
Added:
trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java
Removed:
trunk/engine/src/main/java/org/teiid/api/exception/query/CriteriaEvaluationException.java
trunk/test-integration/common/src/test/resources/xquery/
Modified:
trunk/api/src/main/java/org/teiid/language/AggregateFunction.java
trunk/api/src/main/java/org/teiid/language/SQLConstants.java
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java
trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java
trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleCleanCriteria.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
trunk/engine/src/main/java/org/teiid/query/parser/ParseInfo.java
trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinStrategy.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/MergeJoinStrategy.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/NestedTableJoinStrategy.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/PartitionedSortJoin.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/CriteriaCondition.java
trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
trunk/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java
trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java
trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java
trunk/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java
trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
trunk/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java
trunk/engine/src/test/java/org/teiid/query/processor/eval/TestCriteriaEvaluator.java
trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
Log:
TEIID-886 adding support for any/some/every/stddev_pop/stddev_samp/var_pop/var_samp - agg pushdown is supported, but no compensation was added if the source doesn't support, but does support standard aggs. also reducing lookaheads in the parser and removing criteriaevaluationexception (I was going to allow boolean value expression to include criteria, but named proc properties then become ambiguous).
Modified: trunk/api/src/main/java/org/teiid/language/AggregateFunction.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/AggregateFunction.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/api/src/main/java/org/teiid/language/AggregateFunction.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -34,6 +34,10 @@
public static final String SUM = "SUM"; //$NON-NLS-1$
public static final String MIN = "MIN"; //$NON-NLS-1$
public static final String MAX = "MAX"; //$NON-NLS-1$
+ public static final String STDDEV_POP = "STDDEV_POP"; //$NON-NLS-1$
+ public static final String STDDEV_SAMP = "STDDEV_SAMP"; //$NON-NLS-1$
+ public static final String VAR_SAMP = "VAR_SAMP"; //$NON-NLS-1$
+ public static final String VAR_POP = "VAR_POP"; //$NON-NLS-1$
private Expression expression;
private String aggName;
@@ -50,11 +54,6 @@
/**
* Get the name of the aggregate function. This will be one of the constants defined
* in this class.
- * @see #COUNT
- * @see #AVG
- * @see #SUM
- * @see #MIN
- * @see #MAX
*/
public String getName() {
return this.aggName;
@@ -88,11 +87,6 @@
* Set the name of the aggregate function. This will be one of the constants defined
* in this class.
* @param name New aggregate function name
- * @see #COUNT
- * @see #AVG
- * @see #SUM
- * @see #MIN
- * @see #MAX
*/
public void setName(String name) {
this.aggName = name;
Modified: trunk/api/src/main/java/org/teiid/language/SQLConstants.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -86,6 +86,12 @@
public static final String QUERYSTRING = "QUERYSTRING"; //$NON-NLS-1$
//xmlparse
public static final String WELLFORMED = "WELLFORMED"; //$NON-NLS-1$
+ //agg
+ public static final String EVERY = "EVERY"; //$NON-NLS-1$
+ public static final String STDDEV_POP = "STDDEV_POP"; //$NON-NLS-1$
+ public static final String STDDEV_SAMP = "STDDEV_SAMP"; //$NON-NLS-1$
+ public static final String VAR_SAMP = "VAR_SAMP"; //$NON-NLS-1$
+ public static final String VAR_POP = "VAR_POP"; //$NON-NLS-1$
}
public interface Reserved {
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -533,6 +533,14 @@
public boolean supportsAggregatesDistinct() {
return false;
}
+
+ /**
+ * Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMP
+ * @since 7.1
+ */
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return false;
+ }
/**
* Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -26,6 +26,9 @@
import java.util.List;
+import org.teiid.language.AggregateFunction;
+import org.teiid.language.LanguageObject;
+import org.teiid.translator.ExecutionContext;
import org.teiid.translator.Translator;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.sybase.SybaseExecutionFactory;
@@ -46,6 +49,23 @@
}
@Override
+ public List<?> translate(LanguageObject obj, ExecutionContext context) {
+ if (obj instanceof AggregateFunction) {
+ AggregateFunction af = (AggregateFunction)obj;
+ if (af.getName().equals(AggregateFunction.STDDEV_POP)) {
+ af.setName("StDevP"); //$NON-NLS-1$
+ } else if (af.getName().equals(AggregateFunction.STDDEV_SAMP)) {
+ af.setName("StDev"); //$NON-NLS-1$
+ } else if (af.getName().equals(AggregateFunction.VAR_POP)) {
+ af.setName("VarP"); //$NON-NLS-1$
+ } else if (af.getName().equals(AggregateFunction.VAR_SAMP)) {
+ af.setName("Var"); //$NON-NLS-1$
+ }
+ }
+ return super.translate(obj, context);
+ }
+
+ @Override
public boolean addSourceComment() {
return false;
}
@@ -84,4 +104,9 @@
public List<String> getSupportedFunctions() {
return getDefaultSupportedFunctions();
}
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return true;
+ }
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -244,5 +244,10 @@
@Override
public boolean supportsIntersect() {
return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return true;
}
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -189,5 +189,10 @@
@Override
public boolean supportsIntersect() {
return true;
- }
+ }
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return true;
+ }
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -180,4 +180,9 @@
public boolean supportsIntersect() {
return true;
}
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return true;
+ }
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -60,5 +60,10 @@
public boolean supportsInlineViews() {
return true;
}
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return true;
+ }
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -536,5 +536,10 @@
@Override
public boolean supportsIntersect() {
return true;
- }
+ }
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return true;
+ }
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -457,4 +457,9 @@
return true;
}
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return getDatabaseVersion().compareTo(EIGHT_2) >= 0;
+ }
+
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -28,6 +28,7 @@
import java.util.Arrays;
import java.util.List;
+import org.teiid.language.AggregateFunction;
import org.teiid.language.ColumnReference;
import org.teiid.language.Function;
import org.teiid.language.LanguageObject;
@@ -62,6 +63,17 @@
if (TypeFacility.RUNTIME_TYPES.STRING.equals(elem.getType()) && elem.getMetadataObject() != null && "uniqueidentifier".equalsIgnoreCase(elem.getMetadataObject().getNativeType())) { //$NON-NLS-1$
return Arrays.asList("cast(", elem, " as char(36))"); //$NON-NLS-1$ //$NON-NLS-2$
}
+ } else if (obj instanceof AggregateFunction) {
+ AggregateFunction af = (AggregateFunction)obj;
+ if (af.getName().equals(AggregateFunction.STDDEV_POP)) {
+ af.setName("STDDEVP"); //$NON-NLS-1$
+ } else if (af.getName().equals(AggregateFunction.STDDEV_SAMP)) {
+ af.setName("STDDEV"); //$NON-NLS-1$
+ } else if (af.getName().equals(AggregateFunction.VAR_POP)) {
+ af.setName("VARP"); //$NON-NLS-1$
+ } else if (af.getName().equals(AggregateFunction.VAR_SAMP)) {
+ af.setName("VAR"); //$NON-NLS-1$
+ }
}
return super.translate(obj, context);
}
@@ -170,6 +182,11 @@
@Override
public int getMaxInCriteriaSize() {
return JDBCExecutionFactory.DEFAULT_MAX_IN_CRITERIA;
- }
+ }
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return true;
+ }
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -46,7 +46,15 @@
@Translator(name="sybase")
-public class SybaseExecutionFactory extends JDBCExecutionFactory {
+public class SybaseExecutionFactory extends JDBCExecutionFactory {
+
+ public static final String TWELVE_5 = "12.5"; //$NON-NLS-1$
+ public static final String FIFTEEN_0_2 = "15.0.2"; //$NON-NLS-1$
+ public static final String FIFTEEN_5 = "15.5"; //$NON-NLS-1$
+
+ public SybaseExecutionFactory() {
+ setDatabaseVersion(TWELVE_5);
+ }
public void start() throws TranslatorException {
super.start();
@@ -288,5 +296,10 @@
@Override
public int getMaxFromGroups() {
return 50;
- }
+ }
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return getDatabaseVersion().compareTo(FIFTEEN_0_2) >= 0;
+ }
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -36,6 +36,13 @@
*/
@Translator(name="teiid")
public class TeiidExecutionFactory extends JDBCExecutionFactory {
+
+ public static final String SEVEN_0 = "7.0"; //$NON-NLS-1$
+ public static final String SEVEN_1 = "7.1"; //$NON-NLS-1$
+
+ public TeiidExecutionFactory() {
+ setDatabaseVersion(SEVEN_0);
+ }
@Override
public List<String> getSupportedFunctions() {
@@ -160,4 +167,9 @@
public boolean supportsIntersect() {
return true;
}
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return getDatabaseVersion().compareTo(SEVEN_1) >= 0;
+ }
}
Modified: trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
===================================================================
--- trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2010-06-22 18:58:30 UTC (rev 2276)
@@ -1077,6 +1077,17 @@
</row>
<row>
<entry>
+ <para>AggregatesEnhancedNumeric</para>
+ </entry>
+ <entry>
+ <para/>
+ </entry>
+ <entry>
+ <para>Translator can support the VAR_SAMP, VAR_POP, STDDEV_SAMP, STDDEV_POP aggregate functions.</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
<para>ScalarSubqueries</para>
</entry>
<entry>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2010-06-22 18:58:30 UTC (rev 2276)
@@ -206,23 +206,41 @@
<para>COUNT(*) – count the number of values (including nulls and duplicates) in a group</para>
</listitem>
<listitem>
- <para>COUNT(expression) – count the number of values (excluding nulls) in a group</para>
+ <para>COUNT(x) – count the number of values (excluding nulls) in a group</para>
</listitem>
<listitem>
- <para>SUM(expression) – sum of the values (excluding nulls) in a group</para>
+ <para>SUM(x) – sum of the values (excluding nulls) in a group</para>
</listitem>
<listitem>
- <para>AVG(expression) – average of the values (excluding nulls) in a group</para>
+ <para>AVG(x) – average of the values (excluding nulls) in a group</para>
</listitem>
<listitem>
- <para>MIN(expression) – minimum value in a group (excluding null)</para>
+ <para>MIN(x) – minimum value in a group (excluding null)</para>
</listitem>
<listitem>
- <para>MAX(expression) – maximum value in a group (excluding null)</para>
+ <para>MAX(x) – maximum value in a group (excluding null)</para>
</listitem>
<listitem>
- <para>XMLAGG(xml expression <link linkend="orderby_clause">[ORDER BY ...]</link>) – xml concatination of all xml expressions in a group (excluding null)</para>
+ <para>ANY(x)/SOME(x) – returns TRUE if any value in the group is TRUE (excluding null)</para>
</listitem>
+ <listitem>
+ <para>EVERY(x) – returns TRUE if every value in the group is TRUE (excluding null)</para>
+ </listitem>
+ <listitem>
+ <para>VAR_POP(x) – biased variance (excluding null) logically equals (sum(x^2) - sum(x)^2/count(x))/count(x); returns a double; null if count = 0</para>
+ </listitem>
+ <listitem>
+ <para>VAR_SAMP(x) – sample variance (excluding null) logically equals (sum(x^2) - sum(x)^2/count(x))/(count(x) - 1); returns a double; null if count < 2</para>
+ </listitem>
+ <listitem>
+ <para>STDDEV_POP(x) – standard deviation (excluding null) logically equals SQRT(VAR_POP(x))</para>
+ </listitem>
+ <listitem>
+ <para>STDDEV_SAMP(x) – sample standar deviation (excluding null) logically equals SQRT(VAR_SAMP(x))</para>
+ </listitem>
+ <listitem>
+ <para>XMLAGG(xml_expr <link linkend="orderby_clause">[ORDER BY ...]</link>) – xml concatination of all xml expressions in a group (excluding null)</para>
+ </listitem>
</itemizedlist>
<itemizedlist>
<para>Syntax Rules:
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2010-06-22 18:58:30 UTC (rev 2276)
@@ -122,7 +122,7 @@
<para><emphasis>db2</emphasis> - for use with DB2 8 or later.</para>
</listitem>
<listitem>
-<para><emphasis>derby</emphasis> - for use with Derby 10.1 or later. Setting the specific 10.x version improves pushdown support - see the DatabaseVersion execution property.</para>
+<para><emphasis>derby</emphasis> - for use with Derby 10.1 or later.</para>
</listitem>
<listitem>
<para><emphasis>h2</emphasis> - for use with H2 version 1.1 or later.</para>
@@ -146,7 +146,7 @@
<para><emphasis>oracle</emphasis> - for use with Oracle 9i or later.</para>
</listitem>
<listitem>
-<para><emphasis>postgresql</emphasis> - for use with 8.0 or later clients and 7.1 or later server. Setting the specific 8.x version improves pushdown support - see the DatabaseVersion execution property.</para>
+<para><emphasis>postgresql</emphasis> - for use with 8.0 or later clients and 7.1 or later server.</para>
</listitem>
<listitem>
<para><emphasis>sybase</emphasis> - for use with Sybase version 12.5 or later.</para>
Deleted: trunk/engine/src/main/java/org/teiid/api/exception/query/CriteriaEvaluationException.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/api/exception/query/CriteriaEvaluationException.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/api/exception/query/CriteriaEvaluationException.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.api.exception.query;
-
-import org.teiid.core.TeiidProcessingException;
-
-/**
- * This exception is thrown when an error occurs while evaluating a SQL criteria.
- */
-public class CriteriaEvaluationException extends TeiidProcessingException {
-
- /**
- * No-arg constructor required by Externalizable semantics.
- */
- public CriteriaEvaluationException() {
- super();
- }
-
- /**
- * Construct an instance with the message specified.
- *
- * @param message A message describing the exception
- */
- public CriteriaEvaluationException( String message ) {
- super( message );
- }
-
- /**
- * Construct an instance with the message and error code specified.
- *
- * @param message A message describing the exception
- * @param code The error code
- */
- public CriteriaEvaluationException( String code, String message ) {
- super( code, message );
- }
-
- /**
- * Construct an instance from a message and an exception to chain to this one.
- *
- * @param message A message describing the exception
- * @param e An exception to nest within this one
- */
- public CriteriaEvaluationException( Throwable e, String message ) {
- super( e, message );
- }
-
- /**
- * Construct an instance from a message and a code and an exception to
- * chain to this one.
- *
- * @param e An exception to nest within this one
- * @param message A message describing the exception
- * @param code A code denoting the exception
- */
- public CriteriaEvaluationException( Throwable e, String code, String message ) {
- super( e, code, message );
- }
-}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -94,6 +94,7 @@
tgtCaps.setCapabilitySupport(Capability.QUERY_HAVING, srcCaps.supportsHaving());
tgtCaps.setCapabilitySupport(Capability.INSERT_WITH_QUERYEXPRESSION, srcCaps.supportsInsertWithQueryExpression());
tgtCaps.setCapabilitySupport(Capability.QUERY_ORDERBY_UNRELATED, srcCaps.supportsOrderByUnrelated());
+ tgtCaps.setCapabilitySupport(Capability.QUERY_AGGREGATES_ENHANCED_NUMERIC, srcCaps.supportsAggregatesEnhancedNumeric());
List functions = srcCaps.getSupportedFunctions();
if(functions != null && functions.size() > 0) {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -516,7 +516,7 @@
}
AggregateFunction translate(AggregateSymbol symbol) {
- return new AggregateFunction(symbol.getAggregateFunction(),
+ return new AggregateFunction(symbol.getAggregateFunction().name(),
symbol.isDistinct(),
translate(symbol.getExpression()),
symbol.getType());
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -61,6 +61,7 @@
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.SingleElementSymbol;
+import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.visitor.ReferenceCollectorVisitor;
import org.teiid.query.tempdata.TempTableStore;
@@ -307,8 +308,8 @@
AggregateSymbol symbol) throws QueryMetadataException, TeiidComponentException {
Expression expression = symbol.getExpression();
- String function = symbol.getAggregateFunction();
- if(function.equals(NonReserved.MIN) || function.equals(NonReserved.MAX)){
+ Type function = symbol.getAggregateFunction();
+ if(function == Type.MIN || function == Type.MAX){
if(expression instanceof ElementSymbol) {
return createColumnMetadata(shortColumnName, (ElementSymbol)expression);
}
Modified: trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -44,14 +44,12 @@
import net.sf.saxon.om.SequenceIterator;
import net.sf.saxon.trans.XPathException;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.ComponentNotFoundException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
-import org.teiid.core.types.BaseLob;
import org.teiid.core.types.BlobType;
import org.teiid.core.types.ClobImpl;
import org.teiid.core.types.ClobType;
@@ -178,7 +176,7 @@
protected ProcessorDataManager dataMgr;
protected CommandContext context;
- public static boolean evaluate(Criteria criteria) throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ public static boolean evaluate(Criteria criteria) throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
return new Evaluator(Collections.emptyMap(), null, null).evaluate(criteria, Collections.emptyList());
}
@@ -198,13 +196,13 @@
}
public boolean evaluate(Criteria criteria, List<?> tuple)
- throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
return Boolean.TRUE.equals(evaluateTVL(criteria, tuple));
}
public Boolean evaluateTVL(Criteria criteria, List<?> tuple)
- throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
if(criteria instanceof CompoundCriteria) {
return evaluate((CompoundCriteria)criteria, tuple);
@@ -223,12 +221,12 @@
} else if(criteria instanceof ExistsCriteria) {
return Boolean.valueOf(evaluate((ExistsCriteria)criteria, tuple));
} else {
- throw new CriteriaEvaluationException(ErrorMessageKeys.PROCESSOR_0010, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0010, criteria));
+ throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0010, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0010, criteria));
}
}
public Boolean evaluate(CompoundCriteria criteria, List<?> tuple)
- throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
List subCrits = criteria.getCriteria();
Iterator subCritIter = subCrits.iterator();
@@ -252,7 +250,7 @@
}
public Boolean evaluate(NotCriteria criteria, List<?> tuple)
- throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
Criteria subCrit = criteria.getCriteria();
Boolean result = evaluateTVL(subCrit, tuple);
@@ -266,14 +264,14 @@
}
public Boolean evaluate(CompareCriteria criteria, List<?> tuple)
- throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
// Evaluate left expression
Object leftValue = null;
try {
leftValue = evaluate(criteria.getLeftExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new CriteriaEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[] {"left", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[] {"left", criteria})); //$NON-NLS-1$
}
// Shortcut if null
@@ -286,7 +284,7 @@
try {
rightValue = evaluate(criteria.getRightExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new CriteriaEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"right", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"right", criteria})); //$NON-NLS-1$
}
// Shortcut if null
@@ -309,7 +307,7 @@
case CompareCriteria.GE:
return Boolean.valueOf((compareValues(leftValue, rightValue) >= 0));
default:
- throw new CriteriaEvaluationException(ErrorMessageKeys.PROCESSOR_0012, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0012, criteria.getOperator()));
+ throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0012, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0012, criteria.getOperator()));
}
}
@@ -323,7 +321,7 @@
}
public Boolean evaluate(MatchCriteria criteria, List<?> tuple)
- throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
boolean result = false;
// Evaluate left expression
@@ -331,7 +329,7 @@
try {
value = evaluate(criteria.getLeftExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new CriteriaEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"left", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"left", criteria})); //$NON-NLS-1$
}
// Shortcut if null
@@ -347,7 +345,7 @@
try {
leftValue = ((Sequencable)value).getCharSequence();
} catch (SQLException err) {
- throw new CriteriaEvaluationException(err, err.getMessage());
+ throw new ExpressionEvaluationException(err, err.getMessage());
}
}
@@ -356,7 +354,7 @@
try {
rightValue = (String) evaluate(criteria.getRightExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new CriteriaEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"right", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"right", criteria})); //$NON-NLS-1$
}
// Shortcut if null
@@ -370,7 +368,7 @@
}
private boolean match(String pattern, char escape, CharSequence search)
- throws CriteriaEvaluationException {
+ throws ExpressionEvaluationException {
StringBuffer rePattern = LIKE_TO_REGEX.translate(pattern, escape);
@@ -383,19 +381,19 @@
Matcher matcher = patternRegex.matcher(search);
return matcher.matches();
} catch(PatternSyntaxException e) {
- throw new CriteriaEvaluationException(e, ErrorMessageKeys.PROCESSOR_0014, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0014, new Object[]{pattern, e.getMessage()}));
+ throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0014, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0014, new Object[]{pattern, e.getMessage()}));
}
}
private Boolean evaluate(AbstractSetCriteria criteria, List<?> tuple)
- throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
// Evaluate expression
Object leftValue = null;
try {
leftValue = evaluate(criteria.getExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new CriteriaEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
+ throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
}
// Shortcut if null
@@ -414,7 +412,7 @@
try {
values = vis.getCachedSet(ref.getValueExpression());
} catch (TeiidProcessingException e) {
- throw new CriteriaEvaluationException(e, e.getMessage());
+ throw new ExpressionEvaluationException(e, e.getMessage());
}
if (values != null) {
return values.contains(leftValue);
@@ -426,7 +424,7 @@
try {
valueIter = evaluateSubquery((SubquerySetCriteria)criteria, tuple);
} catch (TeiidProcessingException e) {
- throw new CriteriaEvaluationException(e, e.getMessage());
+ throw new ExpressionEvaluationException(e, e.getMessage());
}
} else {
throw new AssertionError("unknown set criteria type"); //$NON-NLS-1$
@@ -438,7 +436,7 @@
try {
value = evaluate((Expression) possibleValue, tuple);
} catch(ExpressionEvaluationException e) {
- throw new CriteriaEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, possibleValue));
+ throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, possibleValue));
}
} else {
value = possibleValue;
@@ -461,28 +459,28 @@
}
public boolean evaluate(IsNullCriteria criteria, List<?> tuple)
- throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
// Evaluate expression
Object value = null;
try {
value = evaluate(criteria.getExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new CriteriaEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
+ throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
}
return (value == null ^ criteria.isNegated());
}
private Boolean evaluate(SubqueryCompareCriteria criteria, List<?> tuple)
- throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
// Evaluate expression
Object leftValue = null;
try {
leftValue = evaluate(criteria.getLeftExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new CriteriaEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
+ throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
}
// Shortcut if null
@@ -504,7 +502,7 @@
try {
valueIter = evaluateSubquery(criteria, tuple);
} catch (TeiidProcessingException e) {
- throw new CriteriaEvaluationException(e, e.getMessage());
+ throw new ExpressionEvaluationException(e, e.getMessage());
}
while(valueIter.hasNext()) {
Object value = valueIter.next();
@@ -532,7 +530,7 @@
result = Boolean.valueOf((compareValues(leftValue, value) >= 0));
break;
default:
- throw new CriteriaEvaluationException(ErrorMessageKeys.PROCESSOR_0012, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0012, criteria.getOperator()));
+ throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0012, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0012, criteria.getOperator()));
}
switch(criteria.getPredicateQuantifier()) {
@@ -550,11 +548,11 @@
if (valueIter.hasNext()){
// The subquery should be scalar, but has produced
// more than one result value - this is an exception case
- throw new CriteriaEvaluationException(ErrorMessageKeys.PROCESSOR_0056, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0056, criteria));
+ throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0056, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0056, criteria));
}
return result;
default:
- throw new CriteriaEvaluationException(ErrorMessageKeys.PROCESSOR_0057, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0057, criteria.getPredicateQuantifier()));
+ throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0057, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0057, criteria.getPredicateQuantifier()));
}
} else { // value is null
@@ -570,12 +568,12 @@
if (valueIter.hasNext()){
// The subquery should be scalar, but has produced
// more than one result value - this is an exception case
- throw new CriteriaEvaluationException(ErrorMessageKeys.PROCESSOR_0056, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0056, criteria));
+ throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0056, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0056, criteria));
}
// null value means unknown for the single-value comparison
return null;
default:
- throw new CriteriaEvaluationException(ErrorMessageKeys.PROCESSOR_0057, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0057, criteria.getPredicateQuantifier()));
+ throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0057, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0057, criteria.getPredicateQuantifier()));
}
}
@@ -586,13 +584,13 @@
}
public boolean evaluate(ExistsCriteria criteria, List<?> tuple)
- throws BlockedException, TeiidComponentException, CriteriaEvaluationException {
+ throws BlockedException, TeiidComponentException, ExpressionEvaluationException {
ValueIterator valueIter;
try {
valueIter = evaluateSubquery(criteria, tuple);
} catch (TeiidProcessingException e) {
- throw new CriteriaEvaluationException(e, e.getMessage());
+ throw new ExpressionEvaluationException(e, e.getMessage());
}
if(valueIter.hasNext()) {
return true;
@@ -647,6 +645,8 @@
return internalEvaluate(ref.getExpression(), tuple);
} else if(expression instanceof ScalarSubquery) {
return evaluate((ScalarSubquery) expression, tuple);
+ } else if (expression instanceof Criteria) {
+ return evaluate((Criteria)expression, tuple);
} else if (expression instanceof XMLElement){
return evaluateXMLElement(tuple, (XMLElement)expression);
} else if (expression instanceof XMLForest){
@@ -904,7 +904,7 @@
if (evaluate(expr.getWhenCriteria(i), tuple)) {
return internalEvaluate(expr.getThenExpression(i), tuple);
}
- } catch (CriteriaEvaluationException e) {
+ } catch (ExpressionEvaluationException e) {
throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, "CASE", expr.getWhenCriteria(i))); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -46,7 +46,7 @@
* @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
*/
public Object getResult() {
- return new Integer(count);
+ return Integer.valueOf(count);
}
}
Added: trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.query.function.aggregate;
+
+import java.util.List;
+
+import org.teiid.api.exception.query.ExpressionEvaluationException;
+import org.teiid.api.exception.query.FunctionExecutionException;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.query.sql.symbol.AggregateSymbol.Type;
+
+public class StatsFunction extends AggregateFunction {
+
+ private double sum = 0;
+ private double sumSq = 0;
+ private int count = 0;
+ private Type type;
+
+ public StatsFunction(Type function) {
+ this.type = function;
+ }
+
+ @Override
+ public void reset() {
+ sum = 0;
+ sumSq = 0;
+ count = 0;
+ }
+
+ @Override
+ public void addInputDirect(Object input, List<?> tuple)
+ throws FunctionExecutionException, ExpressionEvaluationException,
+ TeiidComponentException {
+ sum += ((Number)input).doubleValue();
+ sumSq += Math.pow(((Number)input).doubleValue(), 2);
+ count++;
+ }
+
+ @Override
+ public Object getResult() throws FunctionExecutionException,
+ ExpressionEvaluationException, TeiidComponentException {
+ double result = 0;
+ switch (type) {
+ case STDDEV_POP:
+ case VAR_POP:
+ if (count == 0) {
+ return null;
+ }
+ result = (sumSq - sum * sum / count) / count;
+ if (type == Type.STDDEV_POP) {
+ result = Math.sqrt(result);
+ }
+ break;
+ case STDDEV_SAMP:
+ case VAR_SAMP:
+ if (count < 2) {
+ return null;
+ }
+ result = (sumSq - sum * sum / count) / (count - 1);
+ if (type == Type.STDDEV_SAMP) {
+ result = Math.sqrt(result);
+ }
+ break;
+ }
+ return result;
+ }
+
+}
Property changes on: trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -202,6 +202,12 @@
*/
QUERY_AGGREGATES_MAX,
/**
+ * Support indicates connector can accept the enhanced numeric aggregates
+ *
+ * @since 3.1 SP2
+ */
+ QUERY_AGGREGATES_ENHANCED_NUMERIC,
+ /**
* Support indicates connector can accept the COUNT aggregate function
*
* @since 3.1 SP2
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -30,7 +30,6 @@
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.types.DataTypeManager;
-import org.teiid.language.SQLConstants.NonReserved;
import org.teiid.query.function.FunctionLibrary;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
@@ -44,6 +43,7 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.Function;
+import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.translator.ExecutionFactory.SupportedJoinCriteria;
@@ -144,8 +144,9 @@
SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
// Check particular function
- String func = aggregate.getAggregateFunction();
- if(func.equals(NonReserved.COUNT)) {
+ Type func = aggregate.getAggregateFunction();
+ switch (func) {
+ case COUNT:
if(aggregate.getExpression() == null) {
if(! caps.supportsCapability(Capability.QUERY_AGGREGATES_COUNT_STAR)) {
return false;
@@ -155,22 +156,36 @@
return false;
}
}
- } else if(func.equals(NonReserved.SUM)) {
+ break;
+ case SUM:
if(! caps.supportsCapability(Capability.QUERY_AGGREGATES_SUM)) {
return false;
}
- } else if(func.equals(NonReserved.AVG)) {
+ break;
+ case AVG:
if(! caps.supportsCapability(Capability.QUERY_AGGREGATES_AVG)) {
return false;
}
- } else if(func.equals(NonReserved.MIN)) {
+ break;
+ case MIN:
if(! caps.supportsCapability(Capability.QUERY_AGGREGATES_MIN)) {
return false;
}
- } else if(func.equals(NonReserved.MAX)) {
+ break;
+ case MAX:
if(! caps.supportsCapability(Capability.QUERY_AGGREGATES_MAX)) {
return false;
}
+ break;
+ default:
+ if (aggregate.isEnhancedNumeric()) {
+ if (!caps.supportsCapability(Capability.QUERY_AGGREGATES_ENHANCED_NUMERIC)) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ break;
}
// Check DISTINCT if necessary
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleCleanCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleCleanCriteria.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleCleanCriteria.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -22,7 +22,7 @@
package org.teiid.query.optimizer.relational.rules;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
+import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.api.exception.query.QueryPlannerException;
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
@@ -83,7 +83,7 @@
//none of the following exceptions should ever occur
} catch(BlockedException e) {
throw new TeiidComponentException(e);
- } catch (CriteriaEvaluationException e) {
+ } catch (ExpressionEvaluationException e) {
throw new TeiidComponentException(e);
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -76,12 +76,14 @@
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
import org.teiid.query.sql.symbol.SingleElementSymbol;
+import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.AggregateSymbolCollectorVisitor;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.sql.visitor.ExpressionMappingVisitor;
import org.teiid.query.sql.visitor.GroupsUsedByElementsVisitor;
import org.teiid.query.util.CommandContext;
+import org.teiid.translator.SourceSystemFunctions;
/**
@@ -191,9 +193,10 @@
SymbolMap parentMap = (SymbolMap)child.getProperty(NodeConstants.Info.SYMBOL_MAP);
List<ElementSymbol> virtualElements = parentMap.getKeys();
+ List<SingleElementSymbol> copy = new ArrayList<SingleElementSymbol>(aggregates);
+ aggregates.clear();
+ Map<AggregateSymbol, Expression> aggMap = buildAggregateMap(copy, metadata, aggregates);
- Map<AggregateSymbol, Expression> aggMap = buildAggregateMap(new ArrayList<SingleElementSymbol>(aggregates), metadata, aggregates);
-
boolean shouldPushdown = false;
List<Boolean> pushdownList = new ArrayList<Boolean>(unionChildren.size());
for (PlanNode planNode : unionChildren) {
@@ -351,11 +354,15 @@
if (pushdown) {
projectedViewSymbols.add(agg);
} else {
- if (agg.getAggregateFunction().equals(NonReserved.COUNT)) {
- SearchedCaseExpression count = new SearchedCaseExpression(Arrays.asList(new IsNullCriteria(agg.getExpression())), Arrays.asList(new Constant(Integer.valueOf(0))));
- count.setElseExpression(new Constant(Integer.valueOf(1)));
- count.setType(DataTypeManager.DefaultDataClasses.INTEGER);
- projectedViewSymbols.add(new ExpressionSymbol("stagedAgg", count)); //$NON-NLS-1$
+ if (agg.getAggregateFunction() == Type.COUNT) {
+ if (agg.getExpression() == null) {
+ projectedViewSymbols.add(new ExpressionSymbol("stagedAgg", new Constant(1))); //$NON-NLS-1$
+ } else {
+ SearchedCaseExpression count = new SearchedCaseExpression(Arrays.asList(new IsNullCriteria(agg.getExpression())), Arrays.asList(new Constant(Integer.valueOf(0))));
+ count.setElseExpression(new Constant(Integer.valueOf(1)));
+ count.setType(DataTypeManager.DefaultDataClasses.INTEGER);
+ projectedViewSymbols.add(new ExpressionSymbol("stagedAgg", count)); //$NON-NLS-1$
+ }
} else { //min, max, sum
Expression ex = agg.getExpression();
ex = ResolverUtil.convertExpression(ex, DataTypeManager.getDataTypeName(agg.getType()), metadata);
@@ -668,20 +675,18 @@
Expression newExpression = null;
- String aggFunction = partitionAgg.getAggregateFunction();
- if (aggFunction.equals(NonReserved.COUNT)) {
+ Type aggFunction = partitionAgg.getAggregateFunction();
+ if (aggFunction == Type.COUNT) {
//COUNT(x) -> CONVERT(SUM(COUNT(x)), INTEGER)
AggregateSymbol newAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, partitionAgg); //$NON-NLS-1$
// Build conversion function to convert SUM (which returns LONG) back to INTEGER
- Constant convertTargetType = new Constant(DataTypeManager.getDataTypeName(partitionAgg.getType()),
- DataTypeManager.DefaultDataClasses.STRING);
- Function convertFunc = new Function(FunctionLibrary.CONVERT, new Expression[] {newAgg, convertTargetType});
+ Function convertFunc = new Function(FunctionLibrary.CONVERT, new Expression[] {newAgg, new Constant(DataTypeManager.getDataTypeName(partitionAgg.getType()))});
ResolverVisitor.resolveLanguageObject(convertFunc, metadata);
newExpression = convertFunc;
nestedAggregates.add(partitionAgg);
- } else if (aggFunction.equals(NonReserved.AVG)) {
+ } else if (aggFunction == Type.AVG) {
//AVG(x) -> SUM(SUM(x)) / SUM(COUNT(x))
AggregateSymbol countAgg = new AggregateSymbol("stagedAgg", NonReserved.COUNT, false, partitionAgg.getExpression()); //$NON-NLS-1$
AggregateSymbol sumAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, partitionAgg.getExpression()); //$NON-NLS-1$
@@ -689,15 +694,56 @@
AggregateSymbol sumSumAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, sumAgg); //$NON-NLS-1$
AggregateSymbol sumCountAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, countAgg); //$NON-NLS-1$
- Function divideFunc = new Function("/", new Expression[] {sumSumAgg, sumCountAgg}); //$NON-NLS-1$
+ Expression convertedSum = new Function(FunctionLibrary.CONVERT, new Expression[] {sumSumAgg, new Constant(DataTypeManager.getDataTypeName(partitionAgg.getType()))});
+ Expression convertCount = new Function(FunctionLibrary.CONVERT, new Expression[] {sumCountAgg, new Constant(DataTypeManager.getDataTypeName(partitionAgg.getType()))});
+
+ Function divideFunc = new Function("/", new Expression[] {convertedSum, convertCount}); //$NON-NLS-1$
ResolverVisitor.resolveLanguageObject(divideFunc, metadata);
newExpression = divideFunc;
nestedAggregates.add(countAgg);
nestedAggregates.add(sumAgg);
+ } else if (partitionAgg.isEnhancedNumeric()) {
+ //e.g. STDDEV_SAMP := CASE WHEN COUNT(X) > 1 THEN SQRT((SUM(X^2) - SUM(X)^2/COUNT(X))/(COUNT(X) - 1))
+ AggregateSymbol countAgg = new AggregateSymbol("stagedAgg", NonReserved.COUNT, false, partitionAgg.getExpression()); //$NON-NLS-1$
+ AggregateSymbol sumAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, partitionAgg.getExpression()); //$NON-NLS-1$
+ AggregateSymbol sumSqAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, new Function(SourceSystemFunctions.POWER, new Expression[] {partitionAgg.getExpression(), new Constant(2)})); //$NON-NLS-1$
+
+ AggregateSymbol sumSumAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, sumAgg); //$NON-NLS-1$
+ AggregateSymbol sumCountAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, countAgg); //$NON-NLS-1$
+ AggregateSymbol sumSumSqAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, sumSqAgg); //$NON-NLS-1$
+
+ Expression convertedSum = new Function(FunctionLibrary.CONVERT, new Expression[] {sumSumAgg, new Constant(DataTypeManager.DefaultDataTypes.DOUBLE)});
+
+ Function divideFunc = new Function(SourceSystemFunctions.DIVIDE_OP, new Expression[] {new Function(SourceSystemFunctions.POWER, new Expression[] {convertedSum, new Constant(2)}), sumCountAgg});
+
+ Function minusFunc = new Function(SourceSystemFunctions.SUBTRACT_OP, new Expression[] {sumSumSqAgg, divideFunc});
+ Expression divisor = null;
+ if (aggFunction == Type.STDDEV_SAMP || aggFunction == Type.VAR_SAMP) {
+ divisor = new Function(SourceSystemFunctions.SUBTRACT_OP, new Expression[] {sumCountAgg, new Constant(1)});
+ } else {
+ divisor = sumCountAgg;
+ }
+ Expression result = new Function(SourceSystemFunctions.DIVIDE_OP, new Expression[] {minusFunc, divisor});
+ if (aggFunction == Type.STDDEV_POP || aggFunction == Type.STDDEV_SAMP) {
+ result = new Function(SourceSystemFunctions.SQRT, new Expression[] {result});
+ } else {
+ result = new Function(FunctionLibrary.CONVERT, new Expression[] {result, new Constant(DataTypeManager.DefaultDataTypes.DOUBLE)});
+ }
+ Expression n = new Constant(0);
+ if (aggFunction == Type.STDDEV_SAMP || aggFunction == Type.VAR_SAMP) {
+ n = new Constant(1);
+ }
+ result = new SearchedCaseExpression(Arrays.asList(new CompareCriteria(sumCountAgg, CompareCriteria.GT, n)), Arrays.asList(result));
+ ResolverVisitor.resolveLanguageObject(result, metadata);
+
+ newExpression = result;
+ nestedAggregates.add(countAgg);
+ nestedAggregates.add(sumAgg);
+ nestedAggregates.add(sumSqAgg);
} else {
//AGG(X) -> AGG(AGG(X))
- newExpression = new AggregateSymbol("stagedAgg", aggFunction, false, partitionAgg); //$NON-NLS-1$
+ newExpression = new AggregateSymbol("stagedAgg", aggFunction.name(), false, partitionAgg); //$NON-NLS-1$
nestedAggregates.add(partitionAgg);
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -33,7 +33,6 @@
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.util.Assertion;
-import org.teiid.language.SQLConstants.NonReserved;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
@@ -277,8 +276,13 @@
static boolean areAggregatesCardinalityDependent(Set<AggregateSymbol> aggs) {
for (AggregateSymbol aggregateSymbol : aggs) {
- if (aggregateSymbol.getAggregateFunction().equalsIgnoreCase(NonReserved.COUNT) ||
- aggregateSymbol.getAggregateFunction().equalsIgnoreCase(NonReserved.AVG)) {
+ switch (aggregateSymbol.getAggregateFunction()) {
+ case COUNT:
+ case AVG:
+ case STDDEV_POP:
+ case STDDEV_SAMP:
+ case VAR_POP:
+ case VAR_SAMP:
return true;
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/parser/ParseInfo.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/parser/ParseInfo.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/parser/ParseInfo.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -22,15 +22,14 @@
package org.teiid.query.parser;
+import java.util.HashMap;
+import java.util.Map;
+
public class ParseInfo {
- public int anonExprCount = 0;
- public int anonCountCount = 0;
- public int anonSumCount = 0;
- public int anonAvgCount = 0;
- public int anonMinCount = 0;
- public int anonMaxCount = 0;
+ public Map<String, Integer> nameCounts = new HashMap<String, Integer>();
+
public int referenceCount = 0;
// This gets set according to the current clause
Modified: trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -28,7 +28,6 @@
import org.teiid.core.util.Assertion;
import org.teiid.core.util.StringUtil;
-import org.teiid.language.SQLConstants.NonReserved;
import org.teiid.language.SQLConstants.Reserved;
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.lang.Command;
@@ -234,37 +233,18 @@
* @param functionType Null for expression, the function name for aggregates
* @return New unique function name
*/
- String generateFunctionName(ParseInfo info, String functionType) throws ParseException {
- if(functionType == null) {
- int num = info.anonExprCount++;
- return "expr" + (num == 0 ? "" : ""+num); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- } else if(functionType.equals(NonReserved.COUNT)) {
- int num = info.anonCountCount++;
- return "count" + (num == 0 ? "" : ""+num);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- } else if(functionType.equals(NonReserved.SUM)) {
- int num = info.anonSumCount++;
- return "sum" + (num == 0 ? "" : ""+num);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- } else if(functionType.equals(NonReserved.AVG)) {
- int num = info.anonAvgCount++;
- return "avg" + (num == 0 ? "" : ""+num);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- } else if(functionType.equals(NonReserved.MIN)) {
- int num = info.anonMinCount++;
- return "min" + (num == 0 ? "" : ""+num);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- } else if(functionType.equals(NonReserved.MAX)) {
- int num = info.anonMaxCount++;
- return "max" + (num == 0 ? "" : ""+num);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else if(functionType.equals(Reserved.XMLAGG)) {
- int num = info.anonMaxCount++;
- return "xmlagg" + (num == 0 ? "" : ""+num);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else {
- Object[] params = new Object[] { functionType };
- throw new ParseException(QueryPlugin.Util.getString("SQLParser.Unknown_agg_func", params)); //$NON-NLS-1$
+ String generateFunctionName(ParseInfo info, String functionType) {
+ if (functionType == null) {
+ functionType = "expr"; //$NON-NLS-1$
+ } else {
+ functionType = functionType.toLowerCase();
+ }
+ Integer num = info.nameCounts.get(functionType);
+ if (num == null) {
+ num = 0;
}
+ info.nameCounts.put(functionType, num + 1);
+ return functionType + (num == 0 ? "" : ""+num); //$NON-NLS-1$ //$NON-NLS-2$
}
int getOperator(String opString) {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -27,7 +27,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.api.exception.query.QueryValidatorException;
import org.teiid.client.plan.PlanNode;
@@ -116,7 +115,7 @@
static boolean prepareCommand(Command atomicCommand, RelationalNode node, CommandContext context, QueryMetadataInterface metadata)
throws ExpressionEvaluationException, TeiidComponentException,
- TeiidProcessingException, CriteriaEvaluationException {
+ TeiidProcessingException {
try {
// Defect 16059 - Rewrite the command once the references have been replaced with values.
QueryRewriter.evaluateAndRewrite(atomicCommand, node.getDataManager(), context, metadata);
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -47,6 +47,7 @@
import org.teiid.query.function.aggregate.Count;
import org.teiid.query.function.aggregate.Max;
import org.teiid.query.function.aggregate.Min;
+import org.teiid.query.function.aggregate.StatsFunction;
import org.teiid.query.function.aggregate.Sum;
import org.teiid.query.function.aggregate.XMLAgg;
import org.teiid.query.processor.ProcessorDataManager;
@@ -57,6 +58,7 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.SingleElementSymbol;
+import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.util.CommandContext;
@@ -162,20 +164,30 @@
Expression ex = aggSymbol.getExpression();
inputType = ex.getType();
int index = collectExpression(ex);
- String function = aggSymbol.getAggregateFunction();
- if(function.equals(NonReserved.COUNT)) {
- functions[i] = new Count();
- } else if(function.equals(NonReserved.SUM)) {
- functions[i] = new Sum();
- } else if(function.equals(NonReserved.AVG)) {
- functions[i] = new Avg();
- } else if(function.equals(NonReserved.MIN)) {
- functions[i] = new Min();
- } else if (function.equals(NonReserved.MAX)){
- functions[i] = new Max();
- } else {
- functions[i] = new XMLAgg(context);
- }
+ Type function = aggSymbol.getAggregateFunction();
+ switch (function) {
+ case COUNT:
+ functions[i] = new Count();
+ break;
+ case SUM:
+ functions[i] = new Sum();
+ break;
+ case AVG:
+ functions[i] = new Avg();
+ break;
+ case MIN:
+ functions[i] = new Min();
+ break;
+ case MAX:
+ functions[i] = new Max();
+ break;
+ case XMLAGG:
+ functions[i] = new XMLAgg(context);
+ break;
+ default:
+ functions[i] = new StatsFunction(function);
+
+ }
if(aggSymbol.isDistinct() && !function.equals(NonReserved.MIN) && !function.equals(NonReserved.MAX)) {
SortingFilter filter = new SortingFilter(functions[i], getBufferManager(), getConnectionID(), true);
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -28,7 +28,7 @@
import java.util.List;
import java.util.Map;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
+import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.client.plan.PlanNode;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
@@ -289,7 +289,7 @@
return this.joinCriteria;
}
- boolean matchesCriteria(List outputTuple) throws BlockedException, TeiidComponentException, CriteriaEvaluationException {
+ boolean matchesCriteria(List outputTuple) throws BlockedException, TeiidComponentException, ExpressionEvaluationException {
return (this.joinCriteria == null || getEvaluator(this.combinedElementMap).evaluate(this.joinCriteria, outputTuple));
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinStrategy.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinStrategy.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinStrategy.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -25,7 +25,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
import org.teiid.common.buffer.BufferManager.BufferReserveMode;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
@@ -84,7 +83,7 @@
return combinedRow;
}
- protected abstract void process() throws TeiidComponentException, CriteriaEvaluationException, TeiidProcessingException;
+ protected abstract void process() throws TeiidComponentException, TeiidProcessingException;
public abstract JoinStrategy clone();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/MergeJoinStrategy.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/MergeJoinStrategy.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/MergeJoinStrategy.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -24,7 +24,6 @@
import java.util.List;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.processor.relational.SourceState.ImplicitBuffer;
@@ -137,7 +136,7 @@
@Override
protected void process() throws TeiidComponentException,
- CriteriaEvaluationException, TeiidProcessingException {
+ TeiidProcessingException {
while (this.mergeState != MergeState.DONE) {
while (this.mergeState == MergeState.SCAN) {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/NestedTableJoinStrategy.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/NestedTableJoinStrategy.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/NestedTableJoinStrategy.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -25,7 +25,6 @@
import java.util.List;
import java.util.Map;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
import org.teiid.common.buffer.IndexedTupleSource;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
@@ -88,7 +87,7 @@
@Override
protected void process() throws TeiidComponentException,
- CriteriaEvaluationException, TeiidProcessingException {
+ TeiidProcessingException {
if (leftMap != null && !leftSource.open) {
for (Map.Entry<ElementSymbol, Expression> entry : leftMap.asMap().entrySet()) {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/PartitionedSortJoin.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/PartitionedSortJoin.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/PartitionedSortJoin.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -26,7 +26,6 @@
import java.util.Comparator;
import java.util.List;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
import org.teiid.common.buffer.IndexedTupleSource;
import org.teiid.common.buffer.TupleBatch;
import org.teiid.common.buffer.TupleBuffer;
@@ -222,7 +221,7 @@
@Override
protected void process() throws TeiidComponentException,
- CriteriaEvaluationException, TeiidProcessingException {
+ TeiidProcessingException {
if (this.processingSortLeft != SortOption.PARTITION && this.processingSortRight != SortOption.PARTITION) {
super.process();
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -22,7 +22,7 @@
package org.teiid.query.processor.relational;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
+import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.eval.Evaluator;
@@ -55,9 +55,10 @@
* @throws TeiidComponentException
* @throws BlockedException
* @throws TeiidComponentException
+ * @throws ExpressionEvaluationException
* @since 4.2
*/
- private static boolean evaluateCriteria(Criteria criteria) throws CriteriaEvaluationException, TeiidComponentException {
+ private static boolean evaluateCriteria(Criteria criteria) throws TeiidComponentException, ExpressionEvaluationException {
if(criteria == null) {
return true;
}
@@ -72,9 +73,10 @@
* @param simplifyCriteria wheter to simplify the criteria of the command if they always evaluate to true
* @return true if this command should be executed by the connector; false otherwise.
* @throws TeiidComponentException
+ * @throws ExpressionEvaluationException
* @since 4.2
*/
- public static boolean shouldExecute(Command command, boolean simplifyCriteria) throws CriteriaEvaluationException, TeiidComponentException {
+ public static boolean shouldExecute(Command command, boolean simplifyCriteria) throws TeiidComponentException, ExpressionEvaluationException {
int cmdType = command.getType();
Criteria criteria = null;
switch(cmdType) {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/CriteriaCondition.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/CriteriaCondition.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/CriteriaCondition.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -28,7 +28,7 @@
import java.util.List;
import java.util.Map;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
+import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.eval.Evaluator;
@@ -80,7 +80,7 @@
try {
return new Evaluator(elementMap, env.getDataManager(), env.getProcessorContext()).evaluate(this.criteria, data);
- } catch (CriteriaEvaluationException e) {
+ } catch (ExpressionEvaluationException e) {
throw new TeiidComponentException(e);
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -41,7 +41,7 @@
import java.util.Set;
import java.util.StringTokenizer;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
+import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryResolverException;
@@ -138,6 +138,7 @@
import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
import org.teiid.query.sql.symbol.SingleElementSymbol;
+import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.util.ValueIterator;
import org.teiid.query.sql.visitor.AggregateSymbolCollectorVisitor;
@@ -1131,7 +1132,7 @@
return FALSE_CRITERIA;
- } catch(CriteriaEvaluationException e) {
+ } catch(ExpressionEvaluationException e) {
throw new QueryValidatorException(e, ErrorMessageKeys.REWRITER_0001, QueryExecPlugin.Util.getString(ErrorMessageKeys.REWRITER_0001, crit));
}
}
@@ -1920,8 +1921,14 @@
}
private Expression rewriteExpression(AggregateSymbol expression) {
- if (!expression.getAggregateFunction().equals(NonReserved.COUNT)
- && !expression.getAggregateFunction().equals(NonReserved.SUM)
+ if (expression.isBoolean()) {
+ if (expression.getAggregateFunction() == Type.EVERY) {
+ expression.setAggregateFunction(Type.MIN);
+ } else {
+ expression.setAggregateFunction(Type.MAX);
+ }
+ }
+ if ((expression.getAggregateFunction() == Type.MAX || expression.getAggregateFunction() == Type.MIN)
&& EvaluatableVisitor.willBecomeConstant(expression.getExpression())) {
try {
return new ExpressionSymbol(expression.getName(), ResolverUtil
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -24,7 +24,7 @@
import java.util.Arrays;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
+import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.core.util.EquivalenceUtil;
import org.teiid.core.util.HashCodeUtil;
import org.teiid.query.QueryPlugin;
@@ -250,7 +250,7 @@
this.newWildCard = newWildCard;
}
- public StringBuffer translate(String pattern, char escape) throws CriteriaEvaluationException {
+ public StringBuffer translate(String pattern, char escape) throws ExpressionEvaluationException {
StringBuffer newPattern = new StringBuffer();
@@ -282,14 +282,14 @@
}
} else {
if (escaped) {
- throw new CriteriaEvaluationException(QueryPlugin.Util.getString("MatchCriteria.invalid_escape", new Object[] {pattern, new Character(escape)})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(QueryPlugin.Util.getString("MatchCriteria.invalid_escape", new Object[] {pattern, new Character(escape)})); //$NON-NLS-1$
}
appendCharacter(newPattern, character);
}
}
if (escaped) {
- throw new CriteriaEvaluationException(QueryPlugin.Util.getString("MatchCriteria.invalid_escape", new Object[] {pattern, new Character(escape)})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(QueryPlugin.Util.getString("MatchCriteria.invalid_escape", new Object[] {pattern, new Character(escape)})); //$NON-NLS-1$
}
return newPattern;
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -23,19 +23,13 @@
package org.teiid.query.sql.symbol;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Map;
-import java.util.Set;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.EquivalenceUtil;
import org.teiid.core.util.HashCodeUtil;
-import org.teiid.language.SQLConstants.NonReserved;
-import org.teiid.language.SQLConstants.Reserved;
-import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.lang.OrderBy;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -58,25 +52,32 @@
* bigdecimal.</p>
*/
public class AggregateSymbol extends ExpressionSymbol {
+
+ public enum Type {
+ COUNT,
+ SUM,
+ AVG,
+ MIN,
+ MAX,
+ XMLAGG,
+ ANY,
+ SOME,
+ EVERY,
+ STDDEV_POP,
+ STDDEV_SAMP,
+ VAR_POP,
+ VAR_SAMP;
+ }
- private String aggregate;
+ private Type aggregate;
private boolean distinct;
private OrderBy orderBy;
private static final Class<Integer> COUNT_TYPE = DataTypeManager.DefaultDataClasses.INTEGER;
- private static final Set<String> AGGREGATE_FUNCTIONS;
private static final Map<Class<?>, Class<?>> SUM_TYPES;
private static final Map<Class<?>, Class<?>> AVG_TYPES;
static {
- AGGREGATE_FUNCTIONS = new HashSet<String>();
- AGGREGATE_FUNCTIONS.add(NonReserved.COUNT);
- AGGREGATE_FUNCTIONS.add(NonReserved.SUM);
- AGGREGATE_FUNCTIONS.add(NonReserved.AVG);
- AGGREGATE_FUNCTIONS.add(NonReserved.MIN);
- AGGREGATE_FUNCTIONS.add(NonReserved.MAX);
- AGGREGATE_FUNCTIONS.add(Reserved.XMLAGG);
-
SUM_TYPES = new HashMap<Class<?>, Class<?>>();
SUM_TYPES.put(DataTypeManager.DefaultDataClasses.BYTE, DataTypeManager.DefaultDataClasses.LONG);
SUM_TYPES.put(DataTypeManager.DefaultDataClasses.SHORT, DataTypeManager.DefaultDataClasses.LONG);
@@ -104,10 +105,9 @@
* @param canonicalName
* @since 4.3
*/
- protected AggregateSymbol(String name, String canonicalName, String aggregateFunction, boolean isDistinct, Expression expression) {
+ protected AggregateSymbol(String name, String canonicalName, Type aggregateFunction, boolean isDistinct, Expression expression) {
super(name, canonicalName, expression);
-
- setAggregateFunction(aggregateFunction);
+ this.aggregate = aggregateFunction;
this.distinct = isDistinct;
}
@@ -120,8 +120,7 @@
*/
public AggregateSymbol(String name, String aggregateFunction, boolean isDistinct, Expression expression) {
super(name, expression);
-
- setAggregateFunction(aggregateFunction);
+ this.aggregate = Type.valueOf(aggregateFunction);
this.distinct = isDistinct;
}
@@ -135,11 +134,7 @@
* @see org.teiid.language.SQLConstants.NonReserved#MIN
* @see org.teiid.language.SQLConstants.NonReserved#MAX
*/
- private void setAggregateFunction(String aggregateFunction) {
- // Validate aggregate
- if(! AGGREGATE_FUNCTIONS.contains(aggregateFunction)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0013, new Object[] {aggregateFunction, AGGREGATE_FUNCTIONS}));
- }
+ public void setAggregateFunction(Type aggregateFunction) {
this.aggregate = aggregateFunction;
}
@@ -147,13 +142,8 @@
* Get the aggregate function type - this will map to one of the reserved words
* for the aggregate functions.
* @return Aggregate function type
- * @see org.teiid.language.SQLConstants.NonReserved#COUNT
- * @see org.teiid.language.SQLConstants.NonReserved#SUM
- * @see org.teiid.language.SQLConstants.NonReserved#AVG
- * @see org.teiid.language.SQLConstants.NonReserved#MIN
- * @see org.teiid.language.SQLConstants.NonReserved#MAX
*/
- public String getAggregateFunction() {
+ public Type getAggregateFunction() {
return this.aggregate;
}
@@ -172,19 +162,36 @@
* @return Type of the symbol
*/
public Class<?> getType() {
- if(this.aggregate.equals(NonReserved.COUNT)) {
+ if(this.aggregate == Type.COUNT) {
return COUNT_TYPE;
- } else if(this.aggregate.equals(NonReserved.SUM) ) {
+ } else if(this.aggregate == Type.SUM ) {
Class<?> expressionType = this.getExpression().getType();
return SUM_TYPES.get(expressionType);
- } else if (this.aggregate.equals(NonReserved.AVG)) {
+ } else if (this.aggregate == Type.AVG) {
Class<?> expressionType = this.getExpression().getType();
return AVG_TYPES.get(expressionType);
+ } else if (isBoolean()) {
+ return DataTypeManager.DefaultDataClasses.BOOLEAN;
+ } else if (isEnhancedNumeric()) {
+ return DataTypeManager.DefaultDataClasses.DOUBLE;
} else {
return this.getExpression().getType();
}
}
+ public boolean isBoolean() {
+ return this.aggregate == Type.EVERY
+ || this.aggregate == Type.SOME
+ || this.aggregate == Type.ANY;
+ }
+
+ public boolean isEnhancedNumeric() {
+ return this.aggregate == Type.STDDEV_POP
+ || this.aggregate == Type.STDDEV_SAMP
+ || this.aggregate == Type.VAR_SAMP
+ || this.aggregate == Type.VAR_POP;
+ }
+
public void acceptVisitor(LanguageVisitor visitor) {
visitor.visit(this);
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -1095,7 +1095,7 @@
// ############ Visitor methods for symbol objects ####################
public void visit(AggregateSymbol obj) {
- parts.add(obj.getAggregateFunction());
+ parts.add(obj.getAggregateFunction().name());
parts.add("("); //$NON-NLS-1$
if(obj.isDistinct()) {
Modified: trunk/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -26,8 +26,6 @@
import java.util.Set;
import org.teiid.core.types.DataTypeManager;
-import org.teiid.language.SQLConstants.NonReserved;
-import org.teiid.language.SQLConstants.Reserved;
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.navigator.PreOrderNavigator;
@@ -38,12 +36,11 @@
import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
+import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.visitor.AggregateSymbolCollectorVisitor;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.util.ErrorMessageKeys;
-
-
/**
* Validate that all ElementSymbol and ExpressionSymbols used in the HAVING
* and SELECT clauses are based on symbols used in the GROUP BY clause.
@@ -72,15 +69,27 @@
}
// Verify data type of aggregate expression
- String aggregateFunction = obj.getAggregateFunction();
- if((aggregateFunction.equals(NonReserved.SUM) || aggregateFunction.equals(NonReserved.AVG)) && obj.getType() == null) {
+ Type aggregateFunction = obj.getAggregateFunction();
+ if((aggregateFunction == Type.SUM || aggregateFunction == Type.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 == Type.XMLAGG && aggExp.getType() != DataTypeManager.DefaultDataClasses.XML) {
+ handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_xml", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
+ } else if (obj.isBoolean() && aggExp.getType() != DataTypeManager.DefaultDataClasses.BOOLEAN) {
+ handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_boolean", 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()))) {
+ if((obj.isDistinct() || aggregateFunction == Type.MIN || aggregateFunction == Type.MAX) && DataTypeManager.isNonComparable(DataTypeManager.getDataTypeName(aggExp.getType()))) {
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_comparable", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
}
+ if(obj.isEnhancedNumeric()) {
+ if (!Number.class.isAssignableFrom(aggExp.getType())) {
+ handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0041, new Object[] {aggregateFunction, obj}), obj);
+ }
+ if (obj.isDistinct()) {
+ handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.invalid_distinct", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
+ }
+ }
validateBelow = false;
}
Modified: trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2010-06-22 18:58:30 UTC (rev 2276)
@@ -1638,7 +1638,7 @@
String func = null;
if(expression instanceof AggregateSymbol) {
es = (AggregateSymbol)expression;
- func = ((AggregateSymbol)expression).getAggregateFunction();
+ func = ((AggregateSymbol)expression).getAggregateFunction().name();
} else {
String functionName = generateFunctionName(info, null);
es = new ExpressionSymbol(functionName, expression);
@@ -1725,9 +1725,14 @@
<RPAREN> ) |
// Remaining aggregates
- ( func = nonReserved("COUNT", "SUM", "AVG", "MIN", "MAX")
+ ( (func = nonReserved("COUNT", "SUM", "AVG", "MIN", "MAX", "EVERY", "STDDEV_POP", "STDDEV_SAMP", "VAR_SAMP", "VAR_POP")
+ |
+ <ANY> { func = "ANY"; }
+ |
+ <SOME> { func = "SOME"; }
+ )
<LPAREN>
- [ <DISTINCT> {isDistinct=true;} ]
+ [ <DISTINCT> {isDistinct=true;} | <ALL>]
expression = expression(info)
<RPAREN>
)
@@ -1799,30 +1804,17 @@
(
(
<LBRACE> nonReserved("OJ")
- result=tableReferenceUnescaped(info)
+ result=joinedTable(info)
<RBRACE>
)
|
- result=tableReferenceUnescaped(info)
+ result=joinedTable(info)
)
{
return result;
}
}
-FromClause tableReferenceUnescaped(ParseInfo info) :
-{
- FromClause result = null;
-}
-{
- ( LOOKAHEAD(tablePrimary(info) ((<UNION><JOIN>)|<CROSS>|<LEFT>|<RIGHT>|<INNER>|<FULL>|<JOIN>)) result = joinedTable(info)
- | result = tablePrimary(info)
- )
- {
- return result;
- }
-}
-
FromClause joinedTable(ParseInfo info) :
{
FromClause result = null;
@@ -1838,7 +1830,7 @@
jp.setLeftClause(result);
result = jp;
}
- ) +
+ ) *
{
return result;
}
@@ -1895,11 +1887,11 @@
|
LOOKAHEAD(subqueryFromClause(info)) clause = subqueryFromClause(info)
|
- ( lparen = <LPAREN> clause = joinedTable(info)
- {
+ (lparen = <LPAREN> clause = joinedTable(info)
+ {
setFromClauseOptions(lparen, clause);
- }
- <RPAREN>
+ }
+ <RPAREN>
)
)
[ (<MAKEDEP> { clause.setMakeDep(true); })
@@ -2341,7 +2333,7 @@
}
{
[<NOT> {isNot=true;}]
- crit=primary(info)
+ crit=booleanPrimary(info)
{
if(isNot) {
@@ -2358,7 +2350,7 @@
* @return Parsed primary criteria
* @throws ParseException if parsing failed
*/
-Criteria primary(ParseInfo info) :
+Criteria booleanPrimary(ParseInfo info) :
{
Criteria crit = null;
}
@@ -2380,46 +2372,63 @@
PredicateCriteria predicate(ParseInfo info) :
{
PredicateCriteria pdCrit = null;
+ Expression ex = null;
}
{
- ( LOOKAHEAD(subqueryCompareCriteria(info)) pdCrit=subqueryCompareCriteria(info) |
- LOOKAHEAD(compareCrit(info)) pdCrit=compareCrit(info) |
- LOOKAHEAD(matchCrit(info)) pdCrit=matchCrit(info) |
- LOOKAHEAD(betweenCrit(info)) pdCrit=betweenCrit(info) |
- LOOKAHEAD(setCrit(info)) pdCrit=setCrit(info) |
- LOOKAHEAD(existsCriteria(info)) pdCrit=existsCriteria(info) |
- pdCrit = hasCriteria() |
- LOOKAHEAD(translateCriteria(info)) pdCrit = translateCriteria(info) |
- pdCrit = isNullCrit(info)
- )
-
+ (
+ LOOKAHEAD(2) pdCrit = translateCriteria(info)
+ |
+ (ex = commonValueExpression(info)
+ (
+ LOOKAHEAD(2) pdCrit=betweenCrit(info, ex) |
+ LOOKAHEAD(2) pdCrit=matchCrit(info, ex) |
+ pdCrit=setCrit(info, ex) |
+ pdCrit = isNullCrit(info, ex) |
+ LOOKAHEAD(operator() expression(info)) pdCrit=compareCrit(info, ex) |
+ pdCrit=subqueryCompareCriteria(info, ex)
+ )
+ )
+ |
+ pdCrit=existsCriteria(info) |
+ pdCrit = hasCriteria()
+ )
{
return pdCrit;
}
}
+Token operator() :
+{
+ Token operator = null;
+}
+{
+ (operator=<EQ> |
+ operator=<NE> |
+ operator=<NE2> |
+ operator=<LT> |
+ operator=<LE> |
+ operator=<GT> |
+ operator=<GE>
+ )
+ {
+ return operator;
+ }
+}
+
+
/**
* <p>Parse a compare criteria.</p>
* @return Parsed compare criteria
* @throws ParseException if parsing failed
*/
-CompareCriteria compareCrit(ParseInfo info) :
+CompareCriteria compareCrit(ParseInfo info, Expression expression) :
{
- Expression expression = null;
Expression value = null;
Token operator = null;
}
{
- expression=expression(info)
- ( operator=<EQ> |
- operator=<NE> |
- operator=<NE2> |
- operator=<LT> |
- operator=<LE> |
- operator=<GT> |
- operator=<GE>
- )
- value=expression(info)
+ operator=operator()
+ value=commonValueExpression(info)
{
CompareCriteria compareCriteria = new CompareCriteria();
@@ -2455,9 +2464,8 @@
* @return Parsed subquery compare criteria
* @throws ParseException if parsing failed
*/
-SubqueryCompareCriteria subqueryCompareCriteria(ParseInfo info) :
+SubqueryCompareCriteria subqueryCompareCriteria(ParseInfo info, Expression expression) :
{
- Expression expression = null;
SubqueryCompareCriteria subqueryCrit = null;
Command subquery = null;
Token operator = null;
@@ -2465,15 +2473,7 @@
}
{
- expression=expression(info)
- ( operator=<EQ> |
- operator=<NE> |
- operator=<NE2> |
- operator=<LT> |
- operator=<LE> |
- operator=<GT> |
- operator=<GE>
- )
+ operator=operator()
( quantifier=<ANY> |
quantifier=<SOME> |
quantifier=<ALL>
@@ -2508,22 +2508,19 @@
* @return Parsed match criteria
* @throws ParseException if parsing failed
*/
-MatchCriteria matchCrit(ParseInfo info) :
+MatchCriteria matchCrit(ParseInfo info, Expression expression) :
{
Character esc = null;
- Expression expression = null;
Expression value = null;
boolean negated = false;
}
{
- ( expression=expression(info)
- [<NOT> {negated = true;}]
- <LIKE>
- value=expression(info)
- [ <ESCAPE> esc = charVal(info, "LIKE ESCAPE") |
- (<LBRACE> <ESCAPE> esc = charVal(info, "LIKE ESCAPE") <RBRACE>)
- ]
- )
+ [<NOT> {negated = true;}]
+ <LIKE>
+ value=commonValueExpression(info)
+ [ <ESCAPE> esc = charVal(info, "LIKE ESCAPE") |
+ (<LBRACE> <ESCAPE> esc = charVal(info, "LIKE ESCAPE") <RBRACE>)
+ ]
{
MatchCriteria matchcriteria = new MatchCriteria(expression, value);
matchcriteria.setNegated(negated);
@@ -2553,18 +2550,17 @@
* @return Parsed BETWEEN criteria
* @throws ParseException if parsing failed
*/
-BetweenCriteria betweenCrit(ParseInfo info) :
+BetweenCriteria betweenCrit(ParseInfo info, Expression expression) :
{
- Expression expression = null, lowerExpression = null, upperExpression = null;
+ Expression lowerExpression = null, upperExpression = null;
boolean negated = false;
}
{
- expression = expression(info)
[<NOT> {negated=true;}]
<BETWEEN>
- lowerExpression = expression(info)
+ lowerExpression = commonValueExpression(info)
<AND>
- upperExpression = expression(info)
+ upperExpression = commonValueExpression(info)
{
BetweenCriteria criteria = new BetweenCriteria(expression, lowerExpression, upperExpression);
@@ -2578,14 +2574,12 @@
* @return Parsed IS NULL criteria
* @throws ParseException if parsing failed
*/
-IsNullCriteria isNullCrit(ParseInfo info) :
+IsNullCriteria isNullCrit(ParseInfo info, Expression expression) :
{
- Expression expression = null;
boolean negated = false;
IsNullCriteria criteria = null;
}
{
- expression=expression(info)
<IS>
[<NOT> {negated = true;}]
<NULL>
@@ -2602,9 +2596,8 @@
* @return Parsed set criteria
* @throws ParseException if parsing failed
*/
-AbstractSetCriteria setCrit(ParseInfo info) :
+AbstractSetCriteria setCrit(ParseInfo info, Expression expression) :
{
- Expression expression = null;
Expression value = null;
List setList = new ArrayList();
Command command = null;
@@ -2612,19 +2605,18 @@
AbstractSetCriteria criteria = null;
}
{
- expression=expression(info)
[<NOT> {negated = true;}]
<IN>
(
LOOKAHEAD(subquery(info)) (command = subquery(info)) |
(
<LPAREN>
- value = expression(info)
+ value = commonValueExpression(info)
{
setList.add(value);
}
( <COMMA>
- value = expression(info)
+ value = commonValueExpression(info)
{
setList.add(value);
}
@@ -2909,18 +2901,13 @@
Expression expression = null;
}
{
- expression = concatExpression(info)
+ expression = commonValueExpression(info)
{
return expression;
}
}
-/**
- * <p>Parse an expression - made up of literals and functions.</p>
- * @return Expression
- * @throws ParseException if parsing failed
- */
-Expression concatExpression(ParseInfo info) :
+Expression commonValueExpression(ParseInfo info) :
{
Expression leftExpression = null;
Expression rightExpression = null;
@@ -3002,10 +2989,10 @@
String operator = null;
}
{
- ( leftExpression=basicExpression(info)
+ ( leftExpression=valueExpressionPrimary(info)
(
operator=timesOperator()
- rightExpression=basicExpression(info)
+ rightExpression=valueExpressionPrimary(info)
{
leftExpression = new Function(operator, new Expression[] {leftExpression, rightExpression});
rightExpression = null;
@@ -3043,7 +3030,7 @@
* @return Expression
* @throws ParseException if parsing failed
*/
-Expression basicExpression(ParseInfo info) :
+Expression valueExpressionPrimary(ParseInfo info) :
{
Token refToken = null;
Expression expression = null;
@@ -3066,8 +3053,12 @@
)
|
// Aggregate function
- LOOKAHEAD(<ID>, {matchesAny(getToken(1).image, "count", "min", "max", "sum", "avg") != null}) (expression=aggregateSymbol(info))
+ LOOKAHEAD(<ID>, {matchesAny(getToken(1).image, "count", "min", "max", "sum", "avg", "every", "STDDEV_POP", "STDDEV_SAMP", "VAR_SAMP", "VAR_POP") != null}) (expression=aggregateSymbol(info))
|
+ LOOKAHEAD(<ANY>) (expression=aggregateSymbol(info))
+ |
+ LOOKAHEAD(<SOME>) (expression=aggregateSymbol(info))
+ |
(expression=xmlAgg(info))
|
// Function
@@ -3093,11 +3084,11 @@
|
subquery = subquery(info)
|
- // Non-searched CASE expressions
- LOOKAHEAD(caseExpression(info)) expression = caseExpression(info)
- |
// Searched CASE expressions
- LOOKAHEAD(searchedCaseExpression(info)) expression = searchedCaseExpression(info)
+ LOOKAHEAD(2) expression = searchedCaseExpression(info)
+ |
+ // Non-searched CASE expressions
+ expression = caseExpression(info)
)
{
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2010-06-22 18:58:30 UTC (rev 2276)
@@ -301,6 +301,8 @@
ERR.015.012.0041 = The aggregate function {0} cannot be used with non-numeric expressions: {1}
AggregateValidationVisitor.non_comparable = The aggregate function {0} cannot be used with non-comparable expressions: {1}
AggregateValidationVisitor.non_xml = The XMLAGG aggregate function {0} requires an expression of type XML: {1}
+AggregateValidationVisitor.non_boolean=The boolean aggregate functions ANY, SOME, EVERY require a boolean expression.
+AggregateValidationVisitor.invalid_distinct=The enhanced numeric aggregate functions STDDEV_POP, STDDEV_SAMP, VAR_POP, VAR_SAMP cannot have DISTINCT specified.
ERR.015.012.0042 = Cross join may not have criteria: {0}
ERR.015.012.0043 = Join must have criteria declared in the ON clause: {0}
ERR.015.012.0045 = Elements in this join criteria are not from a group involved in the join: {0}
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -35,6 +35,7 @@
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.unittest.FakeMetadataFacade;
import org.teiid.query.unittest.FakeMetadataFactory;
+import org.teiid.translator.SourceSystemFunctions;
public class TestAggregatePushdown {
@@ -287,6 +288,36 @@
});
}
+ @Test public void testStddevAggregate() throws Exception {
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = getAggregateCapabilities();
+ caps.setFunctionSupport(SourceSystemFunctions.POWER, true);
+ caps.setFunctionSupport(SourceSystemFunctions.CONVERT, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
+
+ String sql = "SELECT stddev_pop(y.e2) from pm1.g1 x, pm2.g1 y where x.e3 = y.e3 group by x.e2, y.e1"; //$NON-NLS-1$
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(), null, capFinder,
+ new String[] {"SELECT DISTINCT g_0.e3 AS c_0, g_0.e1 AS c_1, COUNT(g_0.e2) AS c_2, SUM(power(g_0.e2, 2)) AS c_3, SUM(g_0.e2) AS c_4 FROM pm2.g1 AS g_0 GROUP BY g_0.e3, g_0.e1 ORDER BY c_0", "SELECT DISTINCT g_0.e3 AS c_0, g_0.e2 AS c_1 FROM pm1.g1 AS g_0 GROUP BY g_0.e3, g_0.e2 ORDER BY c_0"}, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 2, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 1, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 1, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+ }
+
@Test public void testCountAggregate() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getAggregateCapabilities();
@@ -816,8 +847,8 @@
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", TestOptimizer.getTypicalCapabilities()); //$NON-NLS-1$
- ProcessorPlan plan = TestOptimizer.helpPlan("select max(e2) from (select e1, e2 from pm1.g1 union all select e1, e2 from pm2.g2) z", FakeMetadataFactory.example1Cached(), null, capFinder, //$NON-NLS-1$
- new String[]{"SELECT MAX(v_0.c_0) FROM (SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0) AS v_0 HAVING COUNT(*) > 0", //$NON-NLS-1$
+ ProcessorPlan plan = TestOptimizer.helpPlan("select max(e2), count(*) from (select e1, e2 from pm1.g1 union all select e1, e2 from pm2.g2) z", FakeMetadataFactory.example1Cached(), null, capFinder, //$NON-NLS-1$
+ new String[]{"SELECT MAX(v_0.c_0), COUNT(*) FROM (SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0) AS v_0 HAVING COUNT(*) > 0", //$NON-NLS-1$
"SELECT g_0.e2 FROM pm2.g2 AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
TestOptimizer.checkNodeTypes(plan, new int[] {
2, // Access
Modified: trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -29,7 +29,7 @@
import java.util.List;
import java.util.Map;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
+import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.TupleSource;
@@ -38,7 +38,6 @@
import org.teiid.query.eval.Evaluator;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataID;
-import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.resolver.util.ResolverUtil;
import org.teiid.query.sql.lang.BatchedUpdateCommand;
import org.teiid.query.sql.lang.Command;
@@ -180,7 +179,7 @@
if(new Evaluator(lookupMap, null, null).evaluate(query.getCriteria(), tuples[i])) {
filteredTuples.add(tuples[i]);
}
- } catch(CriteriaEvaluationException e) {
+ } catch(ExpressionEvaluationException e) {
throw new TeiidComponentException(e, e.getMessage());
}
}
@@ -221,7 +220,7 @@
if(new Evaluator(lookupMap, null, null).evaluate(update.getCriteria(), tuples[i])) {
updated++;
}
- } catch(CriteriaEvaluationException e) {
+ } catch(ExpressionEvaluationException e) {
throw new TeiidComponentException(e, e.getMessage());
}
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -25,6 +25,7 @@
import static org.teiid.query.processor.TestProcessor.*;
import java.math.BigDecimal;
+import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -35,11 +36,11 @@
import org.teiid.query.optimizer.TestOptimizer;
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
-import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.unittest.FakeMetadataFactory;
+import org.teiid.translator.SourceSystemFunctions;
-
+@SuppressWarnings("nls")
public class TestAggregateProcessing {
static void sampleDataBQT3(FakeDataManager dataMgr) throws Exception {
@@ -282,5 +283,71 @@
helpProcess(plan, dataManager, expected);
}
+
+ @Test public void testPushDownOverUnionMixed1() throws Exception {
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestAggregatePushdown.getAggregateCapabilities();
+ caps.setFunctionSupport(SourceSystemFunctions.POWER, true);
+ caps.setFunctionSupport(SourceSystemFunctions.CONVERT, true);
+ capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("pm1", TestOptimizer.getTypicalCapabilities()); //$NON-NLS-1$
+
+ ProcessorPlan plan = helpGetPlan(helpParse("select max(e2), count(*), stddev_pop(e2), var_samp(e2) from (select e1, e2 from pm1.g1 union all select e1, e2 from pm2.g2) z"), FakeMetadataFactory.example1Cached(), capFinder); //$NON-NLS-1$
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("SELECT g_0.e2 FROM pm1.g1 AS g_0", new List[] {Arrays.asList(1), Arrays.asList(2)});
+ dataManager.addData("SELECT MAX(v_0.c_0), COUNT(*), COUNT(v_0.c_0), SUM(power(v_0.c_0, 2)), SUM(v_0.c_0) FROM (SELECT g_0.e2 AS c_0 FROM pm2.g2 AS g_0) AS v_0 HAVING COUNT(*) > 0", new List[] {Arrays.asList(5, 6, 4, BigInteger.valueOf(50l), 10l)});
+
+ List[] expected = new List[] {
+ Arrays.asList(5, 8, 2.1213203435596424, 5.4),
+ };
+
+ helpProcess(plan, dataManager, expected);
+ }
+ @Test public void testBooleanAgg() {
+ String sql = "select every(e3), any(e3) from pm1.g1"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList(Boolean.FALSE, Boolean.TRUE),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testStatsFunctions() {
+ String sql = "select stddev_pop(e2), var_samp(e2) from pm1.g1"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList(1.0671873729054748, 1.3666666666666667),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testStatsFunctions1() {
+ String sql = "select stddev_samp(e2), var_pop(e2) from (select 2 e2) x"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList(null, 0.0),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -7570,6 +7570,6 @@
helpProcess(plan, dataManager, expected);
}
-
+
private static final boolean DEBUG = false;
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -31,7 +31,6 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.Properties;
import org.junit.Test;
import org.teiid.common.buffer.BufferManager;
@@ -46,9 +45,6 @@
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
-import org.teiid.query.processor.BatchCollector;
-import org.teiid.query.processor.ProcessorPlan;
-import org.teiid.query.processor.QueryProcessor;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.unittest.FakeMetadataFacade;
import org.teiid.query.unittest.FakeMetadataFactory;
Modified: trunk/engine/src/test/java/org/teiid/query/processor/eval/TestCriteriaEvaluator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/eval/TestCriteriaEvaluator.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/test/java/org/teiid/query/processor/eval/TestCriteriaEvaluator.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -34,7 +34,7 @@
import java.util.Map;
import org.junit.Test;
-import org.teiid.api.exception.query.CriteriaEvaluationException;
+import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
@@ -59,7 +59,7 @@
// ################################## TEST HELPERS ################################
- private void helpTestMatch(String value, String pattern, char escape, boolean negated, boolean expectedMatch) throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ private void helpTestMatch(String value, String pattern, char escape, boolean negated, boolean expectedMatch) throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
MatchCriteria crit = new MatchCriteria(new Constant(value), new Constant(pattern), escape);
crit.setNegated(negated);
boolean actualMatch = Evaluator.evaluate(crit);
@@ -67,11 +67,11 @@
assertEquals("Match criteria test failed for value=[" + value + "], pattern=[" + pattern + "], hasEscape=" + (escape != MatchCriteria.NULL_ESCAPE_CHAR) + ": ", expectedMatch, actualMatch); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
- private void helpTestMatch(String value, String pattern, char escape, boolean expectedMatch) throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ private void helpTestMatch(String value, String pattern, char escape, boolean expectedMatch) throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
helpTestMatch(value, pattern, escape, false, expectedMatch);
}
- private void helpTestIsNull(String value, boolean negated, boolean expectedMatch) throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ private void helpTestIsNull(String value, boolean negated, boolean expectedMatch) throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
IsNullCriteria criteria = new IsNullCriteria(new Constant(value));
criteria.setNegated(negated);
@@ -79,11 +79,11 @@
assertEquals("Result did not match expected value", expectedMatch, result); //$NON-NLS-1$
}
- private void helpTestSetCriteria(int value, boolean negated, boolean expectedMatch) throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ private void helpTestSetCriteria(int value, boolean negated, boolean expectedMatch) throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
helpTestSetCriteria(new Integer(value), negated, expectedMatch);
}
- private void helpTestSetCriteria(Integer value, boolean negated, boolean expectedMatch) throws CriteriaEvaluationException, BlockedException, TeiidComponentException {
+ private void helpTestSetCriteria(Integer value, boolean negated, boolean expectedMatch) throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
Collection constants = new ArrayList(2);
constants.add(new Constant(new Integer(1000)));
constants.add(new Constant(new Integer(5000)));
@@ -93,7 +93,7 @@
assertEquals("Result did not match expected value", expectedMatch, result); //$NON-NLS-1$
}
- private void helpTestCompareSubqueryCriteria(Criteria crit, boolean expectedResult, final Collection values) throws CriteriaEvaluationException, BlockedException, TeiidComponentException{
+ private void helpTestCompareSubqueryCriteria(Criteria crit, boolean expectedResult, final Collection values) throws ExpressionEvaluationException, BlockedException, TeiidComponentException{
Map elementMap = new HashMap();
ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
@@ -334,7 +334,7 @@
@Test public void testMatch49() throws Exception {
try {
helpTestMatch("abc", "a", 'a', true); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (CriteriaEvaluationException cee) {
+ } catch (ExpressionEvaluationException cee) {
assertEquals("Invalid escape sequence \"a\" with escape character \"a\"", cee.getMessage()); //$NON-NLS-1$
}
}
@@ -343,7 +343,7 @@
@Test public void testMatch50() throws Exception {
try {
helpTestMatch("abc", "ab", 'a', true); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (CriteriaEvaluationException cee) {
+ } catch (ExpressionEvaluationException cee) {
assertEquals("Invalid escape sequence \"ab\" with escape character \"a\"", cee.getMessage()); //$NON-NLS-1$
}
}
@@ -502,7 +502,7 @@
values.add("c"); //$NON-NLS-1$
try {
helpTestCompareSubqueryCriteria(crit, false, values);
- } catch (CriteriaEvaluationException e) {
+ } catch (ExpressionEvaluationException e) {
assertEquals("Error Code:ERR.015.006.0056 Message:The subquery of this compare criteria has to be scalar, but returned more than one value: e1 = (<undefined>)", e.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2010-06-22 17:21:54 UTC (rev 2275)
+++ trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2010-06-22 18:58:30 UTC (rev 2276)
@@ -2038,5 +2038,17 @@
@Test public void testDecode() throws Exception {
helpValidate("select to_bytes(e1, '?') from pm1.g1", new String[] {"to_bytes(e1, '?')"}, FakeMetadataFactory.example1Cached());
}
+
+ @Test public void testValidateXMLAGG() {
+ helpValidate("SELECT XMLAGG(e1) from pm1.g1", new String[] {"XMLAGG(e1)"}, FakeMetadataFactory.example1Cached()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testValidateBooleanAgg() {
+ helpValidate("SELECT EVERY(e1) from pm1.g1", new String[] {"EVERY(e1)"}, FakeMetadataFactory.example1Cached()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testValidateStatAgg() {
+ helpValidate("SELECT stddev_pop(distinct e2) from pm1.g1", new String[] {"STDDEV_POP(DISTINCT e2)"}, FakeMetadataFactory.example1Cached()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
14 years, 6 months
teiid SVN: r2275 - in branches/7.0.x: documentation/reference/src/main/docbook/en-US/content and 5 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-22 13:21:54 -0400 (Tue, 22 Jun 2010)
New Revision: 2275
Modified:
branches/7.0.x/common-core/src/main/java/org/teiid/core/types/basic/FloatingNumberToBigDecimalTransform.java
branches/7.0.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
branches/7.0.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
branches/7.0.x/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
branches/7.0.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java
branches/7.0.x/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java
branches/7.0.x/engine/src/test/java/org/teiid/query/resolver/TestFunctionResolving.java
Log:
TEIID-159 updating the handling of bigdecimal
Modified: branches/7.0.x/common-core/src/main/java/org/teiid/core/types/basic/FloatingNumberToBigDecimalTransform.java
===================================================================
--- branches/7.0.x/common-core/src/main/java/org/teiid/core/types/basic/FloatingNumberToBigDecimalTransform.java 2010-06-22 15:11:50 UTC (rev 2274)
+++ branches/7.0.x/common-core/src/main/java/org/teiid/core/types/basic/FloatingNumberToBigDecimalTransform.java 2010-06-22 17:21:54 UTC (rev 2275)
@@ -47,7 +47,7 @@
*/
public Object transformDirect(Object value) throws TransformationException {
BigDecimal result = BigDecimal.valueOf(((Number)value).doubleValue());
- result = result.setScale(Math.max(result.scale(), value instanceof Double ? 12 : 4));
+ result = result.setScale(Math.max(result.scale(), (value instanceof Double ? 16 : 8) - result.precision()));
return result;
}
Modified: branches/7.0.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- branches/7.0.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-06-22 15:11:50 UTC (rev 2274)
+++ branches/7.0.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-06-22 17:21:54 UTC (rev 2275)
@@ -39,7 +39,7 @@
</entry>
<entry>
<para>x in {integer, long, float, double, biginteger,
- bigdecimal}, return type is same as x</para>
+ bigdecimal}, return type is same as x <footnote>The precision and scale of non-bigdecimal arithmetic function functions results matches that of Java. The results of bigdecimal operations match Java, except for division, which uses a preferred scale of max(16, dividend.scale + divisor.precision + 1), which then has trailing zeros removed by setting the scale to max(dividend.scale, normalized scale)</footnote></para>
</entry>
</row>
<row>
Modified: branches/7.0.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
===================================================================
--- branches/7.0.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2010-06-22 15:11:50 UTC (rev 2274)
+++ branches/7.0.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2010-06-22 17:21:54 UTC (rev 2275)
@@ -27,6 +27,7 @@
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
+import java.math.RoundingMode;
import java.nio.charset.Charset;
import java.sql.Blob;
import java.sql.Clob;
@@ -163,7 +164,8 @@
}
public static Object divide(BigDecimal x, BigDecimal y) {
- return x.divide(y, BigDecimal.ROUND_HALF_UP);
+ BigDecimal bd = x.divide(y, Math.max(16, x.scale() + y.precision() + 1), RoundingMode.HALF_UP).stripTrailingZeros();
+ return bd.setScale(Math.max(x.scale(), bd.scale()));
}
// ================== Function = abs =====================
Modified: branches/7.0.x/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
===================================================================
--- branches/7.0.x/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java 2010-06-22 15:11:50 UTC (rev 2274)
+++ branches/7.0.x/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java 2010-06-22 17:21:54 UTC (rev 2275)
@@ -611,7 +611,7 @@
// one digit precision
@Test public void testInvokeDivide6() {
- helpInvokeMethod("/", new Object[] { new BigDecimal("3"), new BigDecimal("2") }, new BigDecimal("2")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ helpInvokeMethod("/", new Object[] { new BigDecimal("3"), new BigDecimal("2") }, new BigDecimal("1.5")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
@Test public void testInvokeDivide7() throws Exception {
Modified: branches/7.0.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java
===================================================================
--- branches/7.0.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java 2010-06-22 15:11:50 UTC (rev 2274)
+++ branches/7.0.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java 2010-06-22 17:21:54 UTC (rev 2275)
@@ -176,9 +176,9 @@
// Create expected results
List[] expected = new List[] {
Arrays.asList(new Object[] { new Integer(1),
- new BigDecimal("110.5000") }), //$NON-NLS-1$
+ new BigDecimal("110.5000000") }), //$NON-NLS-1$
Arrays.asList(new Object[] { new Integer(2),
- new BigDecimal("254.5000") }) //$NON-NLS-1$
+ new BigDecimal("254.5000000") }) //$NON-NLS-1$
};
// Construct data manager with data
Modified: branches/7.0.x/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java
===================================================================
--- branches/7.0.x/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java 2010-06-22 15:11:50 UTC (rev 2274)
+++ branches/7.0.x/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java 2010-06-22 17:21:54 UTC (rev 2275)
@@ -22,7 +22,10 @@
package org.teiid.query.processor.eval;
+import static org.junit.Assert.*;
+
import java.io.Serializable;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -30,16 +33,18 @@
import java.util.Map;
import java.util.Properties;
+import org.junit.Test;
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
-import org.teiid.core.TeiidProcessingException;
import org.teiid.core.TeiidException;
+import org.teiid.core.TeiidProcessingException;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.FunctionDescriptor;
import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.processor.FakeDataManager;
import org.teiid.query.processor.ProcessorDataManager;
+import org.teiid.query.resolver.TestFunctionResolving;
import org.teiid.query.sql.lang.CollectionValueIterator;
import org.teiid.query.sql.lang.Query;
import org.teiid.query.sql.lang.SubqueryContainer;
@@ -56,31 +61,19 @@
import org.teiid.query.sql.util.ValueIterator;
import org.teiid.query.util.CommandContext;
-import junit.framework.TestCase;
+@SuppressWarnings("nls")
+public class TestExpressionEvaluator {
-
-/**
- */
-public class TestExpressionEvaluator extends TestCase {
-
- /**
- * Constructor for TestExpressionEvaluator.
- * @param name
- */
- public TestExpressionEvaluator(String name) {
- super(name);
- }
-
public void helpTestEval(Expression expr, SingleElementSymbol[] elementList, Object[] valueList, ProcessorDataManager dataMgr, CommandContext context, Object expectedValue) {
try {
- Object actualValue = helpEval(expr, elementList, valueList, dataMgr, context, expectedValue);
+ Object actualValue = helpEval(expr, elementList, valueList, dataMgr, context);
assertEquals("Did not get expected result", expectedValue, actualValue); //$NON-NLS-1$
} catch(TeiidException e) {
fail("Received unexpected exception: " + e.getFullMessage()); //$NON-NLS-1$
}
}
- public Object helpEval(Expression expr, SingleElementSymbol[] elementList, Object[] valueList, ProcessorDataManager dataMgr, CommandContext context, Object expectedValue) throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
+ public Object helpEval(Expression expr, SingleElementSymbol[] elementList, Object[] valueList, ProcessorDataManager dataMgr, CommandContext context) throws ExpressionEvaluationException, BlockedException, TeiidComponentException {
Map elements = new HashMap();
if (elementList != null) {
for(int i=0; i<elementList.length; i++) {
@@ -97,7 +90,7 @@
return new Evaluator(elements, dataMgr, context).evaluate(expr, tuple);
}
- public void testCaseExpression1() {
+ @Test public void testCaseExpression1() {
CaseExpression expr = TestCaseExpression.example(3);
expr.setExpression(new Constant("a")); //$NON-NLS-1$
helpTestEval(expr, null, null, null, null, new Integer(0));
@@ -109,7 +102,7 @@
helpTestEval(expr, null, null, null, null, new Integer(9999));
}
- public void testSearchedCaseExpression1() {
+ @Test public void testSearchedCaseExpression1() {
SearchedCaseExpression expr = TestSearchedCaseExpression.example(3);
helpTestEval(expr,
new SingleElementSymbol[] {new ElementSymbol("x")}, //$NON-NLS-1$
@@ -137,11 +130,11 @@
new Integer(9999));
}
- public void testConstant() {
+ @Test public void testConstant() {
helpTestEval(new Constant("xyz", String.class), new SingleElementSymbol[0], new Object[0], null, null, "xyz"); //$NON-NLS-1$ //$NON-NLS-2$
}
- public void testElement1() {
+ @Test public void testElement1() {
ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
ElementSymbol e2 = new ElementSymbol("e2"); //$NON-NLS-1$
@@ -156,7 +149,7 @@
helpTestEval(e1, elements, values, null, null, "xyz"); //$NON-NLS-1$
}
- public void testElement2() {
+ @Test public void testElement2() {
ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
ElementSymbol e2 = new ElementSymbol("e2"); //$NON-NLS-1$
@@ -174,7 +167,7 @@
/**
* Element Symbols must have values set during evaluation
*/
- public void testElement3() throws Exception {
+ @Test public void testElement3() throws Exception {
ElementSymbol e2 = new ElementSymbol("e2"); //$NON-NLS-1$
SingleElementSymbol[] elements = new SingleElementSymbol[] {};
@@ -184,7 +177,7 @@
};
try {
- helpEval(e2, elements, values, null, null, null);
+ helpEval(e2, elements, values, null, null);
fail("Exception expected"); //$NON-NLS-1$
} catch (TeiidComponentException e){
//this should be a componentexception, since it is unexpected
@@ -192,7 +185,7 @@
}
}
- public void testFunction1() {
+ @Test public void testFunction1() {
ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
e1.setType(String.class);
ElementSymbol e2 = new ElementSymbol("e2"); //$NON-NLS-1$
@@ -214,7 +207,7 @@
helpTestEval(func, elements, values, null, null, "xyzabc"); //$NON-NLS-1$
}
- public void testFunction2() {
+ @Test public void testFunction2() {
ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
e1.setType(String.class);
ElementSymbol e2 = new ElementSymbol("e2"); //$NON-NLS-1$
@@ -235,7 +228,7 @@
helpTestEval(func, elements, values, null, null, "abcxyz"); //$NON-NLS-1$
}
- public void testLookupFunction() {
+ @Test public void testLookupFunction() {
ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
e1.setType(String.class);
ElementSymbol e2 = new ElementSymbol("e2"); //$NON-NLS-1$
@@ -261,7 +254,7 @@
helpTestEval(func, elements, values, dataMgr, null, new Integer(5));
}
- public void testScalarSubquery() throws Exception{
+ @Test public void testScalarSubquery() throws Exception{
ScalarSubquery expr = new ScalarSubquery(new Query());
ArrayList values = new ArrayList(1);
values.add("a"); //$NON-NLS-1$
@@ -286,19 +279,19 @@
}.evaluate(expr, null) );
}
- public void testScalarSubquery2() throws Exception{
+ @Test public void testScalarSubquery2() throws Exception{
ScalarSubquery expr = new ScalarSubquery(new Query());
ArrayList values = new ArrayList(1);
values.add(null);
helpTestWithValueIterator(expr, values, null);
}
- public void testScalarSubquery3() throws Exception{
+ @Test public void testScalarSubquery3() throws Exception{
ScalarSubquery expr = new ScalarSubquery(new Query());
helpTestWithValueIterator(expr, Collections.emptyList(), null);
}
- public void testScalarSubqueryFails() throws Exception{
+ @Test public void testScalarSubqueryFails() throws Exception{
ScalarSubquery expr = new ScalarSubquery(new Query());
ArrayList values = new ArrayList(2);
values.add("a"); //$NON-NLS-1$
@@ -312,7 +305,7 @@
}
}
- public void testUser() throws Exception {
+ @Test public void testUser() throws Exception {
Function func = new Function("user", new Expression[] {}); //$NON-NLS-1$
FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("user", new Class[] {} ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
@@ -329,7 +322,7 @@
* these files.
* @throws Exception
*/
- public void testEnv() throws Exception {
+ @Test public void testEnv() throws Exception {
Function func = new Function("env", new Expression[] {}); //$NON-NLS-1$
FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("env", new Class[] {String.class} ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
@@ -370,46 +363,51 @@
assertEquals(expectedValue, actual);
}
- public void testCommandPayloadNoArgsWithPayload() throws Exception {
+ @Test public void testCommandPayloadNoArgsWithPayload() throws Exception {
helpTestCommandPayload("blah", null, "blah"); //$NON-NLS-1$ //$NON-NLS-2$
}
- public void testCommandPayloadNoArgsWithoutPayload() throws Exception {
+ @Test public void testCommandPayloadNoArgsWithoutPayload() throws Exception {
helpTestCommandPayload(null, null, null);
}
- public void testCommandPayloadNoArgsWithNonStringPayload() throws Exception {
+ @Test public void testCommandPayloadNoArgsWithNonStringPayload() throws Exception {
helpTestCommandPayload(Boolean.TRUE, null, "true"); //$NON-NLS-1$
}
- public void testCommandPayloadArgWithPayload() throws Exception {
+ @Test public void testCommandPayloadArgWithPayload() throws Exception {
Properties props = new Properties();
props.setProperty("p1", "v1"); //$NON-NLS-1$ //$NON-NLS-2$
props.setProperty("p2", "v2"); //$NON-NLS-1$ //$NON-NLS-2$
helpTestCommandPayload(props, "p1", "v1"); //$NON-NLS-1$ //$NON-NLS-2$
}
- public void testCommandPayloadArgWithPayloadMissingProp() throws Exception {
+ @Test public void testCommandPayloadArgWithPayloadMissingProp() throws Exception {
Properties props = new Properties();
props.setProperty("p1", "v1"); //$NON-NLS-1$ //$NON-NLS-2$
props.setProperty("p2", "v2"); //$NON-NLS-1$ //$NON-NLS-2$
helpTestCommandPayload(props, "BOGUS", null); //$NON-NLS-1$
}
- public void testCommandPayloadArgWithoutPayload() throws Exception {
+ @Test public void testCommandPayloadArgWithoutPayload() throws Exception {
Properties props = new Properties();
props.setProperty("p1", "v1"); //$NON-NLS-1$ //$NON-NLS-2$
props.setProperty("p2", "v2"); //$NON-NLS-1$ //$NON-NLS-2$
helpTestCommandPayload(null, "BOGUS", null); //$NON-NLS-1$
}
- public void testCommandPayloadArgWithBadPayload() throws Exception {
- try {
- helpTestCommandPayload(Boolean.TRUE, "BOGUS", null); //$NON-NLS-1$
- fail("Expected exception but got none"); //$NON-NLS-1$
- } catch(ExpressionEvaluationException e) {
- // expected
- }
- }
+ @Test(expected=ExpressionEvaluationException.class) public void testCommandPayloadArgWithBadPayload() throws Exception {
+ helpTestCommandPayload(Boolean.TRUE, "BOGUS", null); //$NON-NLS-1$
+ }
+ @Test public void testBigDecimalFromDoubleDivision() throws Exception {
+ Expression ex = TestFunctionResolving.getExpression("convert(1.0, bigdecimal)/3");
+ assertEquals(new BigDecimal("0.3333333333333333"), Evaluator.evaluate(ex));
+ }
+
+ @Test public void testBigDecimalDivision() throws Exception {
+ Expression ex = TestFunctionResolving.getExpression("1/convert('3.0', bigdecimal)");
+ assertEquals(new BigDecimal("0.3333333333333333"), Evaluator.evaluate(ex));
+ }
+
}
Modified: branches/7.0.x/engine/src/test/java/org/teiid/query/resolver/TestFunctionResolving.java
===================================================================
--- branches/7.0.x/engine/src/test/java/org/teiid/query/resolver/TestFunctionResolving.java 2010-06-22 15:11:50 UTC (rev 2274)
+++ branches/7.0.x/engine/src/test/java/org/teiid/query/resolver/TestFunctionResolving.java 2010-06-22 17:21:54 UTC (rev 2275)
@@ -127,7 +127,7 @@
return func;
}
- private Expression getExpression(String sql) throws QueryParserException,
+ public static Expression getExpression(String sql) throws QueryParserException,
TeiidComponentException, QueryResolverException {
Expression func = QueryParser.getQueryParser().parseExpression(sql);
ResolverVisitor.resolveLanguageObject(func, FakeMetadataFactory.example1Cached());
14 years, 6 months
teiid SVN: r2274 - in branches/7.0.x: engine/src/main/java/org/teiid/query/optimizer/relational/rules and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-22 11:11:50 -0400 (Tue, 22 Jun 2010)
New Revision: 2274
Modified:
branches/7.0.x/common-core/src/main/java/org/teiid/core/types/basic/FloatingNumberToBigDecimalTransform.java
branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java
branches/7.0.x/engine/src/test/java/org/teiid/common/queue/TestStatsCapturingWorkManager.java
branches/7.0.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java
Log:
TEIID-159 updating the handling of floating to bigdecmial conversions and fixing misc math issues with aggregate pushdown.
Modified: branches/7.0.x/common-core/src/main/java/org/teiid/core/types/basic/FloatingNumberToBigDecimalTransform.java
===================================================================
--- branches/7.0.x/common-core/src/main/java/org/teiid/core/types/basic/FloatingNumberToBigDecimalTransform.java 2010-06-22 14:34:09 UTC (rev 2273)
+++ branches/7.0.x/common-core/src/main/java/org/teiid/core/types/basic/FloatingNumberToBigDecimalTransform.java 2010-06-22 15:11:50 UTC (rev 2274)
@@ -46,7 +46,9 @@
* the transformation fails
*/
public Object transformDirect(Object value) throws TransformationException {
- return BigDecimal.valueOf(((Number)value).doubleValue());
+ BigDecimal result = BigDecimal.valueOf(((Number)value).doubleValue());
+ result = result.setScale(Math.max(result.scale(), value instanceof Double ? 12 : 4));
+ return result;
}
/**
Modified: branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java
===================================================================
--- branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java 2010-06-22 14:34:09 UTC (rev 2273)
+++ branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java 2010-06-22 15:11:50 UTC (rev 2274)
@@ -352,10 +352,14 @@
projectedViewSymbols.add(agg);
} else {
if (agg.getAggregateFunction().equals(NonReserved.COUNT)) {
- SearchedCaseExpression count = new SearchedCaseExpression(Arrays.asList(new IsNullCriteria(agg.getExpression())), Arrays.asList(new Constant(Integer.valueOf(0))));
- count.setElseExpression(new Constant(Integer.valueOf(1)));
- count.setType(DataTypeManager.DefaultDataClasses.INTEGER);
- projectedViewSymbols.add(new ExpressionSymbol("stagedAgg", count)); //$NON-NLS-1$
+ if (agg.getExpression() == null) {
+ projectedViewSymbols.add(new ExpressionSymbol("stagedAgg", new Constant(1))); //$NON-NLS-1$
+ } else {
+ SearchedCaseExpression count = new SearchedCaseExpression(Arrays.asList(new IsNullCriteria(agg.getExpression())), Arrays.asList(new Constant(Integer.valueOf(0))));
+ count.setElseExpression(new Constant(Integer.valueOf(1)));
+ count.setType(DataTypeManager.DefaultDataClasses.INTEGER);
+ projectedViewSymbols.add(new ExpressionSymbol("stagedAgg", count)); //$NON-NLS-1$
+ }
} else { //min, max, sum
Expression ex = agg.getExpression();
ex = ResolverUtil.convertExpression(ex, DataTypeManager.getDataTypeName(agg.getType()), metadata);
@@ -689,7 +693,10 @@
AggregateSymbol sumSumAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, sumAgg); //$NON-NLS-1$
AggregateSymbol sumCountAgg = new AggregateSymbol("stagedAgg", NonReserved.SUM, false, countAgg); //$NON-NLS-1$
- Function divideFunc = new Function("/", new Expression[] {sumSumAgg, sumCountAgg}); //$NON-NLS-1$
+ Expression convertedSum = new Function(FunctionLibrary.CONVERT, new Expression[] {sumSumAgg, new Constant(DataTypeManager.getDataTypeName(partitionAgg.getType()))});
+ Expression convertCount = new Function(FunctionLibrary.CONVERT, new Expression[] {sumCountAgg, new Constant(DataTypeManager.getDataTypeName(partitionAgg.getType()))});
+
+ Function divideFunc = new Function("/", new Expression[] {convertedSum, convertCount}); //$NON-NLS-1$
ResolverVisitor.resolveLanguageObject(divideFunc, metadata);
newExpression = divideFunc;
Modified: branches/7.0.x/engine/src/test/java/org/teiid/common/queue/TestStatsCapturingWorkManager.java
===================================================================
--- branches/7.0.x/engine/src/test/java/org/teiid/common/queue/TestStatsCapturingWorkManager.java 2010-06-22 14:34:09 UTC (rev 2273)
+++ branches/7.0.x/engine/src/test/java/org/teiid/common/queue/TestStatsCapturingWorkManager.java 2010-06-22 15:11:50 UTC (rev 2274)
@@ -32,6 +32,7 @@
import javax.resource.spi.work.WorkManager;
import javax.resource.spi.work.WorkRejectedException;
+import org.junit.Ignore;
import org.junit.Test;
import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
import org.teiid.dqp.internal.process.StatsCapturingWorkManager;
@@ -61,6 +62,7 @@
assertEquals("Expected threads to be maxed out", MAX_THREADS, stats.getHighestActiveThreads()); //$NON-NLS-1$
}
+ @Ignore
@Test public void testThreadReuse() throws Exception {
final long SINGLE_WAIT = 50;
final long NUM_THREADS = 5;
Modified: branches/7.0.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java
===================================================================
--- branches/7.0.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java 2010-06-22 14:34:09 UTC (rev 2273)
+++ branches/7.0.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java 2010-06-22 15:11:50 UTC (rev 2274)
@@ -176,9 +176,9 @@
// Create expected results
List[] expected = new List[] {
Arrays.asList(new Object[] { new Integer(1),
- new BigDecimal("110.5") }), //$NON-NLS-1$
+ new BigDecimal("110.5000") }), //$NON-NLS-1$
Arrays.asList(new Object[] { new Integer(2),
- new BigDecimal("254.5") }) //$NON-NLS-1$
+ new BigDecimal("254.5000") }) //$NON-NLS-1$
};
// Construct data manager with data
14 years, 6 months
teiid SVN: r2273 - branches/7.0.x/build/kits/jboss-container/teiid-examples/simpleclient.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-22 10:34:09 -0400 (Tue, 22 Jun 2010)
New Revision: 2273
Modified:
branches/7.0.x/build/kits/jboss-container/teiid-examples/simpleclient/README.txt
Log:
making simpleclient readme more explicit
Modified: branches/7.0.x/build/kits/jboss-container/teiid-examples/simpleclient/README.txt
===================================================================
--- branches/7.0.x/build/kits/jboss-container/teiid-examples/simpleclient/README.txt 2010-06-22 01:55:30 UTC (rev 2272)
+++ branches/7.0.x/build/kits/jboss-container/teiid-examples/simpleclient/README.txt 2010-06-22 14:34:09 UTC (rev 2273)
@@ -1,11 +1,18 @@
-JDBCClient.java shows making connections to Teiid in embedded mode through both a Driver
+JDBCClient.java shows making connections to Teiid in through both a Driver
and a DataSource.
-The program expects four arguments <host> <port> <vdb> <sql-command>. There are helper run scripts
-that can be run as follows:
+The program expects four arguments <host> <port> <vdb> <sql-command>. There
+are helper run scripts that can be run as follows:
-$./run.sh localhost 31000 portfolio "select * from CustomerAccount"
+$./run.sh host port vdb "query"
Note that the query is in quotes so that it is understood as a single argument.
-See the other examples for deployable .vdb and .xml files to create vdbs.
\ No newline at end of file
+e.g. With the portfolio vdb deployed:
+
+$./run.sh localhost 31000 portfolio "select * from customeraccounts"
+
+See the other examples for deployable .vdb and .xml files to create vdbs.
+
+NOTE: To run more advanced queries, it would be better a fully featured Java client,
+such as SQuirreL [http://www.squirrelsql.org/].
\ No newline at end of file
14 years, 6 months
teiid SVN: r2272 - in branches/7.0.x: engine/src/main/java/org/teiid/dqp/internal/datamgr/impl and 3 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-21 21:55:30 -0400 (Mon, 21 Jun 2010)
New Revision: 2272
Modified:
branches/7.0.x/api/src/main/java/org/teiid/logging/JavaLogger.java
branches/7.0.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java
branches/7.0.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
branches/7.0.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected
Log:
TEIID-1128 fixing a regression with document model queries
Modified: branches/7.0.x/api/src/main/java/org/teiid/logging/JavaLogger.java
===================================================================
--- branches/7.0.x/api/src/main/java/org/teiid/logging/JavaLogger.java 2010-06-21 21:31:14 UTC (rev 2271)
+++ branches/7.0.x/api/src/main/java/org/teiid/logging/JavaLogger.java 2010-06-22 01:55:30 UTC (rev 2272)
@@ -49,7 +49,7 @@
Logger logger = Logger.getLogger(context);
Level javaLevel = convertLevel(level);
- logger.log(javaLevel, msg.toString(), t);
+ logger.log(javaLevel, msg != null ? msg.toString() : null, t);
}
public Level convertLevel(int level) {
Modified: branches/7.0.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java
===================================================================
--- branches/7.0.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java 2010-06-21 21:31:14 UTC (rev 2271)
+++ branches/7.0.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java 2010-06-22 01:55:30 UTC (rev 2272)
@@ -53,12 +53,12 @@
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.ResultSetExecution;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.UpdateExecution;
@@ -179,8 +179,13 @@
} catch (Throwable e) {
LogManager.logError(LogConstants.CTX_CONNECTOR, e, e.getMessage());
} finally {
- this.connector.closeConnection(connection, connectionFactory);
- manager.removeState(this.id);
+ try {
+ this.connector.closeConnection(connection, connectionFactory);
+ } catch (Throwable e) {
+ LogManager.logError(LogConstants.CTX_CONNECTOR, e, e.getMessage());
+ } finally {
+ manager.removeState(this.id);
+ }
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id, "Closed connection"}); //$NON-NLS-1$
}
}
Modified: branches/7.0.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- branches/7.0.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-06-21 21:31:14 UTC (rev 2271)
+++ branches/7.0.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-06-22 01:55:30 UTC (rev 2272)
@@ -212,9 +212,6 @@
} finally {
if (this.state == ProcessingState.CLOSE && !isClosed) {
attemptClose();
- if (this.processingException != null) {
- sendError();
- }
} else if (isClosed) {
/*
* since there may be a client waiting notify them of a problem
Modified: branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
===================================================================
--- branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java 2010-06-21 21:31:14 UTC (rev 2271)
+++ branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java 2010-06-22 01:55:30 UTC (rev 2272)
@@ -279,6 +279,10 @@
for (Column columnRecordImpl : columns) {
columnRecordImpl.setDatatype(getDatatypeCache().get(columnRecordImpl.getDatatypeUUID()));
columnRecordImpl.setParent(tableRecord);
+ String fullName = columnRecordImpl.getName();
+ if (fullName.startsWith(tableRecord.getName() + '.')) {
+ columnRecordImpl.setName(fullName.substring(tableRecord.getName().length() + 1));
+ }
}
Collections.sort(columns);
tableRecord.setColumns(columns);
@@ -414,7 +418,7 @@
ColumnSet<Procedure> resultRecord = (ColumnSet<Procedure>) getRecordByType(result.getUUID(), MetadataConstants.RECORD_TYPE.RESULT_SET, false);
if (resultRecord != null) {
resultRecord.setParent(procedureRecord);
- resultRecord.setName("RSParam"); //$NON-NLS-1$
+ resultRecord.setName(RecordFactory.getShortName(resultRecord.getName()));
loadColumnSetRecords(resultRecord, null);
procedureRecord.setResultSet(resultRecord);
}
@@ -460,6 +464,7 @@
c = columns.get(uuid);
} else {
c = findElement(uuid);
+ c.setName(RecordFactory.getShortName(c.getName()));
}
indexRecord.getColumns().set(i, c);
c.setParent(indexRecord);
Modified: branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
===================================================================
--- branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2010-06-21 21:31:14 UTC (rev 2271)
+++ branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2010-06-22 01:55:30 UTC (rev 2272)
@@ -972,11 +972,8 @@
record.setUUID(getObjectValue(objectID));
if (fullName != null) {
String name = fullName;
- if (record instanceof Column || record instanceof ProcedureParameter || record instanceof KeyRecord) { //take only the last part
- int index = fullName.lastIndexOf(IndexConstants.NAME_DELIM_CHAR);
- if (index > 0) {
- name = fullName.substring(index + 1);
- }
+ if (record instanceof ProcedureParameter || record instanceof KeyRecord) { //take only the last part
+ name = getShortName(fullName);
} else { //remove model name
int index = fullName.indexOf(IndexConstants.NAME_DELIM_CHAR);
if (index > 0) {
@@ -988,6 +985,14 @@
record.setNameInSource(getObjectValue(nameInSource));
}
+ static String getShortName(String fullName) {
+ int index = fullName.lastIndexOf(IndexConstants.NAME_DELIM_CHAR);
+ if (index > 0) {
+ fullName = fullName.substring(index + 1);
+ }
+ return fullName;
+ }
+
/**
* Set the "footer" values on the specified MetadataRecord.
* All index file record footers are of the form:
Modified: branches/7.0.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected
===================================================================
--- branches/7.0.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected 2010-06-21 21:31:14 UTC (rev 2271)
+++ branches/7.0.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected 2010-06-22 01:55:30 UTC (rev 2272)
@@ -1,23 +1,23 @@
string string string string short string integer string integer integer integer string string string string integer integer string string string string !
string string
TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SCOPE_CATALOG SCOPE_SCHEMA SCOPE_TABLE!
SOURCE_DATA_TYPE IS_AUTOINCREMENT
-QT_Ora9DS XQTDoc BQTDocTestDocument BigDecimalValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument BigIntegerValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument BooleanValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument ByteNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument CharValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument DateValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument DoubleNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument FloatNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument IntKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument IntNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument LongNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument ObjectValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument ShortValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument StringKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument StringNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument TimestampValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument TimeValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc BQTDocTestDocument SingleRow 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.BigDecimalValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.BigIntegerValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.BooleanValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.ByteNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.CharValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.DateValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.DoubleNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.FloatNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.IntKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.IntNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.LongNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.ObjectValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.ShortValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.StringKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.StringNum 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.TimestampValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow.TimeValue 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest.SingleRow 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc BQTDocTestDocument BQTDocTest 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc BQTDocTestDocument.MappingClasses.SingleRow IntKey 4 integer 10 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc BQTDocTestDocument.MappingClasses.SingleRow StringKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
@@ -668,18 +668,18 @@
QT_Ora9DS VQT Union.U9 C 7 float 20 <null> 0 10 0 <null> <null> <null> <null> 126 3 YES <null> <null> <null> !
<null> NO
QT_Ora9DS SYS VirtualDatabases Name 12 string 255 <null> 0 10 0 <null> <null> <null> <null> 255 1 YES <null> <null> <null> !
<null> NO
QT_Ora9DS SYS VirtualDatabases Version 12 string 50 <null> 0 10 0 <null> <null> <null> <null> 50 2 YES <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument data1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument key1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument wrapper1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument data1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument data2 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument key2 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument wrapper2 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument data2 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument data3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument key3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument wrapper3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc choiceTestDocument data3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data1.wrapper1.data1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data1.wrapper1.key1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data1.wrapper1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data2.wrapper2.data2 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data2.wrapper2.key2 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data2.wrapper2 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data2 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data3.wrapper3.key3.data3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data3.wrapper3.key3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data3.wrapper3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc choiceTestDocument choiceTest.data3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc choiceTestDocument choiceTest 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc choiceTestDocument.MappingClasses.choiceTest key1 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc choiceTestDocument.MappingClasses.choiceTest data1 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
@@ -687,46 +687,46 @@
QT_Ora9DS XQTDoc choiceTestDocument.MappingClasses.choiceTest key2 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 4 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc choiceTestDocument.MappingClasses.choiceTest key3 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 5 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc choiceTestDocument.MappingClasses.choiceTest data3 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 6 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc defaultValueTestDocument @dataAttr 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc defaultValueTestDocument data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc defaultValueTestDocument key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc defaultValueTestDocument wrapper 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc defaultValueTestDocument defaultValueTest.wrapper.@dataAttr 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc defaultValueTestDocument defaultValueTest.wrapper.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc defaultValueTestDocument defaultValueTest.wrapper.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc defaultValueTestDocument defaultValueTest.wrapper 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc defaultValueTestDocument defaultValueTest 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc defaultValueTestDocument.MappingClasses.wrapper key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc defaultValueTestDocument.MappingClasses.wrapper data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc defaultValueTestDocument.MappingClasses.wrapper dataAttr 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc emptyContentTestDocument data1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc emptyContentTestDocument key1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc emptyContentTestDocument wrapper1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc emptyContentTestDocument emptyContentTest.wrapper1.data1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc emptyContentTestDocument emptyContentTest.wrapper1.key1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc emptyContentTestDocument emptyContentTest.wrapper1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc emptyContentTestDocument emptyContentTest 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc emptyContentTestDocument.MappingClasses.wrapper1 key1 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc emptyContentTestDocument.MappingClasses.wrapper1 data1 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc fixedValueTestDocument @fixedAttr 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc fixedValueTestDocument fixed 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc fixedValueTestDocument key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc fixedValueTestDocument wrapper 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc fixedValueTestDocument fixedValueTest.wrapper.@fixedAttr 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc fixedValueTestDocument fixedValueTest.wrapper.fixed 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc fixedValueTestDocument fixedValueTest.wrapper.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc fixedValueTestDocument fixedValueTest.wrapper 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc fixedValueTestDocument fixedValueTest 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc fixedValueTestDocument.MappingClasses.wrapper key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument code 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument ID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument code 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument groupID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupA.code 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupA.ID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupA.supervisor.code 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupA.supervisor.groupID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupA.supervisor.group 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupA.supervisor.ID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupA.supervisorID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupA.supervisor 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupA 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupB.code 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupB.ID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupB.supervisor.code 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupB.supervisor.groupID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupB.supervisor.group 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupB.supervisor.ID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupB.supervisorID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupB.supervisor 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.GroupB 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc groupDocument group.pseudoID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc groupDocument group 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument ID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument supervisorID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument supervisor 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument GroupA 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument code 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument ID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument code 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument groupID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument group 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument ID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument supervisorID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument supervisor 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument GroupB 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument pseudoID 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc groupDocument group 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc groupDocument.MappingClasses.group ID 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc groupDocument.MappingClasses.group code 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc groupDocument.MappingClasses.group supervisorID 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
@@ -736,36 +736,36 @@
QT_Ora9DS XQTRecursiveDoc groupDocument.MappingClasses.supervisor ID 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc groupDocument.MappingClasses.supervisor code 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc groupDocument.MappingClasses.supervisor groupID 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc mixedContentTestDocument data3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc mixedContentTestDocument key3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc mixedContentTestDocument wrapper3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc mixedContentTestDocument mixedContentTest.wrapper3.key3.data3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc mixedContentTestDocument mixedContentTest.wrapper3.key3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc mixedContentTestDocument mixedContentTest.wrapper3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc mixedContentTestDocument mixedContentTest 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc mixedContentTestDocument.MappingClasses.wrapper3 key3 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc mixedContentTestDocument.MappingClasses.wrapper3 data3 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc multipleDocsTestDocument data1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc multipleDocsTestDocument key1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc multipleDocsTestDocument multipleDocsTest.data1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc multipleDocsTestDocument multipleDocsTest.key1 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc multipleDocsTestDocument multipleDocsTest 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc multipleDocsTestDocument.MappingClasses.multipleDocsTest key1 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc multipleDocsTestDocument.MappingClasses.multipleDocsTest data1 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc nillableTestDocument key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc nillableTestDocument nillableField 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTDoc nillableTestDocument wrapper 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc nillableTestDocument nillableTest.wrapper.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc nillableTestDocument nillableTest.wrapper.nillableField 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTDoc nillableTestDocument nillableTest.wrapper 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc nillableTestDocument nillableTest 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc nillableTestDocument.MappingClasses.wrapper key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc nillableTestDocument.MappingClasses.wrapper nillableField 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testBoundTempTable recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.recurse.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.recurse.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.recurse.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.recurse.recurse.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.recurse.recurse.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.recurse.recurse.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.recurse.recurse.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.recurse.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple.recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testBoundTempTable testSimple 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testBoundTempTable.MappingClasses.TemporaryTable1 key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testBoundTempTable.MappingClasses.TemporaryTable1 data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
@@ -782,19 +782,19 @@
QT_Ora9DS XQTNestedDoc testBoundTempTable.MappingClasses.root key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testBoundTempTable.MappingClasses.root data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testBoundTempTable.MappingClasses.root nextKey 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testExcludeFromDoc recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.recurse.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.recurse.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.recurse.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.recurse.recurse.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.recurse.recurse.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.recurse.recurse.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.recurse.recurse.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.recurse.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple.recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testExcludeFromDoc testSimple 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testExcludeFromDoc.MappingClasses.nested key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testExcludeFromDoc.MappingClasses.nested data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
@@ -805,15 +805,15 @@
QT_Ora9DS XQTNestedDoc testExcludeFromDoc.MappingClasses.root key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testExcludeFromDoc.MappingClasses.root data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testExcludeFromDoc.MappingClasses.root nextKey 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNested2Document data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNested2Document key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNested2Document data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNested2Document key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNested2Document nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNested2Document nested 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNested2Document nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNested2Document recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNested2Document recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNested2Document testNested2.recursiveRoot.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNested2Document testNested2.recursiveRoot.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNested2Document testNested2.recursiveRoot.nested.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNested2Document testNested2.recursiveRoot.nested.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNested2Document testNested2.recursiveRoot.nested.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNested2Document testNested2.recursiveRoot.nested 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNested2Document testNested2.recursiveRoot.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNested2Document testNested2.recursiveRoot.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNested2Document testNested2.recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testNested2Document testNested2 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testNested2Document.MappingClasses.nested key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testNested2Document.MappingClasses.nested data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
@@ -824,16 +824,16 @@
QT_Ora9DS XQTRecursiveDoc testNested2Document.MappingClasses.recursiveRoot key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testNested2Document.MappingClasses.recursiveRoot data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testNested2Document.MappingClasses.recursiveRoot nextKey 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNestedDocument data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNestedDocument key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNestedDocument data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNestedDocument key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNestedDocument nestedRecurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNestedDocument nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNestedDocument nested 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNestedDocument nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNestedDocument recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testNestedDocument recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested.recursiveRoot.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested.recursiveRoot.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested.recursiveRoot.nested.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested.recursiveRoot.nested.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested.recursiveRoot.nested.nestedRecurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested.recursiveRoot.nested.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested.recursiveRoot.nested 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested.recursiveRoot.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested.recursiveRoot.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested.recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testNestedDocument testNested 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testNestedDocument.MappingClasses.nested key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testNestedDocument.MappingClasses.nested data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
@@ -847,19 +847,19 @@
QT_Ora9DS XQTRecursiveDoc testNestedDocument.MappingClasses.recursiveRoot key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testNestedDocument.MappingClasses.recursiveRoot data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testNestedDocument.MappingClasses.recursiveRoot nextKey 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testOptimizableTempTable recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.recurse.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.recurse.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.recurse.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.recurse.recurse.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.recurse.recurse.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.recurse.recurse.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.recurse.recurse.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.recurse.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple.recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testOptimizableTempTable testSimple 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testOptimizableTempTable.MappingClasses.TemporaryTable1 key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testOptimizableTempTable.MappingClasses.TemporaryTable1 data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
@@ -876,19 +876,19 @@
QT_Ora9DS XQTNestedDoc testOptimizableTempTable.MappingClasses.root key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testOptimizableTempTable.MappingClasses.root data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testOptimizableTempTable.MappingClasses.root nextKey 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testRootTempTable recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.recurse.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.recurse.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.recurse.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.recurse.recurse.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.recurse.recurse.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.recurse.recurse.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.recurse.recurse.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.recurse.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testRootTempTable testSimple.recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testRootTempTable testSimple 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testRootTempTable.MappingClasses.TemporaryTable1 key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testRootTempTable.MappingClasses.TemporaryTable1 data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
@@ -902,11 +902,11 @@
QT_Ora9DS XQTNestedDoc testRootTempTable.MappingClasses.root key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testRootTempTable.MappingClasses.root data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testRootTempTable.MappingClasses.root nextKey 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testSimpleDocument data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testSimpleDocument key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testSimpleDocument nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testSimpleDocument recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testSimpleDocument recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testSimpleDocument testSimple.recursiveRoot.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testSimpleDocument testSimple.recursiveRoot.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testSimpleDocument testSimple.recursiveRoot.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testSimpleDocument testSimple.recursiveRoot.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testSimpleDocument testSimple.recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testSimpleDocument testSimple 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testSimpleDocument.MappingClasses.recurse key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testSimpleDocument.MappingClasses.recurse data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
@@ -914,19 +914,19 @@
QT_Ora9DS XQTRecursiveDoc testSimpleDocument.MappingClasses.recursiveRoot key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testSimpleDocument.MappingClasses.recursiveRoot data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testSimpleDocument.MappingClasses.recursiveRoot nextKey 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTNestedDoc testSimpleNested recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.recurse.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.recurse.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.recurse.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.recurse.recurse.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.recurse.recurse.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.recurse.recurse.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.recurse.recurse.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.recurse.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTNestedDoc testSimpleNested testSimple.recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testSimpleNested testSimple 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testSimpleNested.MappingClasses.nested key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testSimpleNested.MappingClasses.nested data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
@@ -937,11 +937,11 @@
QT_Ora9DS XQTNestedDoc testSimpleNested.MappingClasses.root key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testSimpleNested.MappingClasses.root data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTNestedDoc testSimpleNested.MappingClasses.root nextKey 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testSimpleTempTable data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testSimpleTempTable key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testSimpleTempTable nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testSimpleTempTable recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
-QT_Ora9DS XQTRecursiveDoc testSimpleTempTable recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testSimpleTempTable testSimple.recursiveRoot.data 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testSimpleTempTable testSimple.recursiveRoot.key 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testSimpleTempTable testSimple.recursiveRoot.nextKey 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testSimpleTempTable testSimple.recursiveRoot.recurse 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS XQTRecursiveDoc testSimpleTempTable testSimple.recursiveRoot 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testSimpleTempTable testSimple 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testSimpleTempTable.MappingClasses.TemporaryTable1 key 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc testSimpleTempTable.MappingClasses.TemporaryTable1 data 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 NO <null> <null> <null> !
<null> NO
14 years, 6 months
teiid SVN: r2271 - in branches/7.0.x: client/src/main/java/org/teiid/net and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-21 17:31:14 -0400 (Mon, 21 Jun 2010)
New Revision: 2271
Modified:
branches/7.0.x/client/src/main/java/org/teiid/adminapi/AdminFactory.java
branches/7.0.x/client/src/main/java/org/teiid/net/ServerConnection.java
branches/7.0.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
branches/7.0.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
Log:
TEIID-1125 changing adminproxy to perform a ping to validate the connection, rather than retrying the operation after the fact.
Modified: branches/7.0.x/client/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- branches/7.0.x/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-06-21 20:28:17 UTC (rev 2270)
+++ branches/7.0.x/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-06-21 21:31:14 UTC (rev 2271)
@@ -27,9 +27,11 @@
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Properties;
+import java.util.concurrent.ExecutionException;
import org.teiid.client.security.LogonException;
import org.teiid.client.util.ExceptionUtil;
+import org.teiid.client.util.ResultsFuture;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.PropertiesUtils;
import org.teiid.net.CommunicationException;
@@ -66,8 +68,18 @@
if (closed) {
throw new AdminComponentException(NetPlugin.Util.getString("ERR.014.001.0001")); //$NON-NLS-1$
}
- if (target != null && registry.isOpen()) {
- return target;
+ if (target != null) {
+ ResultsFuture<?> ping = registry.isOpen();
+ if (ping != null) {
+ try {
+ ping.get();
+ return target;
+ } catch (InterruptedException e) {
+ throw new CommunicationException(e);
+ } catch (ExecutionException e) {
+ //assume recoverable
+ }
+ }
}
try {
registry = serverConnectionFactory.getConnection(p);
@@ -88,23 +100,19 @@
return null;
}
Throwable t = null;
- for (int i = 0; i < 3; i++) {
- try {
- return method.invoke(getTarget(), args);
- } catch (InvocationTargetException e) {
- if (ExceptionUtil.getExceptionOfType(e, CommunicationException.class) != null) {
- // communication exception occurred, lose the old connection and try again.
- this.target = null;
- if (method.getName().endsWith("restart")) { //$NON-NLS-1$
- bounceSystem(true);
- return null;
- }
- continue;
+ try {
+ return method.invoke(getTarget(), args);
+ } catch (InvocationTargetException e) {
+ if (ExceptionUtil.getExceptionOfType(e, CommunicationException.class) != null) {
+ this.target = null;
+ if (method.getName().endsWith("restart")) { //$NON-NLS-1$
+ bounceSystem(true);
+ return null;
}
- throw e.getTargetException();
- } catch (CommunicationException e) {
- t = e;
}
+ throw e.getTargetException();
+ } catch (CommunicationException e) {
+ t = e;
}
throw t;
}
@@ -222,7 +230,6 @@
p = PropertiesUtils.clone(p);
p.remove(TeiidURL.JDBC.VDB_NAME);
p.remove(TeiidURL.JDBC.VDB_VERSION);
- p.setProperty(TeiidURL.CONNECTION.AUTO_FAILOVER, Boolean.TRUE.toString());
p.setProperty(TeiidURL.CONNECTION.ADMIN, Boolean.TRUE.toString());
try {
Modified: branches/7.0.x/client/src/main/java/org/teiid/net/ServerConnection.java
===================================================================
--- branches/7.0.x/client/src/main/java/org/teiid/net/ServerConnection.java 2010-06-21 20:28:17 UTC (rev 2270)
+++ branches/7.0.x/client/src/main/java/org/teiid/net/ServerConnection.java 2010-06-21 21:31:14 UTC (rev 2271)
@@ -23,6 +23,7 @@
package org.teiid.net;
import org.teiid.client.security.LogonResult;
+import org.teiid.client.util.ResultsFuture;
public interface ServerConnection {
@@ -32,7 +33,7 @@
void close();
- boolean isOpen();
+ ResultsFuture<?> isOpen();
LogonResult getLogonResult();
Modified: branches/7.0.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
===================================================================
--- branches/7.0.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-06-21 20:28:17 UTC (rev 2270)
+++ branches/7.0.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-06-21 21:31:14 UTC (rev 2271)
@@ -49,6 +49,7 @@
import org.teiid.client.security.LogonException;
import org.teiid.client.security.LogonResult;
import org.teiid.client.util.ExceptionUtil;
+import org.teiid.client.util.ResultsFuture;
import org.teiid.core.TeiidComponentException;
import org.teiid.net.CommunicationException;
import org.teiid.net.ConnectionException;
@@ -100,20 +101,25 @@
private void schedulePing() {
if (this.pingTimer != null) {
this.pingTimer.schedule(new TimerTask() {
+
+ private ResultsFuture<?> ping;
+
@Override
public void run() {
- try {
- if (isOpen()) {
- logon.ping();
- return;
- }
- } catch (InvalidSessionException e) {
- shutdown(false);
- } catch (TeiidComponentException e) {
- close();
+ if (ping == null || !ping.isDone()) {
+ ping = isOpen();
}
- this.cancel();
+ if (ping != null && ping.isDone()) {
+ try {
+ ping.get();
+ return;
+ } catch (Throwable e) {
+ handlePingError(e);
+ }
+ }
+ this.cancel();
}
+
}, PING_INTERVAL, PING_INTERVAL);
}
}
@@ -128,10 +134,8 @@
if (closed) {
throw new CommunicationException(NetPlugin.Util.getString("SocketServerConnection.closed")); //$NON-NLS-1$
}
- if (this.serverInstance != null) {
- if (this.serverInstance.isOpen()) {
- return this.serverInstance;
- }
+ if (this.serverInstance != null && (!failOver || this.serverInstance.isOpen())) {
+ return this.serverInstance;
}
List<HostInfo> hostKeys = new ArrayList<HostInfo>(this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance));
closeServerInstance();
@@ -221,15 +225,10 @@
} catch (Throwable t) {
exception = t;
}
- if (exception instanceof SingleInstanceCommunicationException
- || exception.getCause() instanceof SingleInstanceCommunicationException) {
- if (!failOver || !isOpen()) {
- break;
- }
- invalidateTarget();
- } else {
+ if (!failOver || ExceptionUtil.getExceptionOfType(exception, SingleInstanceCommunicationException.class) == null) {
break;
}
+ invalidateTarget();
//TODO: look for invalid session exception
}
throw ExceptionUtil.convertException(method, exception);
@@ -275,18 +274,33 @@
this.closed = true;
this.serverDiscovery.shutdown();
}
-
- public synchronized boolean isOpen() {
+
+ public synchronized ResultsFuture<?> isOpen() {
if (this.closed) {
- return false;
+ return null;
}
try {
- return selectServerInstance().isOpen();
+ if (!selectServerInstance().isOpen()) {
+ return null;
+ }
} catch (CommunicationException e) {
- return false;
+ return null;
}
+ try {
+ return logon.ping();
+ } catch (Throwable th) {
+ return null;
+ }
}
+ private void handlePingError(Throwable th) {
+ if (ExceptionUtil.getExceptionOfType(th, InvalidSessionException.class) != null) {
+ shutdown(false);
+ } else {
+ close();
+ }
+ }
+
public LogonResult getLogonResult() {
return logonResult;
}
Modified: branches/7.0.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
===================================================================
--- branches/7.0.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java 2010-06-21 20:28:17 UTC (rev 2270)
+++ branches/7.0.x/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java 2010-06-21 21:31:14 UTC (rev 2271)
@@ -38,6 +38,7 @@
import org.teiid.client.security.LogonException;
import org.teiid.client.security.LogonResult;
import org.teiid.client.util.ExceptionUtil;
+import org.teiid.client.util.ResultsFuture;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.dqp.internal.process.DQPWorkContext;
@@ -90,7 +91,7 @@
return iface.cast(Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new InvocationHandler() {
public Object invoke(Object arg0, final Method arg1, final Object[] arg2) throws Throwable {
- if (!isOpen()) {
+ if (shutdown) {
throw ExceptionUtil.convertException(arg1, new TeiidComponentException(NetPlugin.Util.getString("LocalTransportHandler.Transport_shutdown"))); //$NON-NLS-1$
}
try {
@@ -109,8 +110,12 @@
}));
}
- public boolean isOpen() {
- return !shutdown;
+ @Override
+ public ResultsFuture<?> isOpen() {
+ if (shutdown) {
+ return null;
+ }
+ return ResultsFuture.NULL_FUTURE;
}
public void close() {
14 years, 6 months