teiid SVN: r2478 - branches.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-17 16:32:57 -0400 (Tue, 17 Aug 2010)
New Revision: 2478
Added:
branches/7.1.x/
Removed:
branches/teiid-7.1.x/
Log:
correcting branch name
Copied: branches/7.1.x (from rev 2477, branches/teiid-7.1.x)
14 years, 4 months
teiid SVN: r2477 - branches.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-17 15:40:20 -0400 (Tue, 17 Aug 2010)
New Revision: 2477
Added:
branches/teiid-7.1.x/
Log:
adding 7.1 branch
Copied: branches/teiid-7.1.x (from rev 2476, tags/teiid-7.1.0.Final)
14 years, 4 months
teiid SVN: r2476 - in trunk: adminshell and 35 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-17 14:13:57 -0400 (Tue, 17 Aug 2010)
New Revision: 2476
Modified:
trunk/adminshell/pom.xml
trunk/api/pom.xml
trunk/build/pom.xml
trunk/cache-jbosscache/pom.xml
trunk/client/pom.xml
trunk/common-core/pom.xml
trunk/connectors/connector-file/pom.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-ws/pom.xml
trunk/connectors/pom.xml
trunk/connectors/salesforce-api/pom.xml
trunk/connectors/sandbox/pom.xml
trunk/connectors/sandbox/translator-yahoo/pom.xml
trunk/connectors/translator-file/pom.xml
trunk/connectors/translator-jdbc/pom.xml
trunk/connectors/translator-ldap/pom.xml
trunk/connectors/translator-loopback/pom.xml
trunk/connectors/translator-salesforce/pom.xml
trunk/connectors/translator-ws/pom.xml
trunk/console/pom.xml
trunk/documentation/admin-guide/pom.xml
trunk/documentation/caching-guide/pom.xml
trunk/documentation/client-developers-guide/pom.xml
trunk/documentation/developer-guide/pom.xml
trunk/documentation/pom.xml
trunk/documentation/quick-start-example/pom.xml
trunk/documentation/reference/pom.xml
trunk/engine/pom.xml
trunk/hibernate-dialect/pom.xml
trunk/jboss-integration/pom.xml
trunk/metadata/pom.xml
trunk/pom.xml
trunk/runtime/pom.xml
trunk/test-integration/common/pom.xml
trunk/test-integration/db/pom.xml
trunk/test-integration/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/adminshell/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/api/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/build/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>build</artifactId>
Modified: trunk/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/cache-jbosscache/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-cache-jbosscache</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/client/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/common-core/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-core</artifactId>
Modified: trunk/connectors/connector-file/pom.xml
===================================================================
--- trunk/connectors/connector-file/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/connector-file/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-file</artifactId>
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/connector-ldap/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/connector-salesforce/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: trunk/connectors/connector-ws/pom.xml
===================================================================
--- trunk/connectors/connector-ws/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/connector-ws/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/connectors/salesforce-api/pom.xml
===================================================================
--- trunk/connectors/salesforce-api/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/salesforce-api/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: trunk/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/sandbox/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.connectors</groupId>
Modified: trunk/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-yahoo</artifactId>
Modified: trunk/connectors/translator-file/pom.xml
===================================================================
--- trunk/connectors/translator-file/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/translator-file/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Modified: trunk/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/translator-jdbc/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jdbc</artifactId>
Modified: trunk/connectors/translator-ldap/pom.xml
===================================================================
--- trunk/connectors/translator-ldap/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/translator-ldap/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ldap</artifactId>
Modified: trunk/connectors/translator-loopback/pom.xml
===================================================================
--- trunk/connectors/translator-loopback/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/translator-loopback/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Modified: trunk/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/translator-salesforce/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-salesforce</artifactId>
Modified: trunk/connectors/translator-ws/pom.xml
===================================================================
--- trunk/connectors/translator-ws/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/connectors/translator-ws/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/console/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/documentation/admin-guide/pom.xml
===================================================================
--- trunk/documentation/admin-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/documentation/admin-guide/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>admin-guide</artifactId>
Modified: trunk/documentation/caching-guide/pom.xml
===================================================================
--- trunk/documentation/caching-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/documentation/caching-guide/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>caching-guide</artifactId>
Modified: trunk/documentation/client-developers-guide/pom.xml
===================================================================
--- trunk/documentation/client-developers-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/documentation/client-developers-guide/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>client-developers-guide</artifactId>
Modified: trunk/documentation/developer-guide/pom.xml
===================================================================
--- trunk/documentation/developer-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/documentation/developer-guide/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>developer-guide</artifactId>
Modified: trunk/documentation/pom.xml
===================================================================
--- trunk/documentation/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/documentation/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/documentation/quick-start-example/pom.xml
===================================================================
--- trunk/documentation/quick-start-example/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/documentation/quick-start-example/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-example</artifactId>
Modified: trunk/documentation/reference/pom.xml
===================================================================
--- trunk/documentation/reference/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/documentation/reference/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>reference</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/engine/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/hibernate-dialect/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/jboss-integration/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -2,13 +2,13 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-jboss-integration</artifactId>
<name>teiid-jboss-integration</name>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
<description>JBoss specific integration layer for teiid</description>
<dependencies>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/metadata/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -5,15 +5,15 @@
<artifactId>teiid</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
<site.url>http://www.jboss.org/teiid</site.url>
</properties>
<scm>
- <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/tags/teiid-7.1.0.Final</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-7.1.0.Final</developerConnection>
+ <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/trunk</developerConnection>
</scm>
<licenses>
<license>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/runtime/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/test-integration/common/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-integration-common</artifactId>
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/test-integration/db/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -19,7 +19,7 @@
<groupId>org.jboss.teiid.teiid-test-integration</groupId>
<description>Integration tests that require external database dependencies </description>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
<dependencies>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
+++ trunk/test-integration/pom.xml 2010-08-17 18:13:57 UTC (rev 2476)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final</version>
+ <version>7.2.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
14 years, 4 months
teiid SVN: r2475 - in tags: teiid-7.1.0.Final and 39 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-17 14:13:00 -0400 (Tue, 17 Aug 2010)
New Revision: 2475
Added:
tags/teiid-7.1.0.Final/
tags/teiid-7.1.0.Final/adminshell/pom.xml
tags/teiid-7.1.0.Final/api/pom.xml
tags/teiid-7.1.0.Final/build/kits/jboss-container/teiid-releasenotes.html
tags/teiid-7.1.0.Final/build/pom.xml
tags/teiid-7.1.0.Final/cache-jbosscache/pom.xml
tags/teiid-7.1.0.Final/client/pom.xml
tags/teiid-7.1.0.Final/common-core/pom.xml
tags/teiid-7.1.0.Final/connectors/connector-file/pom.xml
tags/teiid-7.1.0.Final/connectors/connector-ldap/pom.xml
tags/teiid-7.1.0.Final/connectors/connector-salesforce/pom.xml
tags/teiid-7.1.0.Final/connectors/connector-ws/pom.xml
tags/teiid-7.1.0.Final/connectors/pom.xml
tags/teiid-7.1.0.Final/connectors/salesforce-api/pom.xml
tags/teiid-7.1.0.Final/connectors/sandbox/pom.xml
tags/teiid-7.1.0.Final/connectors/sandbox/translator-yahoo/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-file/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-jdbc/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-ldap/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-loopback/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-salesforce/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-ws/pom.xml
tags/teiid-7.1.0.Final/console/pom.xml
tags/teiid-7.1.0.Final/documentation/admin-guide/pom.xml
tags/teiid-7.1.0.Final/documentation/caching-guide/pom.xml
tags/teiid-7.1.0.Final/documentation/client-developers-guide/pom.xml
tags/teiid-7.1.0.Final/documentation/developer-guide/pom.xml
tags/teiid-7.1.0.Final/documentation/pom.xml
tags/teiid-7.1.0.Final/documentation/quick-start-example/pom.xml
tags/teiid-7.1.0.Final/documentation/reference/pom.xml
tags/teiid-7.1.0.Final/engine/pom.xml
tags/teiid-7.1.0.Final/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
tags/teiid-7.1.0.Final/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
tags/teiid-7.1.0.Final/hibernate-dialect/pom.xml
tags/teiid-7.1.0.Final/jboss-integration/pom.xml
tags/teiid-7.1.0.Final/metadata/pom.xml
tags/teiid-7.1.0.Final/pom.xml
tags/teiid-7.1.0.Final/runtime/pom.xml
tags/teiid-7.1.0.Final/test-integration/common/pom.xml
tags/teiid-7.1.0.Final/test-integration/db/pom.xml
tags/teiid-7.1.0.Final/test-integration/pom.xml
Removed:
tags/teiid-7.1.0.Final/adminshell/pom.xml
tags/teiid-7.1.0.Final/api/pom.xml
tags/teiid-7.1.0.Final/build/kits/jboss-container/teiid-releasenotes.html
tags/teiid-7.1.0.Final/build/pom.xml
tags/teiid-7.1.0.Final/cache-jbosscache/pom.xml
tags/teiid-7.1.0.Final/client/pom.xml
tags/teiid-7.1.0.Final/common-core/pom.xml
tags/teiid-7.1.0.Final/connectors/connector-file/pom.xml
tags/teiid-7.1.0.Final/connectors/connector-ldap/pom.xml
tags/teiid-7.1.0.Final/connectors/connector-salesforce/pom.xml
tags/teiid-7.1.0.Final/connectors/connector-ws/pom.xml
tags/teiid-7.1.0.Final/connectors/pom.xml
tags/teiid-7.1.0.Final/connectors/salesforce-api/pom.xml
tags/teiid-7.1.0.Final/connectors/sandbox/pom.xml
tags/teiid-7.1.0.Final/connectors/sandbox/translator-yahoo/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-file/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-jdbc/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-ldap/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-loopback/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-salesforce/pom.xml
tags/teiid-7.1.0.Final/connectors/translator-ws/pom.xml
tags/teiid-7.1.0.Final/console/pom.xml
tags/teiid-7.1.0.Final/documentation/admin-guide/pom.xml
tags/teiid-7.1.0.Final/documentation/caching-guide/pom.xml
tags/teiid-7.1.0.Final/documentation/client-developers-guide/pom.xml
tags/teiid-7.1.0.Final/documentation/developer-guide/pom.xml
tags/teiid-7.1.0.Final/documentation/pom.xml
tags/teiid-7.1.0.Final/documentation/quick-start-example/pom.xml
tags/teiid-7.1.0.Final/documentation/reference/pom.xml
tags/teiid-7.1.0.Final/engine/pom.xml
tags/teiid-7.1.0.Final/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
tags/teiid-7.1.0.Final/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
tags/teiid-7.1.0.Final/hibernate-dialect/pom.xml
tags/teiid-7.1.0.Final/jboss-integration/pom.xml
tags/teiid-7.1.0.Final/metadata/pom.xml
tags/teiid-7.1.0.Final/pom.xml
tags/teiid-7.1.0.Final/runtime/pom.xml
tags/teiid-7.1.0.Final/test-integration/common/pom.xml
tags/teiid-7.1.0.Final/test-integration/db/pom.xml
tags/teiid-7.1.0.Final/test-integration/pom.xml
Log:
[maven-release-plugin] copy for tag teiid-7.1.0.Final
Copied: tags/teiid-7.1.0.Final (from rev 2470, trunk)
Deleted: tags/teiid-7.1.0.Final/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/adminshell/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-adminshell</artifactId>
- <name>Adminshell</name>
- <description>Adminshell for Teiid</description>
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-all</artifactId>
- <version>1.7.2</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jline</groupId>
- <artifactId>jline</artifactId>
- <version>0.9.94</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.fusesource.jansi</groupId>
- <artifactId>jansi</artifactId>
- <version>1.2.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>1.2</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/adminshell/pom.xml (from rev 2474, trunk/adminshell/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/adminshell/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/adminshell/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-adminshell</artifactId>
+ <name>Adminshell</name>
+ <description>Adminshell for Teiid</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.fusesource.jansi</groupId>
+ <artifactId>jansi</artifactId>
+ <version>1.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>1.2</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/api/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-api</artifactId>
- <name>Teiid Translator API</name>
- <description>API for creating Translators and other common extenders in Teiid</description>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-</project>
Copied: tags/teiid-7.1.0.Final/api/pom.xml (from rev 2474, trunk/api/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/api/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/api/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-api</artifactId>
+ <name>Teiid Translator API</name>
+ <description>API for creating Translators and other common extenders in Teiid</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+</project>
Deleted: tags/teiid-7.1.0.Final/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/build/kits/jboss-container/teiid-releasenotes.html 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,200 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
- <TITLE>Teiid ${project.version} Release Notes</TITLE>
- <META NAME="CHANGEDBY" CONTENT="Steve Hawkins">
- </STYLE>
-</HEAD>
-<BODY LANG="en-US" DIR="LTR">
-<P><A HREF="http://www.teiid.org/"><IMG SRC="https://www.jboss.org/dms/teiid/images/teiid_banner.png" NAME="graphics1" ALT="Teiid" ALIGN=BOTTOM WIDTH=800></A>
-
-<H1>Teiid ${project.version} Release Notes</H1>
-<P>Teiid ${project.version} adds ODBC, SQL, performance, and caching features.
-
-<H2>Overview</H2>
-<UL>
- <LI><A HREF="#Highlights">Highlights</A>
- <LI><A HREF="#Compatibility">Compatibility Issues</A>
- <LI><A HREF="#Configuration">Configuration Issues</A>
- <LI><A HREF="#Other">Other Issues</A>
- <LI><A HREF="#LibraryUpdates">Thirdparty Library Updates</A>
- <LI><A HREF="#Details">Detailed Release Notes</A>
- <LI><A HREF="#Documentation">Additional Docs and Help</A>
- <LI><A HREF="#Licenses">Licenses</A>
- <LI><A HREF="#About">About JBoss</A>
-</UL>
-<H2><A NAME="Highlights"></A>Highlights</H2>
-<UL>
- <LI><B>ODBC Support</B> - Support for ODBC access is now available through PostgreSQL ODBC driver clients. See the Client Developer's Guide for more on how
- to use Teiid's ODBC access.
- <LI><B>Native Materialized Tables</B> - views marked as materialized without a target table will be materialized internally by Teiid. Materialized view tables will
- be indexed by the primary key of the view if present and can be controlled through the expanded cache hint.
- There are also new system procedures refreshMatView and refreshMatViewRow to refresh materialized view contents.
- <LI><B>Expanded Cache Hint</B> - The cache hint can now specify pref_mem to indicate that data should prefer to be held in memory, ttl to indicate the time-to-live,
- and updatable to indicate that a materialized view with a primary key can be updated by row with the refreshMatViewRow system procedure.
- <LI><B>SQL Support</B>
- <ul>
- <li>Added NULLS FIST/LAST handling - including pushdown support.
- <li>Added enhanced numeric stat aggregate functions STDDEV_POP, STDDEV_SAMP, VAR_POP, VAR_SAMP, with pushdown and aggregate decomposition.
- <li>Added support for the boolean aggregate functions ANY, SOME, EVERY.
- <li>Added support for using boolean value expression as both criteria and expressions, e.g. "... where boolean_value" or "select x = 1 as boolean_value ...".
- <li>Changed named procedure syntax to accept param=>value, rather than param=value.
- <li>Added PRIMARY KEY and the associated index support to temp tables.
- </ul>
- <LI>
- <LI><B>Parallel Source Queries</B> - reestablished parallel execution of source queries within a query plan along with a prioritized work system to help prevent resource contention.
- <LI><B>Improved Insert Support</B> - Cross source inserts using a query expression can defer to the source to perform the entire insert atomically with source controlled batching.
- See maxPreparedInsertBatchSize on any JDBC translator supporting the InsertWithIterator capability.
- <LI><B>SHOW Statement</B> - added client handling for the SHOW statement to retrieve query plan information and see parameter values.
- <LI><B>User Identity</B> - Teiid DataSources in JBossAS connecting to a local Teiid instance can preserve the thread's user identity, rather than requiring
- a new authentication. See TeiidDataSource.setPassthroughAuthentication.
- <LI><B>VDB Versioning</B> - The VDB version may be determined by the deployed file name. The expected pattern is <VDB Name>.<Version>.vdb. See the Admin Guide
- for more on how to use VDB versioning.
-</UL>
-
-<h2><a name="Compatibility">Compatibility Issues</a></h2>
-<ul>
- <li>Support for named parameter syntax using param=value has been deprecated, since it is ambiguous with a comparison predicate boolean value expression. param<b>=></b>value should be used instead.
-</ul>
-<h4>from 7.0</h4>
-<ul>
- <li>The term data policy was replaced with data role. The AdminAPI methods for adding role mappings have changed from addRoleToDataPolicy and removeRoleFromDataPolicy to addDataRoleMapping and removeDataRoleMapping respectively.
-</ul>
-<h4>from 6.2</h4>
-<ul>
- <li>The connector API has changed substantially. Custom connectors need to be retargeted to the new Translator API. See <a href="https://jira.jboss.org/browse/TEIID-1003">TEIID-1003</a> and the <a href="teiid-docs/teiid_developers_guide.pdf">Developer's Guide</a> for more information.
- <li>Connector bindings are no longer valid. Use the Designer Tooling or see the AdminShell download for a migration utility.
- <li>Calling out to web services and xml processing has been dramatically simplified and improved, but is a breaking change from prior releases.
- XML/Relational processing has been replaced by XMLTABLE, retrieving XML from file has been replaced by the File Translator/Resource Adapter, and
- web service calls have been replaced by the WS Translator/Resource Adapter. See <a href="https://jira.jboss.org/browse/TEIID-1118">TEIID-1118</a>, <a href="https://jira.jboss.org/browse/TEIID-1114">TEIID-1114</a>, and the <a href="teiid-docs/teiid_reference.pdf">Reference</a> guide for more information.
- <li>The direct usage of XQuery has been replaced with the XMLQuery function.
- <li>The text connector file processing has been replaced with the TEXTTABLE function. See <a href="https://jira.jboss.org/browse/TEIID-1102">TEIID-1102</a> and the <a href="teiid-docs/teiid_reference.pdf">Reference</a> guide for more information
- <li>Double quoted values are now parsed as identifiers by default. See <a href="https://jira.jboss.org/browse/TEIID-145">TEIID-145</a> and the <a href="teiid-docs/teiid_reference.pdf">Reference</a> guide for more information.
- <li>The system information schema has changed from System to SYS. The tables and table structures have also changed. See <a href="https://jira.jboss.org/browse/TEIID-871">TEIID-871</a> and the <a href="teiid-docs/teiid_reference.pdf">Reference</a> guide for more information.
- <li>Client control over query plans has changed. OPTION PLANONLY, DEBUG, and SHOWPLAN are no longer allowed. This behavior should not be controlled by the SET statement, SET SHOWPLAN (ON|OFF|DEBUG) and SET NOEXEC (ON|OFF). Usage of the client PlanNode class will also need to be updated.
- <li>Teiid specific JDBC client interfaces and methods have changed. In general these custom features have mostly been moved to other more standard locations or been removed. See <a href="https://jira.jboss.org/browse/TEIID-1020">TEIID-1020</a> and the <a href="teiid-docs/teiid_client_developers_guide.pdf">Client Developers</a> guide for more information.
- <li>Teiid's reserved words have changed. Many of the Teiid specific reserved words have become non-reserved words. All of SQL Foundation and SQL/MED 2003, and SQL/XML from SQL 2006 reserved words have been added as reserved words. It is generally required to double quote all reserved words. It is advisable to double quote all non-reserved words as well. The use of the INPUT qualifier for procedure inputs has been deprecated in favor of INPUTS. The use of the USING qualifier for dynamic SQL inputs has been deprecated in favor of DVARS.
- <li>The AdminApi has been redesigned for use with the new Translator/JCA split and for deployment in JBoss AS.
- <li>The AdminShell is based on Groovy. Most BeanShell syntax is also valid in Groovy, but there are extensive changes in the AdminAPI that may necessitate rewriting scripts.
- <li>OPTION NO CACHE <table list> will now only by-pass cache for the given tables at their immediate view layer. Previously all caches would have transitively been skipped. See <a href="https://jira.jboss.org/browse/TEIID-900">TEIID-900</a> for more information.
- <li>Nan and +-Infinity are no longer allowed as numerical results by default. This may be changed via the system property org.teiid.allowNanInfinity.
- <li>The scale of BigDecimal values is now adjusted to allow for more intuitive results. Conversion from floating numeric types will preserve the approximate scale and division results will allow for additional scale. See <a href="https://jira.jboss.org/browse/TEIID-159">TEIID-159</a> for more information.
- <li>The 7.0 client is not compatible with 6.x or vice versa. It is expected that 7.0 clients will be compatible with 7.x releases for standard JDBC operations.
-</ul>
-
-<h2><a name="Configuration">Configuration Issues</a></h2>
-
-See the See the <a href="teiid-docs/teiid_admin_guide.pdf">Admin Guide</a> for more on configuration and installation.
-<h4>from 7.0</h4>
-<ul>
- <li>The property to enable data roles in teiid-jboss-beans.xml has changed from useEntitlements to useDataRoles.
- <li>Rar file names no longer contain version numbers. -ds.xml files should be updated from connector-XXX-version.rar to teiid-connector-XXX.rar
- <li>Code table relate configuration properties have been removed. Code tables are now implemented as materialized views.
-</ul>
-
-<h4>from 6.2</h4>
-<ul>
- <li>A JBoss AS instance is now required. Embedded mode is also currently not supported.</li>
- <li>Engine configuration is now handled through the admin console or deploy/teiid/teiid-jboss-beans.xml
- <li>Logging is now done through the container's log4j instance. Any Teiid specific logging changes, see the conf/jboss-teiid-log4j.xml, need to be incorporated into the master jboss-log4j.xml.
-</ul>
-
-<h2><a name="Other">Other Issues</a></h2>
-<ul>
- <li>For compatibility with the 7.0 release if a stored procedure parameter list begins with identifier=, then it will be parsed as a named parameter invocation even if the intent was to use a comparison predicate
- as the first parameter value. The workaround is to use nesting parens, e.g. call proc((identifier=value), ...), which clarifies that this is positional value. This workaround will not be needed in later releases.
-</ul>
-<h4>from 7.0</h4>
-<ul>
- <li>Fixed xsd type handling for SQL/XML and XML document models. xsd:date, xsd:dateTime, and xsd:time types will now all be displayed using the GMT timezone (Z). SQL types, such as timestamp, used for an XMLTABLE column will now expect their values to be in the form of the corresponding xsd type.
-</ul>
-<h4>From 6.2</h4>
-<ul>
- <li>Start time is now significantly longer due to the container deployment. However many operations can be performed on configruation files that will trigger a redeployment without the need for a restart.
- <li>Inversion of parse, format, and convert system functions is not used if it can be narrowing. In situations where a predicate has the form: parseTime(column, 'format') = {t 'time value'} may lead to reduced performance, since
- the parseTime function cannot be pushed down. This should be addressed in future releases.
-</ul>
-
-<h4>Salesforce as Source</h4>
-Before Salesforce is used in your data integration project, the below issues need to be resolved.
-<ul>
- <li>Manually copy the following libraries from the JBOSS_HOME/client directory to the JBOSS_HOME/lib/endorsed directory, so that the JAX-WS 2.0 apis supported by JBossWS are used:
- <ul>
- <li>jbossws-native-saaj.jar</li>
- <li>jbossws-native-jaxrpc.jar</li>
- <li>jbossws-native-jaxws.jar</li>
- <li>jbossws-native-jaxws-ext.jar</li>
- </ul>
- </li>
- <li>There is issue with invoking "https" based URL with out specifying the either a keystore or truststore properties with JBoss remoting 2.5.1. Generally you do not need to specify the truststore as a anonymous truststore will be negotiated, however if you fail to supply the following system properties there will be a error message in the log (query will execute even with out the properties). Add these to JBOSS_INSTALL/bin/run.conf file under JAVA_OPTS
- <ul>
- <li>-Djava.net.ssl.keyStore=<path-to-truststore></li>
- <li>-Djava.net.ssl.keyStoreType=<certificate-type></li>
- <li>-Djava.net.ssl.keyStorePassword=<password></li>
- </ul>
- </li>
-</ul>
-
-<h2><a name="LibraryUpdates">Thirdparty Library Updates</a></h2>
-
-The following components have been updated:
-<h4>From 7.0</h4>
-<ul>
- <li>Direct integration of JBossCache jars were removed.
- <li>Netty was upgraded to 3.2.0
- <li>JDOM was removed.
-</ul>
-<h4>From 6.2</h4>
-<ul>
- <li>Netty was upgraded to 3.1.5
- <li>Saxon was upgraded to 9.1.0.8
- <li>A 5.1 container's version of Arjuna is newer than what was previously included in Teiid 6.x.
- <li>Various other dependencies have been removed as they are no longer needed or now provided by the container.
-</ul>
-
-<h2><a name="Details">Detailed Release Notes</a></h2>
- Detailed Release Notes - Teiid - Version 7.1
-
-<h2><a name="Documentation">Documentation and Help</a></h2>
-
-The <a href="http://www.jboss.org/teiid/">Teiid community project</a> is hosted on jboss.org.
-Documentation and help may be obtained from the local distribution under <a href="teiid-docs">teiid-docs</a> or the following locations.
-<ul>
-
-<li><a href="http://www.jboss.org/teiid/docs">Online Documentation</a></li>
-<li><a href="https://community.jboss.org/wiki/TheTeiidProject">Wiki</a></li>
-<li><a href="http://jira.jboss.org/jira/browse/TEIID">JIRA</a></li>
-<li><a href="http://community.jboss.org/en/teiid?view=discussions">Forums</a></li>
-</ul>
-
-
-<h2><a name="Licenses">Licenses</a></h2>
-
-<p>Teiid is licensed under the <a href="LICENSE-lgpl-2.1.txt">LGPL</a>. The
-license texts for Teiid and the thirdparty components it uses may be found in the teiid-docs/licenses
-directory of the distribution. <a href="teiid-docs/licenses">Browse
-Licenses</a>
-
-</p>
-
-<h2><a name="About">About JBoss, a
-division of Red Hat</a></h2>
-
-<p>JBoss, a division of <a href="http://www.redhat.com/jboss/">Red
-Hat</a>, is in the business of
-providing
-superior technical support to our customers. Our goal is to make
-Professional Open Source™ the <b>SAFE
-CHOICE</b>
-for you. We accomplish this by backing up our open source Java products
-with technical support services that are delivered by the core
-developers themselves. We can help you to train your staff and provide
-you with support at every stage of the application lifecycle - from
-development and integration through deployment and maintenance. Visit
-the <a href="http://www.jboss.com/services/index">JBoss
-Services</a> page for more
-information.</p>
-
-</BODY>
-</HTML>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/build/kits/jboss-container/teiid-releasenotes.html (from rev 2473, trunk/build/kits/jboss-container/teiid-releasenotes.html)
===================================================================
--- tags/teiid-7.1.0.Final/build/kits/jboss-container/teiid-releasenotes.html (rev 0)
+++ tags/teiid-7.1.0.Final/build/kits/jboss-container/teiid-releasenotes.html 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,367 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+ <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
+ <TITLE>Teiid ${project.version} Release Notes</TITLE>
+ <META NAME="CHANGEDBY" CONTENT="Steve Hawkins">
+ </STYLE>
+</HEAD>
+<BODY LANG="en-US" DIR="LTR">
+<P><A HREF="http://www.teiid.org/"><IMG SRC="https://www.jboss.org/dms/teiid/images/teiid_banner.png" NAME="graphics1" ALT="Teiid" ALIGN=BOTTOM WIDTH=800></A>
+
+<H1>Teiid ${project.version} Release Notes</H1>
+<P>Teiid ${project.version} adds ODBC, SQL, performance, and caching features.
+
+<H2>Overview</H2>
+<UL>
+ <LI><A HREF="#Highlights">Highlights</A>
+ <LI><A HREF="#Compatibility">Compatibility Issues</A>
+ <LI><A HREF="#Configuration">Configuration Issues</A>
+ <LI><A HREF="#Other">Other Issues</A>
+ <LI><A HREF="#LibraryUpdates">Thirdparty Library Updates</A>
+ <LI><A HREF="#Details">Detailed Release Notes</A>
+ <LI><A HREF="#Documentation">Additional Docs and Help</A>
+ <LI><A HREF="#Licenses">Licenses</A>
+ <LI><A HREF="#About">About JBoss</A>
+</UL>
+<H2><A NAME="Highlights"></A>Highlights</H2>
+<UL>
+ <LI><B>ODBC Support</B> - Support for ODBC access is now available through PostgreSQL ODBC driver clients. See the Client Developer's Guide for more on how
+ to use Teiid's ODBC access.
+ <LI><B>Native Materialized Tables</B> - views marked as materialized without a target table will be materialized internally by Teiid. Materialized view tables will
+ be indexed by the primary key of the view if present and can be controlled through the expanded cache hint.
+ There are also new system procedures refreshMatView and refreshMatViewRow to refresh internal materialized view contents.
+ <LI><B>Expanded Cache Hint</B> - The cache hint can now specify pref_mem to indicate that data should prefer to be held in memory, ttl to indicate the time-to-live,
+ and updatable to indicate that a materialized view with a primary key can be updated by row with the refreshMatViewRow system procedure.
+ <LI><B>SQL Support</B>
+ <ul>
+ <li>Added NULLS FIST/LAST handling - including pushdown support.
+ <li>Added enhanced numeric stat aggregate functions STDDEV_POP, STDDEV_SAMP, VAR_POP, VAR_SAMP, with pushdown and aggregate decomposition.
+ <li>Added support for the boolean aggregate functions ANY, SOME, EVERY.
+ <li>Added support for using boolean value expression as both criteria and expressions, e.g. "... where boolean_value" or "select x = 1 as boolean_value ...".
+ <li>Changed named procedure syntax to accept param=>value, rather than param=value.
+ <li>Added PRIMARY KEY and the associated index support to temp tables.
+ </ul>
+ <LI>
+ <LI><B>Parallel Source Queries</B> - reestablished parallel execution of source queries within a query plan along with a prioritized work system to help prevent resource contention.
+ <LI><B>Improved Insert Support</B> - Cross source inserts using a query expression can defer to the source to perform the entire insert atomically with source controlled batching.
+ See maxPreparedInsertBatchSize on any JDBC translator supporting the InsertWithIterator capability.
+ <LI><B>SHOW Statement</B> - added client handling for the SHOW statement to retrieve query plan information and see parameter values.
+ <LI><B>User Identity</B> - Teiid DataSources in JBossAS connecting to a local Teiid instance can preserve the thread's user identity, rather than requiring
+ a new authentication. See TeiidDataSource.setPassthroughAuthentication.
+ <LI><B>VDB Versioning</B> - The VDB version may be determined by the deployed file name. The expected pattern is <VDB Name>.<Version>.vdb. See the Admin Guide
+ for more on how to use VDB versioning.
+</UL>
+
+<h2><a name="Compatibility">Compatibility Issues</a></h2>
+<ul>
+ <li>Support for named parameter syntax using param=value has been deprecated, since it is ambiguous with a comparison predicate boolean value expression. param<b>=></b>value should be used instead.
+</ul>
+<h4>from 7.0</h4>
+<ul>
+ <li>The term data policy was replaced with data role. The AdminAPI methods for adding role mappings have changed from addRoleToDataPolicy and removeRoleFromDataPolicy to addDataRoleMapping and removeDataRoleMapping respectively.
+</ul>
+<h4>from 6.2</h4>
+<ul>
+ <li>The connector API has changed substantially. Custom connectors need to be retargeted to the new Translator API. See <a href="https://jira.jboss.org/browse/TEIID-1003">TEIID-1003</a> and the <a href="teiid-docs/teiid_developers_guide.pdf">Developer's Guide</a> for more information.
+ <li>Connector bindings are no longer valid. Use the Designer Tooling or see the AdminShell download for a migration utility.
+ <li>Calling out to web services and xml processing has been dramatically simplified and improved, but is a breaking change from prior releases.
+ XML/Relational processing has been replaced by XMLTABLE, retrieving XML from file has been replaced by the File Translator/Resource Adapter, and
+ web service calls have been replaced by the WS Translator/Resource Adapter. See <a href="https://jira.jboss.org/browse/TEIID-1118">TEIID-1118</a>, <a href="https://jira.jboss.org/browse/TEIID-1114">TEIID-1114</a>, and the <a href="teiid-docs/teiid_reference.pdf">Reference</a> guide for more information.
+ <li>The direct usage of XQuery has been replaced with the XMLQuery function.
+ <li>The text connector file processing has been replaced with the TEXTTABLE function. See <a href="https://jira.jboss.org/browse/TEIID-1102">TEIID-1102</a> and the <a href="teiid-docs/teiid_reference.pdf">Reference</a> guide for more information
+ <li>Double quoted values are now parsed as identifiers by default. See <a href="https://jira.jboss.org/browse/TEIID-145">TEIID-145</a> and the <a href="teiid-docs/teiid_reference.pdf">Reference</a> guide for more information.
+ <li>The system information schema has changed from System to SYS. The tables and table structures have also changed. See <a href="https://jira.jboss.org/browse/TEIID-871">TEIID-871</a> and the <a href="teiid-docs/teiid_reference.pdf">Reference</a> guide for more information.
+ <li>Client control over query plans has changed. OPTION PLANONLY, DEBUG, and SHOWPLAN are no longer allowed. This behavior should not be controlled by the SET statement, SET SHOWPLAN (ON|OFF|DEBUG) and SET NOEXEC (ON|OFF). Usage of the client PlanNode class will also need to be updated.
+ <li>Teiid specific JDBC client interfaces and methods have changed. In general these custom features have mostly been moved to other more standard locations or been removed. See <a href="https://jira.jboss.org/browse/TEIID-1020">TEIID-1020</a> and the <a href="teiid-docs/teiid_client_developers_guide.pdf">Client Developers</a> guide for more information.
+ <li>Teiid's reserved words have changed. Many of the Teiid specific reserved words have become non-reserved words. All of SQL Foundation and SQL/MED 2003, and SQL/XML from SQL 2006 reserved words have been added as reserved words. It is generally required to double quote all reserved words. It is advisable to double quote all non-reserved words as well. The use of the INPUT qualifier for procedure inputs has been deprecated in favor of INPUTS. The use of the USING qualifier for dynamic SQL inputs has been deprecated in favor of DVARS.
+ <li>The AdminApi has been redesigned for use with the new Translator/JCA split and for deployment in JBoss AS.
+ <li>The AdminShell is based on Groovy. Most BeanShell syntax is also valid in Groovy, but there are extensive changes in the AdminAPI that may necessitate rewriting scripts.
+ <li>OPTION NO CACHE <table list> will now only by-pass cache for the given tables at their immediate view layer. Previously all caches would have transitively been skipped. See <a href="https://jira.jboss.org/browse/TEIID-900">TEIID-900</a> for more information.
+ <li>Nan and +-Infinity are no longer allowed as numerical results by default. This may be changed via the system property org.teiid.allowNanInfinity.
+ <li>The scale of BigDecimal values is now adjusted to allow for more intuitive results. Conversion from floating numeric types will preserve the approximate scale and division results will allow for additional scale. See <a href="https://jira.jboss.org/browse/TEIID-159">TEIID-159</a> for more information.
+ <li>The 7.0 client is not compatible with 6.x or vice versa. It is expected that 7.0 clients will be compatible with 7.x releases for standard JDBC operations.
+</ul>
+
+<h2><a name="Configuration">Configuration Issues</a></h2>
+
+See the See the <a href="teiid-docs/teiid_admin_guide.pdf">Admin Guide</a> for more on configuration and installation.
+<h4>from 7.0</h4>
+<ul>
+ <li>The property to enable data roles in teiid-jboss-beans.xml has changed from useEntitlements to useDataRoles.
+ <li>Rar file names no longer contain version numbers. -ds.xml files should be updated from connector-XXX-version.rar to teiid-connector-XXX.rar
+ <li>Code table relate configuration properties have been removed. Code tables are now implemented as materialized views.
+</ul>
+
+<h4>from 6.2</h4>
+<ul>
+ <li>A JBoss AS instance is now required. Embedded mode is also currently not supported.</li>
+ <li>Engine configuration is now handled through the admin console or deploy/teiid/teiid-jboss-beans.xml
+ <li>Logging is now done through the container's log4j instance. Any Teiid specific logging changes, see the conf/jboss-teiid-log4j.xml, need to be incorporated into the master jboss-log4j.xml.
+</ul>
+
+<h2><a name="Other">Other Issues</a></h2>
+<ul>
+ <li>For compatibility with the 7.0 release if a stored procedure parameter list begins with identifier=, then it will be parsed as a named parameter invocation even if the intent was to use a comparison predicate
+ as the first parameter value. The workaround is to use nesting parens, e.g. call proc((identifier=value), ...), which clarifies that this is positional value. This workaround will not be needed in later releases.
+</ul>
+<h4>from 7.0</h4>
+<ul>
+ <li>Fixed xsd type handling for SQL/XML and XML document models. xsd:date, xsd:dateTime, and xsd:time types will now all be displayed using the GMT timezone (Z). SQL types, such as timestamp, used for an XMLTABLE column will now expect their values to be in the form of the corresponding xsd type.
+</ul>
+<h4>From 6.2</h4>
+<ul>
+ <li>Start time is now significantly longer due to the container deployment. However many operations can be performed on configruation files that will trigger a redeployment without the need for a restart.
+ <li>Inversion of parse, format, and convert system functions is not used if it can be narrowing. In situations where a predicate has the form: parseTime(column, 'format') = {t 'time value'} may lead to reduced performance, since
+ the parseTime function cannot be pushed down. This should be addressed in future releases.
+</ul>
+
+<h4>Salesforce as Source</h4>
+Before Salesforce is used in your data integration project, the below issues need to be resolved.
+<ul>
+ <li>Manually copy the following libraries from the JBOSS_HOME/client directory to the JBOSS_HOME/lib/endorsed directory, so that the JAX-WS 2.0 apis supported by JBossWS are used:
+ <ul>
+ <li>jbossws-native-saaj.jar</li>
+ <li>jbossws-native-jaxrpc.jar</li>
+ <li>jbossws-native-jaxws.jar</li>
+ <li>jbossws-native-jaxws-ext.jar</li>
+ </ul>
+ </li>
+ <li>There is issue with invoking "https" based URL with out specifying the either a keystore or truststore properties with JBoss remoting 2.5.1. Generally you do not need to specify the truststore as a anonymous truststore will be negotiated, however if you fail to supply the following system properties there will be a error message in the log (query will execute even with out the properties). Add these to JBOSS_INSTALL/bin/run.conf file under JAVA_OPTS
+ <ul>
+ <li>-Djava.net.ssl.keyStore=<path-to-truststore></li>
+ <li>-Djava.net.ssl.keyStoreType=<certificate-type></li>
+ <li>-Djava.net.ssl.keyStorePassword=<password></li>
+ </ul>
+ </li>
+</ul>
+
+<h2><a name="LibraryUpdates">Thirdparty Library Updates</a></h2>
+
+The following components have been updated:
+<h4>From 7.0</h4>
+<ul>
+ <li>Direct integration of JBossCache jars were removed.
+ <li>Netty was upgraded to 3.2.0
+ <li>JDOM was removed.
+</ul>
+<h4>From 6.2</h4>
+<ul>
+ <li>Netty was upgraded to 3.1.5
+ <li>Saxon was upgraded to 9.1.0.8
+ <li>A 5.1 container's version of Arjuna is newer than what was previously included in Teiid 6.x.
+ <li>Various other dependencies have been removed as they are no longer needed or now provided by the container.
+</ul>
+
+<h2><a name="Details">Detailed Release Notes</a></h2>
+ Detailed Release Notes - Teiid - Version ${project.version}
+<h2> Bug
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-76'>TEIID-76</a>] - Attempting to execute a procedure from MM to MM returns error "<procedure>() does not exist"
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-108'>TEIID-108</a>] - xsd type conversion should be consistent
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1107'>TEIID-1107</a>] - Add support for raising criteria if it has been pushed too far
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1140'>TEIID-1140</a>] - Unnecessary jars in the Teiid deployment
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1141'>TEIID-1141</a>] - getCatalogs call on DatabaseMetadata is returning no rows
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1144'>TEIID-1144</a>] - PostgreSQL (simple capabilities) returning an unexpected number of rows
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1145'>TEIID-1145</a>] - Unable to deploy VDB with virtual BQT2 model
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1147'>TEIID-1147</a>] - Sybase concat function handling
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1149'>TEIID-1149</a>] - Importing tables from a deployed VDB does not import columns
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1152'>TEIID-1152</a>] - Jopr Plugin Needs to Handle Secure ProfileService Connection
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1153'>TEIID-1153</a>] - Turned of ProfileService authenticatiion and it caused an NPE in the Teiid RHQ Plugin
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1157'>TEIID-1157</a>] - NPE with texttable planning
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1166'>TEIID-1166</a>] - Receiving ASSERTION FAILED: expected reference to be not null from SQL query with sub-select
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1169'>TEIID-1169</a>] - VDBs are not being displayed in Jopr
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1172'>TEIID-1172</a>] - Loopback translator fails to be invoked when a property is set
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1178'>TEIID-1178</a>] - Jopr VDB loading error when Data Source is not available
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1180'>TEIID-1180</a>] - the deprecated input group qualifier should be replaced with inputs
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1181'>TEIID-1181</a>] - Teiid Pushdown queries producing unexpected results (Sybase 12.5)
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1182'>TEIID-1182</a>] - UDF model is not being loaded if the file is not placed in the root location of VDB
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1183'>TEIID-1183</a>] - Cannot create a SalesForce datasource throught the admin API.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1185'>TEIID-1185</a>] - Shutting down JBoss AS server causes NPE in ClusterableCacheFactory
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1186'>TEIID-1186</a>] - broken internal link in Teiid Reference Documentation
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1188'>TEIID-1188</a>] - Error while reading the template properties for LDAP
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1192'>TEIID-1192</a>] - JDBC driver doesn't accept underscores _ in server names
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1200'>TEIID-1200</a>] - Non-parsable SQL in transformation provides no help to user - NPE in stack trace
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1201'>TEIID-1201</a>] - Property 'Url' with value 'vfsfile:/home/pnittel/Teiid71/jboss-5.1.0.GA/server/default/deploy/EyeTuneZ-vdb.xml' is not a valid URL
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1203'>TEIID-1203</a>] - "connector-ws" is not visible as one of the avaialble connectors
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1206'>TEIID-1206</a>] - NPE during the JDBC Metadata read when "resultSetCacheMode=true" turned on
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1208'>TEIID-1208</a>] - VDB "getStatus" through Admin API always returning "INACTIVE"
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1216'>TEIID-1216</a>] - Cannot pass xml result from one select as critera to another select
+</li>
+</ul>
+
+<h2> Feature Request
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-168'>TEIID-168</a>] - Refine caching behavior
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-250'>TEIID-250</a>] - Enable Axis data compression in SFDC Connector, per SFDC API guidelines
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-715'>TEIID-715</a>] - Add support for nulls first/last
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-829'>TEIID-829</a>] - revamp code table caching
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-860'>TEIID-860</a>] - Add odbc support
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-886'>TEIID-886</a>] - Request for more statistical functions in Teiid
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-892'>TEIID-892</a>] - Add a capability to control bulk insert batch size
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-908'>TEIID-908</a>] - Enable access to the query plan without reference to Teiid classes.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-968'>TEIID-968</a>] - Timestamp literals with fractional seconds result in source query execution performance when being compared to less percise time types
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1006'>TEIID-1006</a>] - Dynamic vdb metadata load enhancements
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1028'>TEIID-1028</a>] - Make Materialized Views first class objects in the system
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1048'>TEIID-1048</a>] - Embedded Connection should support the pass though authentication
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1151'>TEIID-1151</a>] - Re-enable multi-threaded source query execution
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1155'>TEIID-1155</a>] - Allow boolean value expressions to be used as criteria or expressions
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1167'>TEIID-1167</a>] - Add support for primary key handling in temp tables
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1177'>TEIID-1177</a>] - Allow for implicit temp table definition with just a query, omitting the columns
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1179'>TEIID-1179</a>] - Add a CommandContext interface to the teiid api
+</li>
+</ul>
+
+<h2> Patch
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1184'>TEIID-1184</a>] - Patch to refactor numbered <sect> tags in documentation to <section>
+</li>
+</ul>
+
+<h2> Quality Risk
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-954'>TEIID-954</a>] - Need method to control max amount of buffer disk space
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1150'>TEIID-1150</a>] - Introduce alternative named parameter syntax
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1154'>TEIID-1154</a>] - Remove JDOM
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1187'>TEIID-1187</a>] - Refine vdb version logic
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1190'>TEIID-1190</a>] - Procedure logic clean up
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1199'>TEIID-1199</a>] - Use consistent names for security concepts
+</li>
+</ul>
+
+<h2> Task
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-749'>TEIID-749</a>] - Replace the TestNoArgConnector Test with an integration test.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-882'>TEIID-882</a>] - Look into using javax.xml.xpath in the XML-Relational connectors.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-996'>TEIID-996</a>] - Administration of the granular entitlements to data elements should be supported using the management console.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1055'>TEIID-1055</a>] - Secure profile service access
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1142'>TEIID-1142</a>] - Teiid should work with EAP 5.1
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1143'>TEIID-1143</a>] - Remove the version number from the RAR files, to promote easy migration between the versions
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1160'>TEIID-1160</a>] - Add Support for Discovery of Dynamic VDBs in Teiid Jopr Plugin
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1165'>TEIID-1165</a>] - Upgrade to Netty 3.2.0 final
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1173'>TEIID-1173</a>] - Provide a facility to create "empty" VDBs for preview purpose
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1174'>TEIID-1174</a>] - Allow '-' character in VDB names.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1194'>TEIID-1194</a>] - Document the recommended approach to using Teiid entitlements
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1207'>TEIID-1207</a>] - Fix Yahoo Translator to work with "Dynamic Portfoilo" example
+</li>
+</ul>
+
+<h2> Sub-task
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-958'>TEIID-958</a>] - Provide ability to monitor buffer manager disk space usage and free space
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1189'>TEIID-1189</a>] - JOPR support for multiple versions
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1198'>TEIID-1198</a>] - Allow specifying the VDB version as part of the VDB name in the JDBC URL connection string.
+</li>
+</ul>
+
+<h2><a name="Documentation">Documentation and Help</a></h2>
+
+The <a href="http://www.jboss.org/teiid/">Teiid community project</a> is hosted on jboss.org.
+Documentation and help may be obtained from the local distribution under <a href="teiid-docs">teiid-docs</a> or the following locations.
+<ul>
+
+<li><a href="http://www.jboss.org/teiid/docs">Online Documentation</a></li>
+<li><a href="https://community.jboss.org/wiki/TheTeiidProject">Wiki</a></li>
+<li><a href="http://jira.jboss.org/jira/browse/TEIID">JIRA</a></li>
+<li><a href="http://community.jboss.org/en/teiid?view=discussions">Forums</a></li>
+</ul>
+
+
+<h2><a name="Licenses">Licenses</a></h2>
+
+<p>Teiid is licensed under the <a href="LICENSE-lgpl-2.1.txt">LGPL</a>. The
+license texts for Teiid and the thirdparty components it uses may be found in the teiid-docs/licenses
+directory of the distribution. <a href="teiid-docs/licenses">Browse
+Licenses</a>
+
+</p>
+
+<h2><a name="About">About JBoss, a
+division of Red Hat</a></h2>
+
+<p>JBoss, a division of <a href="http://www.redhat.com/jboss/">Red
+Hat</a>, is in the business of
+providing
+superior technical support to our customers. Our goal is to make
+Professional Open Source™ the <b>SAFE
+CHOICE</b>
+for you. We accomplish this by backing up our open source Java products
+with technical support services that are delivered by the core
+developers themselves. We can help you to train your staff and provide
+you with support at every stage of the application lifecycle - from
+development and integration through deployment and maintenance. Visit
+the <a href="http://www.jboss.com/services/index">JBoss
+Services</a> page for more
+information.</p>
+
+</BODY>
+</HTML>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/build/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,38 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>build</artifactId>
- <name>Build</name>
- <description>Teiid Build</description>
- <build>
- <outputDirectory>target/kits</outputDirectory>
- <resources>
- <resource>
- <directory>kits</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- <include>**/*.sh</include>
- <include>**/*.bat</include>
- <include>**/*.html</include>
- </includes>
- </resource>
- <resource>
- <directory>kits</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- <exclude>**/*.sh</exclude>
- <exclude>**/*.bat</exclude>
- <exclude>**/*.html</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/build/pom.xml (from rev 2474, trunk/build/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/build/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/build/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>build</artifactId>
+ <name>Build</name>
+ <description>Teiid Build</description>
+ <build>
+ <outputDirectory>target/kits</outputDirectory>
+ <resources>
+ <resource>
+ <directory>kits</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ <include>**/*.sh</include>
+ <include>**/*.bat</include>
+ <include>**/*.html</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>kits</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ <exclude>**/*.sh</exclude>
+ <exclude>**/*.bat</exclude>
+ <exclude>**/*.html</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/cache-jbosscache/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-cache-jbosscache</artifactId>
- <name>JBoss Cache</name>
- <description>JBossCache provider.</description>
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/cache-jbosscache/pom.xml (from rev 2474, trunk/cache-jbosscache/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/cache-jbosscache/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/cache-jbosscache/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-cache-jbosscache</artifactId>
+ <name>JBoss Cache</name>
+ <description>JBossCache provider.</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/client/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-client</artifactId>
- <name>Client</name>
- <description>Contains the packages related to communication, administrative api,
- sessioning and transport level messaging.</description>
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/client/pom.xml (from rev 2474, trunk/client/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/client/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/client/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-client</artifactId>
+ <name>Client</name>
+ <description>Contains the packages related to communication, administrative api,
+ sessioning and transport level messaging.</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/common-core/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-common-core</artifactId>
- <name>Common Core</name>
- <description>Core shared library</description>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <phase>process-resources</phase>
- <configuration>
- <tasks>
- <tstamp />
- <replace dir="${project.build.outputDirectory}" token="@build-date@" value="${DSTAMP}">
- <include name="**/*.properties" />
- </replace>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/common-core/pom.xml (from rev 2474, trunk/common-core/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/common-core/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/common-core/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-common-core</artifactId>
+ <name>Common Core</name>
+ <description>Core shared library</description>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <configuration>
+ <tasks>
+ <tstamp />
+ <replace dir="${project.build.outputDirectory}" token="@build-date@" value="${DSTAMP}">
+ <include name="**/*.properties" />
+ </replace>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/connectors/connector-file/pom.xml
===================================================================
--- trunk/connectors/connector-file/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/connector-file/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>connector-file</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>File Connector</name>
- <packaging>rar</packaging>
- <description>This connector reads data from files.</description>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <id>build_jar</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- <execution>
- <id>deploy_jar</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- <configuration>
- <classifier>lib</classifier>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/connectors/connector-file/pom.xml (from rev 2474, trunk/connectors/connector-file/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/connector-file/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/connector-file/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>connector-file</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>File Connector</name>
+ <packaging>rar</packaging>
+ <description>This connector reads data from files.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build_jar</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>deploy_jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classifier>lib</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/connector-ldap/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,57 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>connector-ldap</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>LDAP Connector</name>
- <description>LDAP Connector</description>
- <packaging>rar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <id>build_jar</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- <execution>
- <id>deploy_jar</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- <configuration>
- <classifier>lib</classifier>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/connectors/connector-ldap/pom.xml (from rev 2474, trunk/connectors/connector-ldap/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/connector-ldap/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/connector-ldap/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,57 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>connector-ldap</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>LDAP Connector</name>
+ <description>LDAP Connector</description>
+ <packaging>rar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build_jar</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>deploy_jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classifier>lib</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/connector-salesforce/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>connector-salesforce</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>Salesforce Connector</name>
- <packaging>rar</packaging>
- <description>Integrates the query engine with Salesforce.com.</description>
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid.connectors</groupId>
- <artifactId>salesforce-api</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid.connectors</groupId>
- <artifactId>translator-salesforce</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <id>build_jar</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- <execution>
- <id>deploy_jar</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- <configuration>
- <classifier>lib</classifier>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/connectors/connector-salesforce/pom.xml (from rev 2474, trunk/connectors/connector-salesforce/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/connector-salesforce/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/connector-salesforce/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>connector-salesforce</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>Salesforce Connector</name>
+ <packaging>rar</packaging>
+ <description>Integrates the query engine with Salesforce.com.</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>salesforce-api</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>translator-salesforce</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build_jar</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>deploy_jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classifier>lib</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/connectors/connector-ws/pom.xml
===================================================================
--- trunk/connectors/connector-ws/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/connector-ws/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>connector-ws</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>Web Service Connector</name>
- <packaging>rar</packaging>
- <description>This connector reads data from Web Services</description>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws.native</groupId>
- <artifactId>jbossws-native-core</artifactId>
- <version>3.1.1.GA</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <id>build_jar</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- <execution>
- <id>deploy_jar</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- <configuration>
- <classifier>lib</classifier>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
Copied: tags/teiid-7.1.0.Final/connectors/connector-ws/pom.xml (from rev 2474, trunk/connectors/connector-ws/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/connector-ws/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/connector-ws/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>connector-ws</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>Web Service Connector</name>
+ <packaging>rar</packaging>
+ <description>This connector reads data from Web Services</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ws.native</groupId>
+ <artifactId>jbossws-native-core</artifactId>
+ <version>3.1.1.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build_jar</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>deploy_jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classifier>lib</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Deleted: tags/teiid-7.1.0.Final/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>connectors</artifactId>
- <packaging>pom</packaging>
- <name>Connectors</name>
- <description>This project is aggregator for all the supported connectors.</description>
- <dependencies>
-
- <!-- Internal Test Dependencies -->
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-metadata</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-metadata</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <!-- External dependencies -->
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <modules>
- <module>translator-jdbc</module>
- <module>translator-ldap</module>
-
- <module>translator-loopback</module>
- <module>translator-file</module>
- <module>translator-salesforce</module>
-
- <module>connector-file</module>
- <module>connector-salesforce</module>
- <module>connector-ldap</module>
- <module>salesforce-api</module>
- <module>connector-ws</module>
-
- <module>sandbox</module>
-
- <module>translator-ws</module>
- </modules>
-</project>
Copied: tags/teiid-7.1.0.Final/connectors/pom.xml (from rev 2474, trunk/connectors/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>connectors</artifactId>
+ <packaging>pom</packaging>
+ <name>Connectors</name>
+ <description>This project is aggregator for all the supported connectors.</description>
+ <dependencies>
+
+ <!-- Internal Test Dependencies -->
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-metadata</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-metadata</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- External dependencies -->
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <modules>
+ <module>translator-jdbc</module>
+ <module>translator-ldap</module>
+
+ <module>translator-loopback</module>
+ <module>translator-file</module>
+ <module>translator-salesforce</module>
+
+ <module>connector-file</module>
+ <module>connector-salesforce</module>
+ <module>connector-ldap</module>
+ <module>salesforce-api</module>
+ <module>connector-ws</module>
+
+ <module>sandbox</module>
+
+ <module>translator-ws</module>
+ </modules>
+</project>
Deleted: tags/teiid-7.1.0.Final/connectors/salesforce-api/pom.xml
===================================================================
--- trunk/connectors/salesforce-api/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/salesforce-api/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,14 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>salesforce-api</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>Salesforce API</name>
- <description>The java API for the Salesforce.com partner web service API</description>
- <dependencies>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/connectors/salesforce-api/pom.xml (from rev 2474, trunk/connectors/salesforce-api/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/salesforce-api/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/salesforce-api/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,14 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>salesforce-api</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>Salesforce API</name>
+ <description>The java API for the Salesforce.com partner web service API</description>
+ <dependencies>
+ </dependencies>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/sandbox/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.teiid.connectors</groupId>
- <artifactId>sandbox</artifactId>
- <packaging>pom</packaging>
- <name>Sandbox</name>
- <description>Experimental connectors in progress</description>
- <modules>
- <module>translator-yahoo</module>
- </modules>
-</project>
Copied: tags/teiid-7.1.0.Final/connectors/sandbox/pom.xml (from rev 2474, trunk/connectors/sandbox/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/sandbox/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/sandbox/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>sandbox</artifactId>
+ <packaging>pom</packaging>
+ <name>Sandbox</name>
+ <description>Experimental connectors in progress</description>
+ <modules>
+ <module>translator-yahoo</module>
+ </modules>
+</project>
Deleted: tags/teiid-7.1.0.Final/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/sandbox/translator-yahoo/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>sandbox</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>translator-yahoo</artifactId>
- <groupId>org.jboss.teiid.connectors.sandbox</groupId>
- <name>Yahoo Translator</name>
- <description>Test translator used to query ticker symbols from Yahoo website</description>
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <outputDirectory>target/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-</project>
Copied: tags/teiid-7.1.0.Final/connectors/sandbox/translator-yahoo/pom.xml (from rev 2474, trunk/connectors/sandbox/translator-yahoo/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/sandbox/translator-yahoo/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/sandbox/translator-yahoo/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>sandbox</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>translator-yahoo</artifactId>
+ <groupId>org.jboss.teiid.connectors.sandbox</groupId>
+ <name>Yahoo Translator</name>
+ <description>Test translator used to query ticker symbols from Yahoo website</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
Deleted: tags/teiid-7.1.0.Final/connectors/translator-file/pom.xml
===================================================================
--- trunk/connectors/translator-file/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/translator-file/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>translator-file</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>File Translator</name>
- <description>This translator provides access to the file system.</description>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <outputDirectory>target/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-</project>
Copied: tags/teiid-7.1.0.Final/connectors/translator-file/pom.xml (from rev 2474, trunk/connectors/translator-file/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/translator-file/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/translator-file/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>translator-file</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>File Translator</name>
+ <description>This translator provides access to the file system.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
Deleted: tags/teiid-7.1.0.Final/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/translator-jdbc/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>translator-jdbc</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>JDBC Translator</name>
-
- <description>This project contains translators for a JDBC source. Currently this is an aggregator for all the JDBC translators relational databases.</description>
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <outputDirectory>target/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-
-</project>
Copied: tags/teiid-7.1.0.Final/connectors/translator-jdbc/pom.xml (from rev 2474, trunk/connectors/translator-jdbc/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/translator-jdbc/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/translator-jdbc/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>translator-jdbc</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>JDBC Translator</name>
+
+ <description>This project contains translators for a JDBC source. Currently this is an aggregator for all the JDBC translators relational databases.</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+
+</project>
Deleted: tags/teiid-7.1.0.Final/connectors/translator-ldap/pom.xml
===================================================================
--- trunk/connectors/translator-ldap/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/translator-ldap/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,52 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>translator-ldap</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>LDAP Translator</name>
- <description>LDAP Translator</description>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <outputDirectory>target/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-</project>
Copied: tags/teiid-7.1.0.Final/connectors/translator-ldap/pom.xml (from rev 2474, trunk/connectors/translator-ldap/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/translator-ldap/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/translator-ldap/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,52 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>translator-ldap</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>LDAP Translator</name>
+ <description>LDAP Translator</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
Deleted: tags/teiid-7.1.0.Final/connectors/translator-loopback/pom.xml
===================================================================
--- trunk/connectors/translator-loopback/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/translator-loopback/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>translator-loopback</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>Loopback Translator</name>
- <description>Loopback Translator</description>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <outputDirectory>target/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-</project>
Copied: tags/teiid-7.1.0.Final/connectors/translator-loopback/pom.xml (from rev 2474, trunk/connectors/translator-loopback/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/translator-loopback/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/translator-loopback/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>translator-loopback</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>Loopback Translator</name>
+ <description>Loopback Translator</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
Deleted: tags/teiid-7.1.0.Final/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/translator-salesforce/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>translator-salesforce</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>Salesforce Translator</name>
- <description>Integrates the query engine with Salesforce.com.</description>
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid.connectors</groupId>
- <artifactId>salesforce-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <outputDirectory>target/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-</project>
Copied: tags/teiid-7.1.0.Final/connectors/translator-salesforce/pom.xml (from rev 2474, trunk/connectors/translator-salesforce/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/translator-salesforce/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/translator-salesforce/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>translator-salesforce</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>Salesforce Translator</name>
+ <description>Integrates the query engine with Salesforce.com.</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>salesforce-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
Deleted: tags/teiid-7.1.0.Final/connectors/translator-ws/pom.xml
===================================================================
--- trunk/connectors/translator-ws/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/connectors/translator-ws/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>translator-ws</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>Web service Translator</name>
- <description>This translator provides access to Web Services.</description>
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <outputDirectory>target/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-
-</project>
Copied: tags/teiid-7.1.0.Final/connectors/translator-ws/pom.xml (from rev 2474, trunk/connectors/translator-ws/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/connectors/translator-ws/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/connectors/translator-ws/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>translator-ws</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>Web service Translator</name>
+ <description>This translator provides access to Web Services.</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+
+</project>
Deleted: tags/teiid-7.1.0.Final/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/console/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,181 +0,0 @@
-<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-console</artifactId>
- <name>Console</name>
- <description>This project is for the RHQ plugin that supports the TEIID Console </description>
-
- <properties>
- <!--
- <org.jboss.jopr.as4.version>1.2.0.GA</org.jboss.jopr.as4.version>
- -->
- <org.jboss.jopr.as5.version>1.2.0.GA</org.jboss.jopr.as5.version>
- <jopr.jboss.as5.plugin.version>1.4.0.B01</jopr.jboss.as5.plugin.version>
- <org.rhq.version>1.3.0.GA</org.rhq.version>
- <apache.ant.version>1.7.0</apache.ant.version>
-
-
- </properties>
-
- <dependencies>
- <!--
- Below are the core modules that are required dependencies of all
- plugins
- -->
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${org.rhq.version}</version>
- <scope>provided</scope>
- <!--
- provided by the agent/plugin-container
- -->
- </dependency>
-
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-plugin-api</artifactId>
- <version>${org.rhq.version}</version>
- <scope>provided</scope> <!-- provided by the agent/plugin-container -->
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-native-system</artifactId>
- <version>${org.rhq.version}</version>
- <scope>provided</scope> <!-- provided by the agent/plugin-container -->
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-jmx-plugin</artifactId>
- <version>${org.rhq.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-util</artifactId>
- <version>${org.rhq.version}</version>
- </dependency>
-
- <dependency>
- <groupId>mc4j</groupId>
- <artifactId>org-mc4j-ems</artifactId>
- <version>1.2.6</version>
- </dependency>
-
- <!--
- TODO: This is a fix for the Javac bug requiring annotations to be
- available when compiling dependent classes. It is fixed in JDK 6.
- -->
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope> <!-- provided by the agent/plugin-container -->
- </dependency>
-
-
- <!--
- TODO: This is a fix for the Javac bug requiring annotations to be
- available when compiling dependent classes; it is fixed in JDK 6.
- -->
- <dependency>
- <groupId>jboss.jboss-embeddable-ejb3</groupId>
- <artifactId>hibernate-all</artifactId>
- <version>1.0.0.Alpha9</version>
- <scope>provided</scope> <!-- provided by the agent/plugin-container -->
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <type>test-jar</type>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.jopr</groupId>
- <artifactId>jopr-embedded-jbas5</artifactId>
- <type>war</type>
- <version>${org.jboss.jopr.as5.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.integration</groupId>
- <artifactId>jboss-profileservice-spi</artifactId>
- <version>5.1.0.CR2</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.on</groupId>
- <artifactId>jopr-jboss-as-5-plugin</artifactId>
- <version>${jopr.jboss.as5.plugin.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.3.2</version>
- </dependency>
-
-
-
- </dependencies>
-
- <build>
- <outputDirectory>target/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-
-
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/console/pom.xml (from rev 2474, trunk/console/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/console/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/console/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,181 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-console</artifactId>
+ <name>Console</name>
+ <description>This project is for the RHQ plugin that supports the TEIID Console </description>
+
+ <properties>
+ <!--
+ <org.jboss.jopr.as4.version>1.2.0.GA</org.jboss.jopr.as4.version>
+ -->
+ <org.jboss.jopr.as5.version>1.2.0.GA</org.jboss.jopr.as5.version>
+ <jopr.jboss.as5.plugin.version>1.4.0.B01</jopr.jboss.as5.plugin.version>
+ <org.rhq.version>1.3.0.GA</org.rhq.version>
+ <apache.ant.version>1.7.0</apache.ant.version>
+
+
+ </properties>
+
+ <dependencies>
+ <!--
+ Below are the core modules that are required dependencies of all
+ plugins
+ -->
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${org.rhq.version}</version>
+ <scope>provided</scope>
+ <!--
+ provided by the agent/plugin-container
+ -->
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-plugin-api</artifactId>
+ <version>${org.rhq.version}</version>
+ <scope>provided</scope> <!-- provided by the agent/plugin-container -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-native-system</artifactId>
+ <version>${org.rhq.version}</version>
+ <scope>provided</scope> <!-- provided by the agent/plugin-container -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-jmx-plugin</artifactId>
+ <version>${org.rhq.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-util</artifactId>
+ <version>${org.rhq.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>mc4j</groupId>
+ <artifactId>org-mc4j-ems</artifactId>
+ <version>1.2.6</version>
+ </dependency>
+
+ <!--
+ TODO: This is a fix for the Javac bug requiring annotations to be
+ available when compiling dependent classes. It is fixed in JDK 6.
+ -->
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope> <!-- provided by the agent/plugin-container -->
+ </dependency>
+
+
+ <!--
+ TODO: This is a fix for the Javac bug requiring annotations to be
+ available when compiling dependent classes; it is fixed in JDK 6.
+ -->
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>hibernate-all</artifactId>
+ <version>1.0.0.Alpha9</version>
+ <scope>provided</scope> <!-- provided by the agent/plugin-container -->
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jopr</groupId>
+ <artifactId>jopr-embedded-jbas5</artifactId>
+ <type>war</type>
+ <version>${org.jboss.jopr.as5.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-profileservice-spi</artifactId>
+ <version>5.1.0.CR2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.on</groupId>
+ <artifactId>jopr-jboss-as-5-plugin</artifactId>
+ <version>${jopr.jboss.as5.plugin.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+
+
+
+ </dependencies>
+
+ <build>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+
+
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/documentation/admin-guide/pom.xml
===================================================================
--- trunk/documentation/admin-guide/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/documentation/admin-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,77 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>admin-guide</artifactId>
- <groupId>org.jboss.teiid.documentation</groupId>
- <packaging>jdocbook</packaging>
- <name>Admin Guide</name>
- <description>The Teiid Admin manual</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.1.2</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>net.sf.docbook</groupId>
- <artifactId>docbook</artifactId>
- <version>1.74.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>admin_guide.xml</sourceDocumentName>
- <imageResource>
- <directory>${basedir}/src/main/docbook/en-US</directory>
- <excludes>
- <exclude>*.xml</exclude>
- <exclude>**/*.xml</exclude>
- <exclude>*.zargo</exclude>
- <exclude>**/*.zargo</exclude>
- </excludes>
- </imageResource>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>teiid_admin_guide.pdf</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <docbookVersion>1.72.0</docbookVersion>
- <localeSeparator>-</localeSeparator>
- <useRelativeImageUris>false</useRelativeImageUris>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
Copied: tags/teiid-7.1.0.Final/documentation/admin-guide/pom.xml (from rev 2474, trunk/documentation/admin-guide/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/documentation/admin-guide/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/documentation/admin-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,77 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>documentation</artifactId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>admin-guide</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
+ <packaging>jdocbook</packaging>
+ <name>Admin Guide</name>
+ <description>The Teiid Admin manual</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.2</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.docbook</groupId>
+ <artifactId>docbook</artifactId>
+ <version>1.74.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>admin_guide.xml</sourceDocumentName>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/en-US</directory>
+ <excludes>
+ <exclude>*.xml</exclude>
+ <exclude>**/*.xml</exclude>
+ <exclude>*.zargo</exclude>
+ <exclude>**/*.zargo</exclude>
+ </excludes>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>teiid_admin_guide.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <docbookVersion>1.72.0</docbookVersion>
+ <localeSeparator>-</localeSeparator>
+ <useRelativeImageUris>false</useRelativeImageUris>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Deleted: tags/teiid-7.1.0.Final/documentation/caching-guide/pom.xml
===================================================================
--- trunk/documentation/caching-guide/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/documentation/caching-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,78 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>caching-guide</artifactId>
- <groupId>org.jboss.teiid.documentation</groupId>
- <packaging>jdocbook</packaging>
- <name>Teiid Caching Guide</name>
- <description>The Teiid Caching Guide</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.1.2</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>net.sf.docbook</groupId>
- <artifactId>docbook</artifactId>
- <version>1.74.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>main.xml</sourceDocumentName>
- <imageResource>
- <directory>${basedir}/src/main/docbook/en-US</directory>
- <excludes>
- <exclude>*.xml</exclude>
- <exclude>**/*.xml</exclude>
- <exclude>*.zargo</exclude>
- <exclude>**/*.zargo</exclude>
- </excludes>
- </imageResource>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>teiid_caching_guide.pdf</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <docbookVersion>1.72.0</docbookVersion>
- <localeSeparator>-</localeSeparator>
- <useRelativeImageUris>false</useRelativeImageUris>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/documentation/caching-guide/pom.xml (from rev 2474, trunk/documentation/caching-guide/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/documentation/caching-guide/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/documentation/caching-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,77 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>documentation</artifactId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>caching-guide</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
+ <packaging>jdocbook</packaging>
+ <name>Teiid Caching Guide</name>
+ <description>The Teiid Caching Guide</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.2</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.docbook</groupId>
+ <artifactId>docbook</artifactId>
+ <version>1.74.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>main.xml</sourceDocumentName>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/en-US</directory>
+ <excludes>
+ <exclude>*.xml</exclude>
+ <exclude>**/*.xml</exclude>
+ <exclude>*.zargo</exclude>
+ <exclude>**/*.zargo</exclude>
+ </excludes>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>teiid_caching_guide.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <docbookVersion>1.72.0</docbookVersion>
+ <localeSeparator>-</localeSeparator>
+ <useRelativeImageUris>false</useRelativeImageUris>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/documentation/client-developers-guide/pom.xml
===================================================================
--- trunk/documentation/client-developers-guide/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/documentation/client-developers-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,77 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>client-developers-guide</artifactId>
- <groupId>org.jboss.teiid.documentation</groupId>
- <packaging>jdocbook</packaging>
- <name>Teiid Client Developers Guide</name>
- <description>The Client Developers Guide</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.1.2</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>net.sf.docbook</groupId>
- <artifactId>docbook</artifactId>
- <version>1.74.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>main.xml</sourceDocumentName>
- <imageResource>
- <directory>${basedir}/src/main/docbook/en-US</directory>
- <excludes>
- <exclude>*.xml</exclude>
- <exclude>**/*.xml</exclude>
- <exclude>*.zargo</exclude>
- <exclude>**/*.zargo</exclude>
- </excludes>
- </imageResource>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>teiid_client_developers_guide.pdf</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <docbookVersion>1.72.0</docbookVersion>
- <localeSeparator>-</localeSeparator>
- <useRelativeImageUris>false</useRelativeImageUris>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/documentation/client-developers-guide/pom.xml (from rev 2474, trunk/documentation/client-developers-guide/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/documentation/client-developers-guide/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/documentation/client-developers-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,77 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>documentation</artifactId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>client-developers-guide</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
+ <packaging>jdocbook</packaging>
+ <name>Teiid Client Developers Guide</name>
+ <description>The Client Developers Guide</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.2</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.docbook</groupId>
+ <artifactId>docbook</artifactId>
+ <version>1.74.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>main.xml</sourceDocumentName>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/en-US</directory>
+ <excludes>
+ <exclude>*.xml</exclude>
+ <exclude>**/*.xml</exclude>
+ <exclude>*.zargo</exclude>
+ <exclude>**/*.zargo</exclude>
+ </excludes>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>teiid_client_developers_guide.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <docbookVersion>1.72.0</docbookVersion>
+ <localeSeparator>-</localeSeparator>
+ <useRelativeImageUris>false</useRelativeImageUris>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/documentation/developer-guide/pom.xml
===================================================================
--- trunk/documentation/developer-guide/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/documentation/developer-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,77 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>developer-guide</artifactId>
- <groupId>org.jboss.teiid.documentation</groupId>
- <packaging>jdocbook</packaging>
- <name>Developer's Guide</name>
- <description>The Teiid Developer's Guide</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.1.2</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>net.sf.docbook</groupId>
- <artifactId>docbook</artifactId>
- <version>1.74.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>main.xml</sourceDocumentName>
- <imageResource>
- <directory>${basedir}/src/main/docbook/en-US</directory>
- <excludes>
- <exclude>*.xml</exclude>
- <exclude>**/*.xml</exclude>
- <exclude>*.zargo</exclude>
- <exclude>**/*.zargo</exclude>
- </excludes>
- </imageResource>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>teiid_developer_guide.pdf</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <docbookVersion>1.72.0</docbookVersion>
- <localeSeparator>-</localeSeparator>
- <useRelativeImageUris>false</useRelativeImageUris>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
Copied: tags/teiid-7.1.0.Final/documentation/developer-guide/pom.xml (from rev 2474, trunk/documentation/developer-guide/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/documentation/developer-guide/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/documentation/developer-guide/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,77 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>documentation</artifactId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>developer-guide</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
+ <packaging>jdocbook</packaging>
+ <name>Developer's Guide</name>
+ <description>The Teiid Developer's Guide</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.2</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.docbook</groupId>
+ <artifactId>docbook</artifactId>
+ <version>1.74.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>main.xml</sourceDocumentName>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/en-US</directory>
+ <excludes>
+ <exclude>*.xml</exclude>
+ <exclude>**/*.xml</exclude>
+ <exclude>*.zargo</exclude>
+ <exclude>**/*.zargo</exclude>
+ </excludes>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>teiid_developer_guide.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <docbookVersion>1.72.0</docbookVersion>
+ <localeSeparator>-</localeSeparator>
+ <useRelativeImageUris>false</useRelativeImageUris>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Deleted: tags/teiid-7.1.0.Final/documentation/pom.xml
===================================================================
--- trunk/documentation/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/documentation/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,21 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>documentation</artifactId>
- <packaging>pom</packaging>
- <name>Documents</name>
- <description>Teiid Documentation Aggregator</description>
- <modules>
- <module>admin-guide</module>
- <module>reference</module>
- <module>developer-guide</module>
- <module>quick-start-example</module>
- <module>client-developers-guide</module>
- <module>caching-guide</module>
- </modules>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/documentation/pom.xml (from rev 2474, trunk/documentation/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/documentation/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/documentation/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>documentation</artifactId>
+ <packaging>pom</packaging>
+ <name>Documents</name>
+ <description>Teiid Documentation Aggregator</description>
+ <modules>
+ <module>admin-guide</module>
+ <module>reference</module>
+ <module>developer-guide</module>
+ <module>quick-start-example</module>
+ <module>client-developers-guide</module>
+ <module>caching-guide</module>
+ </modules>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/documentation/quick-start-example/pom.xml
===================================================================
--- trunk/documentation/quick-start-example/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/documentation/quick-start-example/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,77 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>quick-start-example</artifactId>
- <groupId>org.jboss.teiid.documentation</groupId>
- <packaging>jdocbook</packaging>
- <name>Quick Start Guide</name>
- <description>The Teiid Quick Start guide</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.1.2</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>net.sf.docbook</groupId>
- <artifactId>docbook</artifactId>
- <version>1.74.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>quick_start_example.xml</sourceDocumentName>
- <imageResource>
- <directory>${basedir}/src/main/docbook/en-US</directory>
- <excludes>
- <exclude>*.xml</exclude>
- <exclude>**/*.xml</exclude>
- <exclude>*.zargo</exclude>
- <exclude>**/*.zargo</exclude>
- </excludes>
- </imageResource>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>teiid_quick_start_example.pdf</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <docbookVersion>1.72.0</docbookVersion>
- <localeSeparator>-</localeSeparator>
- <useRelativeImageUris>false</useRelativeImageUris>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
Copied: tags/teiid-7.1.0.Final/documentation/quick-start-example/pom.xml (from rev 2474, trunk/documentation/quick-start-example/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/documentation/quick-start-example/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/documentation/quick-start-example/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,77 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>documentation</artifactId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>quick-start-example</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
+ <packaging>jdocbook</packaging>
+ <name>Quick Start Guide</name>
+ <description>The Teiid Quick Start guide</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.2</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.docbook</groupId>
+ <artifactId>docbook</artifactId>
+ <version>1.74.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>quick_start_example.xml</sourceDocumentName>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/en-US</directory>
+ <excludes>
+ <exclude>*.xml</exclude>
+ <exclude>**/*.xml</exclude>
+ <exclude>*.zargo</exclude>
+ <exclude>**/*.zargo</exclude>
+ </excludes>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>teiid_quick_start_example.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <docbookVersion>1.72.0</docbookVersion>
+ <localeSeparator>-</localeSeparator>
+ <useRelativeImageUris>false</useRelativeImageUris>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Deleted: tags/teiid-7.1.0.Final/documentation/reference/pom.xml
===================================================================
--- trunk/documentation/reference/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/documentation/reference/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,77 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>reference</artifactId>
- <groupId>org.jboss.teiid.documentation</groupId>
- <packaging>jdocbook</packaging>
- <name>Teiid Reference</name>
- <description>The Teiid reference manual</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.1.2</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>net.sf.docbook</groupId>
- <artifactId>docbook</artifactId>
- <version>1.74.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>Reference.xml</sourceDocumentName>
- <imageResource>
- <directory>${basedir}/src/main/docbook/en-US</directory>
- <excludes>
- <exclude>*.xml</exclude>
- <exclude>**/*.xml</exclude>
- <exclude>*.zargo</exclude>
- <exclude>**/*.zargo</exclude>
- </excludes>
- </imageResource>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>teiid_reference.pdf</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xmlTransformerType>saxon</xmlTransformerType>
- <docbookVersion>1.72.0</docbookVersion>
- <xincludeSupported>true</xincludeSupported>
- <localeSeparator>-</localeSeparator>
- <useRelativeImageUris>false</useRelativeImageUris>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/documentation/reference/pom.xml (from rev 2474, trunk/documentation/reference/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/documentation/reference/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/documentation/reference/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,77 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>documentation</artifactId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>reference</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
+ <packaging>jdocbook</packaging>
+ <name>Teiid Reference</name>
+ <description>The Teiid reference manual</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.2</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.docbook</groupId>
+ <artifactId>docbook</artifactId>
+ <version>1.74.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>Reference.xml</sourceDocumentName>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/en-US</directory>
+ <excludes>
+ <exclude>*.xml</exclude>
+ <exclude>**/*.xml</exclude>
+ <exclude>*.zargo</exclude>
+ <exclude>**/*.zargo</exclude>
+ </excludes>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>teiid_reference.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <docbookVersion>1.72.0</docbookVersion>
+ <xincludeSupported>true</xincludeSupported>
+ <localeSeparator>-</localeSeparator>
+ <useRelativeImageUris>false</useRelativeImageUris>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/engine/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-engine</artifactId>
- <name>Engine</name>
- <description>Relational, procedural, and xml core engine.</description>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>2.4</version>
- <executions>
- <execution>
- <id>javacc</id>
- <goals>
- <goal>javacc</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <type>test-jar</type>
- </dependency>
-
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.saxon</groupId>
- <artifactId>saxon</artifactId>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.saxon</groupId>
- <classifier>dom</classifier>
- <artifactId>saxon</artifactId>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/engine/pom.xml (from rev 2474, trunk/engine/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/engine/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/engine/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-engine</artifactId>
+ <name>Engine</name>
+ <description>Relational, procedural, and xml core engine.</description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <id>javacc</id>
+ <goals>
+ <goal>javacc</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
+ <classifier>dom</classifier>
+ <artifactId>saxon</artifactId>
+ </dependency>
+
+ </dependencies>
+
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,1062 +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.query.optimizer.relational;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.teiid.api.exception.query.QueryMetadataException;
-import org.teiid.api.exception.query.QueryParserException;
-import org.teiid.api.exception.query.QueryPlannerException;
-import org.teiid.api.exception.query.QueryResolverException;
-import org.teiid.api.exception.query.QueryValidatorException;
-import org.teiid.client.plan.Annotation;
-import org.teiid.client.plan.Annotation.Priority;
-import org.teiid.core.TeiidComponentException;
-import org.teiid.core.TeiidProcessingException;
-import org.teiid.core.id.IDGenerator;
-import org.teiid.dqp.internal.process.Request;
-import org.teiid.language.SQLConstants;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.query.QueryPlugin;
-import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.execution.QueryExecPlugin;
-import org.teiid.query.mapping.relational.QueryNode;
-import org.teiid.query.metadata.QueryMetadataInterface;
-import org.teiid.query.metadata.TempMetadataAdapter;
-import org.teiid.query.metadata.TempMetadataID;
-import org.teiid.query.metadata.TempMetadataStore;
-import org.teiid.query.optimizer.QueryOptimizer;
-import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
-import org.teiid.query.optimizer.relational.plantree.NodeConstants;
-import org.teiid.query.optimizer.relational.plantree.NodeEditor;
-import org.teiid.query.optimizer.relational.plantree.NodeFactory;
-import org.teiid.query.optimizer.relational.plantree.PlanNode;
-import org.teiid.query.optimizer.relational.plantree.NodeConstants.Info;
-import org.teiid.query.optimizer.relational.rules.RuleConstants;
-import org.teiid.query.parser.QueryParser;
-import org.teiid.query.processor.ProcessorPlan;
-import org.teiid.query.processor.relational.RelationalPlan;
-import org.teiid.query.processor.relational.JoinNode.JoinStrategyType;
-import org.teiid.query.resolver.QueryResolver;
-import org.teiid.query.resolver.util.BindVariableVisitor;
-import org.teiid.query.resolver.util.ResolverUtil;
-import org.teiid.query.rewriter.QueryRewriter;
-import org.teiid.query.sql.LanguageObject;
-import org.teiid.query.sql.LanguageObject.Util;
-import org.teiid.query.sql.lang.CacheHint;
-import org.teiid.query.sql.lang.Command;
-import org.teiid.query.sql.lang.Criteria;
-import org.teiid.query.sql.lang.From;
-import org.teiid.query.sql.lang.FromClause;
-import org.teiid.query.sql.lang.GroupBy;
-import org.teiid.query.sql.lang.Insert;
-import org.teiid.query.sql.lang.JoinPredicate;
-import org.teiid.query.sql.lang.JoinType;
-import org.teiid.query.sql.lang.Limit;
-import org.teiid.query.sql.lang.Option;
-import org.teiid.query.sql.lang.OrderBy;
-import org.teiid.query.sql.lang.ProcedureContainer;
-import org.teiid.query.sql.lang.Query;
-import org.teiid.query.sql.lang.QueryCommand;
-import org.teiid.query.sql.lang.Select;
-import org.teiid.query.sql.lang.SetQuery;
-import org.teiid.query.sql.lang.StoredProcedure;
-import org.teiid.query.sql.lang.SubqueryContainer;
-import org.teiid.query.sql.lang.SubqueryFromClause;
-import org.teiid.query.sql.lang.TableFunctionReference;
-import org.teiid.query.sql.lang.UnaryFromClause;
-import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
-import org.teiid.query.sql.symbol.AllSymbol;
-import org.teiid.query.sql.symbol.GroupSymbol;
-import org.teiid.query.sql.symbol.Reference;
-import org.teiid.query.sql.symbol.SelectSymbol;
-import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.query.sql.util.SymbolMap;
-import org.teiid.query.sql.visitor.AggregateSymbolCollectorVisitor;
-import org.teiid.query.sql.visitor.CorrelatedReferenceCollectorVisitor;
-import org.teiid.query.sql.visitor.GroupCollectorVisitor;
-import org.teiid.query.sql.visitor.GroupsUsedByElementsVisitor;
-import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
-import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
-import org.teiid.query.validator.ValidationVisitor;
-
-
-/**
- * This class generates a relational plan for query execution. The output of
- * this class is a {@link org.teiid.query.optimizer.relational.plantree.PlanNode PlanNode}
- * object - this object then becomes the input to
- * {@link PlanToProcessConverter PlanToProcessConverter}
- * to produce a
- * {@link org.teiid.query.processor.relational.RelationalPlan RelationalPlan}.
- */
-public class RelationalPlanner {
-
- public static final String MAT_PREFIX = "#MAT_"; //$NON-NLS-1$
-
- private AnalysisRecord analysisRecord;
- private Command parentCommand;
- private IDGenerator idGenerator;
- private CommandContext context;
- private CapabilitiesFinder capFinder;
- private QueryMetadataInterface metadata;
- private PlanHints hints = new PlanHints();
- private Option option;
-
- public ProcessorPlan optimize(
- Command command)
- throws
- QueryPlannerException,
- QueryMetadataException,
- TeiidComponentException {
-
- boolean debug = analysisRecord.recordDebug();
- if(debug) {
- analysisRecord.println("\n----------------------------------------------------------------------------"); //$NON-NLS-1$
- analysisRecord.println("GENERATE CANONICAL: \n" + command); //$NON-NLS-1$
- }
- PlanNode plan;
- try {
- plan = generatePlan(command);
- } catch (TeiidProcessingException e) {
- throw new QueryPlannerException(e, e.getMessage());
- }
-
- if(debug) {
- analysisRecord.println("\nCANONICAL PLAN: \n" + plan); //$NON-NLS-1$
- }
-
- // Connect ProcessorPlan to SubqueryContainer (if any) of SELECT or PROJECT nodes
- connectSubqueryContainers(plan); //TODO: merge with node creation
-
- // Set top column information on top node
- List<SingleElementSymbol> topCols = Util.deepClone(command.getProjectedSymbols(), SingleElementSymbol.class);
-
- // Build rule set based on hints
- RuleStack rules = RelationalPlanner.buildRules(hints);
-
- // Run rule-based optimizer
- plan = executeRules(rules, plan);
-
- PlanToProcessConverter planToProcessConverter = null;
- if (context != null) {
- planToProcessConverter = context.getPlanToProcessConverter();
- }
- if (planToProcessConverter == null) {
- planToProcessConverter = new PlanToProcessConverter(metadata, idGenerator, analysisRecord, capFinder);
- }
-
- RelationalPlan result = planToProcessConverter.convert(plan);
-
- result.setOutputElements(topCols);
-
- return result;
- }
-
- public void initialize(Command command, IDGenerator idGenerator,
- QueryMetadataInterface metadata, CapabilitiesFinder capFinder,
- AnalysisRecord analysisRecord, CommandContext context) {
- this.parentCommand = command;
- this.idGenerator = idGenerator;
- this.metadata = metadata;
- this.capFinder = capFinder;
- this.analysisRecord = analysisRecord;
- this.context = context;
- }
-
- private void connectSubqueryContainers(PlanNode plan) throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
- Set<GroupSymbol> groupSymbols = getGroupSymbols(plan);
-
- for (PlanNode node : NodeEditor.findAllNodes(plan, NodeConstants.Types.PROJECT | NodeConstants.Types.SELECT | NodeConstants.Types.JOIN)) {
- List<SubqueryContainer> subqueryContainers = node.getSubqueryContainers();
- if (subqueryContainers.isEmpty()){
- continue;
- }
- Set<GroupSymbol> localGroupSymbols = groupSymbols;
- if (node.getType() == NodeConstants.Types.JOIN) {
- localGroupSymbols = getGroupSymbols(node);
- }
- for (SubqueryContainer container : subqueryContainers) {
- ArrayList<Reference> correlatedReferences = new ArrayList<Reference>();
- Command subCommand = container.getCommand();
- ProcessorPlan procPlan = QueryOptimizer.optimizePlan(subCommand, metadata, idGenerator, capFinder, analysisRecord, context);
- subCommand.setProcessorPlan(procPlan);
- CorrelatedReferenceCollectorVisitor.collectReferences(subCommand, localGroupSymbols, correlatedReferences);
- if (!correlatedReferences.isEmpty()) {
- SymbolMap map = new SymbolMap();
- for (Reference reference : correlatedReferences) {
- map.addMapping(reference.getExpression(), reference.getExpression());
- }
- subCommand.setCorrelatedReferences(map);
- }
- }
- node.addGroups(GroupsUsedByElementsVisitor.getGroups(node.getCorrelatedReferenceElements()));
- }
- }
-
- private static Set<GroupSymbol> getGroupSymbols(PlanNode plan) {
- Set<GroupSymbol> groupSymbols = new HashSet<GroupSymbol>();
- for (PlanNode source : NodeEditor.findAllNodes(plan, NodeConstants.Types.SOURCE)) {
- groupSymbols.addAll(source.getGroups());
- }
- return groupSymbols;
- }
-
- /**
- * Distribute and "make (not) dependent" hints specified in the query into the
- * fully resolved query plan. This is done after virtual group resolution so
- * that all groups in the plan are known. The hint is attached to all SOURCE
- * nodes for each group that should be made dependent/not dependent.
- * @param groups List of groups (Strings) to be made dependent
- * @param plan The canonical plan
- */
- private void distributeDependentHints(Collection<String> groups, PlanNode plan, NodeConstants.Info hintProperty)
- throws QueryMetadataException, TeiidComponentException {
-
- if(groups == null || groups.isEmpty()) {
- return;
- }
- // Get all source nodes
- List<PlanNode> nodes = NodeEditor.findAllNodes(plan, NodeConstants.Types.SOURCE);
-
- // Walk through each dependent group hint and
- // attach to the correct source node
- for (String groupName : groups) {
- // Walk through nodes and apply hint to all that match group name
- boolean appliedHint = applyHint(nodes, groupName, hintProperty);
-
- if(! appliedHint) {
- //check if it is partial group name
- Collection groupNames = metadata.getGroupsForPartialName(groupName);
- if(groupNames.size() == 1) {
- groupName = (String)groupNames.iterator().next();
- appliedHint = applyHint(nodes, groupName, hintProperty);
- }
-
- if(! appliedHint) {
- String msg = QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0010, groupName);
- if (this.analysisRecord.recordAnnotations()) {
- this.analysisRecord.addAnnotation(new Annotation(Annotation.HINTS, msg, "ignoring hint", Priority.MEDIUM)); //$NON-NLS-1$
- }
- }
- }
- }
- }
-
- private static boolean applyHint(List<PlanNode> nodes, String groupName, NodeConstants.Info hintProperty) {
- boolean appliedHint = false;
- for (PlanNode node : nodes) {
- GroupSymbol nodeGroup = node.getGroups().iterator().next();
-
- String sDefinition = nodeGroup.getDefinition();
-
- if (nodeGroup.getName().equalsIgnoreCase(groupName)
- || (sDefinition != null && sDefinition.equalsIgnoreCase(groupName)) ) {
- node.setProperty(hintProperty, Boolean.TRUE);
- appliedHint = true;
- }
- }
- return appliedHint;
- }
-
- public static RuleStack buildRules(PlanHints hints) {
- RuleStack rules = new RuleStack();
-
- rules.push(RuleConstants.COLLAPSE_SOURCE);
-
- rules.push(RuleConstants.PLAN_SORTS);
-
- if(hints.hasJoin) {
- rules.push(RuleConstants.IMPLEMENT_JOIN_STRATEGY);
- }
-
- rules.push(RuleConstants.ASSIGN_OUTPUT_ELEMENTS);
-
- rules.push(RuleConstants.CALCULATE_COST);
-
- if (hints.hasLimit) {
- rules.push(RuleConstants.PUSH_LIMIT);
- }
- if (hints.hasJoin || hints.hasCriteria) {
- rules.push(RuleConstants.MERGE_CRITERIA);
- }
- if (hints.hasRelationalProc) {
- rules.push(RuleConstants.PLAN_PROCEDURES);
- }
- if(hints.hasJoin) {
- rules.push(RuleConstants.CHOOSE_DEPENDENT);
- }
- if(hints.hasAggregates) {
- rules.push(RuleConstants.PUSH_AGGREGATES);
- }
- if(hints.hasJoin) {
- rules.push(RuleConstants.CHOOSE_JOIN_STRATEGY);
- rules.push(RuleConstants.RAISE_ACCESS);
- //after planning the joins, let the criteria be pushed back into place
- rules.push(RuleConstants.PUSH_SELECT_CRITERIA);
- rules.push(RuleConstants.PLAN_JOINS);
- }
- rules.push(RuleConstants.RAISE_ACCESS);
- if (hints.hasSetQuery) {
- rules.push(RuleConstants.PLAN_UNIONS);
- }
- if(hints.hasCriteria || hints.hasJoin) {
- //after copy criteria, it is no longer necessary to have phantom criteria nodes, so do some cleaning
- rules.push(RuleConstants.CLEAN_CRITERIA);
- }
- if(hints.hasJoin) {
- rules.push(RuleConstants.COPY_CRITERIA);
- rules.push(RuleConstants.PUSH_NON_JOIN_CRITERIA);
- }
- if(hints.hasVirtualGroups) {
- rules.push(RuleConstants.MERGE_VIRTUAL);
- }
- if(hints.hasCriteria) {
- rules.push(RuleConstants.PUSH_SELECT_CRITERIA);
- }
- if (hints.hasJoin && hints.hasOptionalJoin) {
- rules.push(RuleConstants.REMOVE_OPTIONAL_JOINS);
- }
- rules.push(RuleConstants.PLACE_ACCESS);
- return rules;
- }
-
- private PlanNode executeRules(RuleStack rules, PlanNode plan)
- throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
-
- boolean debug = analysisRecord.recordDebug();
- while(! rules.isEmpty()) {
- if(debug) {
- analysisRecord.println("\n============================================================================"); //$NON-NLS-1$
- }
-
- OptimizerRule rule = rules.pop();
- if(debug) {
- analysisRecord.println("EXECUTING " + rule); //$NON-NLS-1$
- }
-
- plan = rule.execute(plan, metadata, capFinder, rules, analysisRecord, context);
- if(debug) {
- analysisRecord.println("\nAFTER: \n" + plan); //$NON-NLS-1$
- }
- }
- return plan;
- }
-
- public PlanNode generatePlan(Command cmd) throws TeiidComponentException, TeiidProcessingException {
- //cascade the option clause nocache
- Option savedOption = option;
- option = cmd.getOption();
- if (option == null) {
- if (savedOption != null) {
- option = savedOption;
- }
- } else if (savedOption != null && savedOption.isNoCache()) { //merge no cache settings
- if (savedOption.getNoCacheGroups() == null || savedOption.getNoCacheGroups().isEmpty()) {
- if (option.getNoCacheGroups() != null) {
- option.getNoCacheGroups().clear(); // full no cache
- }
- } else if (option.getNoCacheGroups() != null && !option.getNoCacheGroups().isEmpty()) {
- for (String noCache : savedOption.getNoCacheGroups()) {
- option.addNoCacheGroup(noCache); // only groups
- }
- }
- option.setNoCache(true);
- }
-
- PlanNode result = null;
- switch (cmd.getType()) {
- case Command.TYPE_QUERY:
- result = createQueryPlan((QueryCommand)cmd);
- break;
- case Command.TYPE_INSERT:
- case Command.TYPE_UPDATE:
- case Command.TYPE_DELETE:
- case Command.TYPE_CREATE:
- case Command.TYPE_DROP:
- result = createUpdatePlan(cmd);
- break;
- case Command.TYPE_STORED_PROCEDURE:
- result = createStoredProcedurePlan((StoredProcedure)cmd);
- break;
- default:
- throw new AssertionError("Invalid command type"); //$NON-NLS-1$
- }
- // Distribute make dependent hints as necessary
- if (cmd.getOption() != null) {
- if(cmd.getOption().getDependentGroups() != null) {
- distributeDependentHints(cmd.getOption().getDependentGroups(), result, NodeConstants.Info.MAKE_DEP);
- }
- if (cmd.getOption().getNotDependentGroups() != null) {
- distributeDependentHints(cmd.getOption().getNotDependentGroups(), result, NodeConstants.Info.MAKE_NOT_DEP);
- }
- }
- this.option = savedOption;
- return result;
- }
-
- PlanNode createUpdatePlan(Command command) throws TeiidComponentException, TeiidProcessingException {
- // Create top project node - define output columns for stored query / procedure
- PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
-
- Collection<GroupSymbol> groups = GroupCollectorVisitor.getGroups(command, false);
- projectNode.addGroups(groups);
-
- // Set output columns
- List<SingleElementSymbol> cols = command.getProjectedSymbols();
- projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, cols);
-
- // Define source of data for stored query / procedure
- PlanNode sourceNode = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
- sourceNode.setProperty(NodeConstants.Info.ATOMIC_REQUEST, command);
- sourceNode.setProperty(NodeConstants.Info.VIRTUAL_COMMAND, command);
- if (command instanceof ProcedureContainer) {
- ProcedureContainer container = (ProcedureContainer)command;
- addNestedProcedure(sourceNode, container);
- }
- sourceNode.addGroups(groups);
-
- attachLast(projectNode, sourceNode);
-
- //for INTO query, attach source and project nodes
- if(command instanceof Insert){
- Insert insert = (Insert)command;
- if (insert.getQueryExpression() != null) {
- PlanNode plan = generatePlan(insert.getQueryExpression());
- attachLast(sourceNode, plan);
- mergeTempMetadata(insert.getQueryExpression(), insert);
- projectNode.setProperty(NodeConstants.Info.INTO_GROUP, insert.getGroup());
- }
- }
-
- return projectNode;
- }
-
- private void addNestedProcedure(PlanNode sourceNode,
- ProcedureContainer container) throws TeiidComponentException,
- QueryMetadataException, TeiidProcessingException {
- //plan any subqueries in criteria/parameters/values
- for (SubqueryContainer subqueryContainer : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(container)) {
- ProcessorPlan plan = QueryOptimizer.optimizePlan(subqueryContainer.getCommand(), metadata, null, capFinder, analysisRecord, context);
- subqueryContainer.getCommand().setProcessorPlan(plan);
- }
-
- String cacheString = "transformation/" + container.getClass().getSimpleName(); //$NON-NLS-1$
- Command c = (Command)metadata.getFromMetadataCache(container.getGroup().getMetadataID(), cacheString);
- if (c == null) {
- c = QueryResolver.expandCommand(container, metadata, analysisRecord);
- if (c != null) {
- Request.validateWithVisitor(new ValidationVisitor(), metadata, c);
- metadata.addToMetadataCache(container.getGroup().getMetadataID(), cacheString, c.clone());
- }
- } else {
- c = (Command)c.clone();
- if (c instanceof CreateUpdateProcedureCommand) {
- ((CreateUpdateProcedureCommand)c).setUserCommand(container);
- }
- }
- if (c != null) {
- c = QueryRewriter.rewrite(c, metadata, context);
- addNestedCommand(sourceNode, container.getGroup(), container, c, false);
- }
- }
-
- PlanNode createStoredProcedurePlan(StoredProcedure storedProc) throws QueryMetadataException, TeiidComponentException, TeiidProcessingException {
- // Create top project node - define output columns for stored query / procedure
- PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
-
- // Set output columns
- List cols = storedProc.getProjectedSymbols();
- projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, cols);
-
- // Define source of data for stored query / procedure
- PlanNode sourceNode = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
- sourceNode.setProperty(NodeConstants.Info.VIRTUAL_COMMAND, storedProc);
- addNestedProcedure(sourceNode, storedProc);
-
- hints.hasRelationalProc |= storedProc.isProcedureRelational();
-
- // Set group on source node
- sourceNode.addGroup(storedProc.getGroup());
-
- attachLast(projectNode, sourceNode);
-
- return projectNode;
- }
-
- PlanNode createQueryPlan(QueryCommand command)
- throws TeiidComponentException, TeiidProcessingException {
- // Build canonical plan
- PlanNode node = null;
- if(command instanceof Query) {
- node = createQueryPlan((Query) command);
- } else {
- hints.hasSetQuery = true;
- SetQuery query = (SetQuery)command;
- PlanNode leftPlan = createQueryPlan( query.getLeftQuery());
- PlanNode rightPlan = createQueryPlan( query.getRightQuery());
-
- node = NodeFactory.getNewNode(NodeConstants.Types.SET_OP);
- node.setProperty(NodeConstants.Info.SET_OPERATION, query.getOperation());
- node.setProperty(NodeConstants.Info.USE_ALL, query.isAll());
-
- attachLast(node, leftPlan);
- attachLast(node, rightPlan);
- }
-
- if(command.getOrderBy() != null) {
- node = attachSorting(node, command.getOrderBy());
- }
-
- if (command.getLimit() != null) {
- node = attachTupleLimit(node, command.getLimit(), hints);
- }
-
- return node;
- }
-
- private PlanNode createQueryPlan(Query query)
- throws QueryMetadataException, TeiidComponentException, TeiidProcessingException {
-
- PlanNode plan = null;
-
- if(query.getFrom() != null){
- FromClause fromClause = mergeClauseTrees(query.getFrom());
-
- PlanNode dummyRoot = new PlanNode();
-
- buildTree(fromClause, dummyRoot);
-
- plan = dummyRoot.getFirstChild();
-
- hints.hasJoin |= plan.getType() == NodeConstants.Types.JOIN;
-
- // Attach criteria on top
- if(query.getCriteria() != null) {
- plan = attachCriteria(plan, query.getCriteria(), false);
- hints.hasCriteria = true;
- }
-
- // Attach grouping node on top
- if(query.getGroupBy() != null || query.getHaving() != null || !AggregateSymbolCollectorVisitor.getAggregates(query.getSelect(), false).isEmpty()) {
- plan = attachGrouping(plan, query, hints);
- }
-
- // Attach having criteria node on top
- if(query.getHaving() != null) {
- plan = attachCriteria(plan, query.getHaving(), true);
- hints.hasCriteria = true;
- }
-
- }
-
- // Attach project on top
- plan = attachProject(plan, query.getSelect());
-
- // Attach dup removal on top
- if(query.getSelect().isDistinct()) {
- plan = attachDupRemoval(plan);
- }
-
- return plan;
- }
-
- /**
- * Merges the from clause into a single join predicate if there are more than 1 from clauses
- */
- private static FromClause mergeClauseTrees(From from) {
- List clauses = from.getClauses();
-
- while (clauses.size() > 1) {
- FromClause first = (FromClause)from.getClauses().remove(0);
- FromClause second = (FromClause)from.getClauses().remove(0);
- JoinPredicate jp = new JoinPredicate(first, second, JoinType.JOIN_CROSS);
- clauses.add(0, jp);
- }
-
- return (FromClause)clauses.get(0);
- }
-
- /**
- * Build a join plan based on the structure in a clause. These structures should be
- * essentially the same tree, but with different objects and details.
- * @param clause Clause to build tree from
- * @param parent Parent node to attach join node structure to
- * @param sourceMap Map of group to source node, used for connecting children to join plan
- * @param markJoinsInternal Flag saying whether joins built in this method should be marked
- * as internal
- * @throws TeiidComponentException
- * @throws QueryMetadataException
- * @throws TeiidProcessingException
- */
- void buildTree(FromClause clause, PlanNode parent)
- throws QueryMetadataException, TeiidComponentException, TeiidProcessingException {
-
- PlanNode node = null;
-
- if(clause instanceof UnaryFromClause) {
- // No join required
- UnaryFromClause ufc = (UnaryFromClause)clause;
- GroupSymbol group = ufc.getGroup();
- if (metadata.isVirtualGroup(group.getMetadataID())) {
- hints.hasVirtualGroups = true;
- }
- Command nestedCommand = ufc.getExpandedCommand();
- if (nestedCommand == null && !group.isTempGroupSymbol() && !group.isProcedure()
- && (!(group.getMetadataID() instanceof TempMetadataID) || metadata.getVirtualPlan(group.getMetadataID()) != null)
- && (metadata.isVirtualGroup(group.getMetadataID()))) {
- //must be a view layer
- nestedCommand = resolveVirtualGroup(group);
- }
- node = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
- node.addGroup(group);
- if (nestedCommand != null) {
- addNestedCommand(node, group, nestedCommand, nestedCommand, true);
- }
- parent.addLastChild(node);
- } else if(clause instanceof JoinPredicate) {
- JoinPredicate jp = (JoinPredicate) clause;
-
- // Set up new join node corresponding to this join predicate
- node = NodeFactory.getNewNode(NodeConstants.Types.JOIN);
- node.setProperty(NodeConstants.Info.JOIN_TYPE, jp.getJoinType());
- node.setProperty(NodeConstants.Info.JOIN_STRATEGY, JoinStrategyType.NESTED_LOOP);
- node.setProperty(NodeConstants.Info.JOIN_CRITERIA, jp.getJoinCriteria());
-
- if (jp.getJoinType() == JoinType.JOIN_LEFT_OUTER) {
- hints.hasOptionalJoin = true;
- }
-
- // Attach join node to parent
- parent.addLastChild(node);
-
- // Handle each child
- FromClause[] clauses = new FromClause[] {jp.getLeftClause(), jp.getRightClause()};
- for(int i=0; i<2; i++) {
- buildTree(clauses[i], node);
-
- // Add groups to joinNode
- for (PlanNode child : node.getChildren()) {
- node.addGroups(child.getGroups());
- }
- }
- } else if (clause instanceof SubqueryFromClause) {
- SubqueryFromClause sfc = (SubqueryFromClause)clause;
- GroupSymbol group = sfc.getGroupSymbol();
- Command nestedCommand = sfc.getCommand();
- node = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
- if (sfc.isTable()) {
- sfc.getCommand().setCorrelatedReferences(getCorrelatedReferences(parent, node, sfc));
- }
- node.addGroup(group);
- addNestedCommand(node, group, nestedCommand, nestedCommand, true);
- hints.hasVirtualGroups = true;
- parent.addLastChild(node);
- } else if (clause instanceof TableFunctionReference) {
- TableFunctionReference tt = (TableFunctionReference)clause;
- GroupSymbol group = tt.getGroupSymbol();
- node = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
- node.setProperty(NodeConstants.Info.TABLE_FUNCTION, tt);
- tt.setCorrelatedReferences(getCorrelatedReferences(parent, node, tt));
- node.addGroup(group);
- parent.addLastChild(node);
- }
-
- if (clause.isOptional()) {
- node.setProperty(NodeConstants.Info.IS_OPTIONAL, Boolean.TRUE);
- hints.hasOptionalJoin = true;
- }
-
- if (clause.isMakeDep()) {
- node.setProperty(NodeConstants.Info.MAKE_DEP, Boolean.TRUE);
- } else if (clause.isMakeNotDep()) {
- node.setProperty(NodeConstants.Info.MAKE_NOT_DEP, Boolean.TRUE);
- }
- }
-
- private SymbolMap getCorrelatedReferences(PlanNode parent, PlanNode node,
- LanguageObject lo) {
- PlanNode rootJoin = parent;
- while (rootJoin.getParent() != null && rootJoin.getParent().getType() == NodeConstants.Types.JOIN) {
- rootJoin = rootJoin.getParent();
- }
- List<Reference> correlatedReferences = new ArrayList<Reference>();
- CorrelatedReferenceCollectorVisitor.collectReferences(lo, rootJoin.getGroups(), correlatedReferences);
-
- if (correlatedReferences.isEmpty()) {
- return null;
- }
- SymbolMap map = new SymbolMap();
- for (Reference reference : correlatedReferences) {
- map.addMapping(reference.getExpression(), reference.getExpression());
- }
- node.setProperty(NodeConstants.Info.CORRELATED_REFERENCES, map);
- return map;
- }
-
- private void addNestedCommand(PlanNode node,
- GroupSymbol group, Command nestedCommand, Command toPlan, boolean merge) throws TeiidComponentException, QueryMetadataException, TeiidProcessingException {
- if (nestedCommand instanceof QueryCommand) {
- //remove unnecessary order by
- QueryCommand queryCommand = (QueryCommand)nestedCommand;
- if (queryCommand.getLimit() == null) {
- queryCommand.setOrderBy(null);
- }
- }
- node.setProperty(NodeConstants.Info.NESTED_COMMAND, nestedCommand);
-
- if (merge && nestedCommand instanceof Query && QueryResolver.isXMLQuery((Query)nestedCommand, metadata)) {
- merge = false;
- }
-
- if (merge) {
- mergeTempMetadata(nestedCommand, parentCommand);
- PlanNode childRoot = generatePlan(nestedCommand);
- node.addFirstChild(childRoot);
- List<SingleElementSymbol> projectCols = nestedCommand.getProjectedSymbols();
- node.setProperty(NodeConstants.Info.SYMBOL_MAP, SymbolMap.createSymbolMap(group, projectCols, metadata));
- } else {
- QueryMetadataInterface actualMetadata = metadata;
- if (actualMetadata instanceof TempMetadataAdapter) {
- actualMetadata = ((TempMetadataAdapter)metadata).getMetadata();
- }
- ProcessorPlan plan = QueryOptimizer.optimizePlan(toPlan, actualMetadata, null, capFinder, analysisRecord, context);
- node.setProperty(NodeConstants.Info.PROCESSOR_PLAN, plan);
- }
- }
-
- /**
- * Attach all criteria above the join nodes. The optimizer will push these
- * criteria down to the appropriate source.
- * @param plan Existing plan, which joins all source groups
- * @param criteria Criteria from query
- * @return Updated tree
- */
- private static PlanNode attachCriteria(PlanNode plan, Criteria criteria, boolean isHaving) {
- List<Criteria> crits = Criteria.separateCriteriaByAnd(criteria);
-
- for (Criteria crit : crits) {
- PlanNode critNode = createSelectNode(crit, isHaving);
- attachLast(critNode, plan);
- plan = critNode;
- }
-
- return plan;
- }
-
- public static PlanNode createSelectNode(final Criteria crit, boolean isHaving) {
- PlanNode critNode = NodeFactory.getNewNode(NodeConstants.Types.SELECT);
- critNode.setProperty(NodeConstants.Info.SELECT_CRITERIA, crit);
- if (isHaving && !AggregateSymbolCollectorVisitor.getAggregates(crit, false).isEmpty()) {
- critNode.setProperty(NodeConstants.Info.IS_HAVING, Boolean.TRUE);
- }
- // Add groups to crit node
- critNode.addGroups(GroupsUsedByElementsVisitor.getGroups(crit));
- critNode.addGroups(GroupsUsedByElementsVisitor.getGroups(critNode.getCorrelatedReferenceElements()));
- return critNode;
- }
-
- /**
- * Attach a grouping node at top of tree.
- * @param plan Existing plan
- * @param groupBy Group by clause, which may be null
- * @return Updated plan
- */
- private static PlanNode attachGrouping(PlanNode plan, Query query, PlanHints hints) {
- PlanNode groupNode = NodeFactory.getNewNode(NodeConstants.Types.GROUP);
-
- GroupBy groupBy = query.getGroupBy();
- if(groupBy != null) {
- groupNode.setProperty(NodeConstants.Info.GROUP_COLS, groupBy.getSymbols());
- groupNode.addGroups(GroupsUsedByElementsVisitor.getGroups(groupBy));
- }
-
- attachLast(groupNode, plan);
-
- // Mark in hints
- hints.hasAggregates = true;
-
- return groupNode;
- }
-
- /**
- * Attach SORT node at top of tree. The SORT may be pushed down to a source (or sources)
- * if possible by the optimizer.
- * @param plan Existing plan
- * @param orderBy Sort description from the query
- * @return Updated plan
- */
- private static PlanNode attachSorting(PlanNode plan, OrderBy orderBy) {
- PlanNode sortNode = NodeFactory.getNewNode(NodeConstants.Types.SORT);
-
- sortNode.setProperty(NodeConstants.Info.SORT_ORDER, orderBy);
- if (orderBy.hasUnrelated()) {
- sortNode.setProperty(Info.UNRELATED_SORT, true);
- }
- sortNode.addGroups(GroupsUsedByElementsVisitor.getGroups(orderBy));
-
- attachLast(sortNode, plan);
- return sortNode;
- }
-
- private static PlanNode attachTupleLimit(PlanNode plan, Limit limit, PlanHints hints) {
- hints.hasLimit = true;
- PlanNode limitNode = NodeFactory.getNewNode(NodeConstants.Types.TUPLE_LIMIT);
-
- boolean attach = false;
- if (limit.getOffset() != null) {
- limitNode.setProperty(NodeConstants.Info.OFFSET_TUPLE_COUNT, limit.getOffset());
- attach = true;
- }
- if (limit.getRowLimit() != null) {
- limitNode.setProperty(NodeConstants.Info.MAX_TUPLE_LIMIT, limit.getRowLimit());
- attach = true;
- }
- if (attach) {
- attachLast(limitNode, plan);
- plan = limitNode;
- }
- return plan;
- }
-
- /**
- * Attach DUP_REMOVE node at top of tree. The DUP_REMOVE may be pushed down
- * to a source (or sources) if possible by the optimizer.
- * @param plan Existing plan
- * @return Updated plan
- */
- private static PlanNode attachDupRemoval(PlanNode plan) {
- PlanNode dupNode = NodeFactory.getNewNode(NodeConstants.Types.DUP_REMOVE);
- attachLast(dupNode, plan);
- return dupNode;
- }
-
- private static PlanNode attachProject(PlanNode plan, Select select) {
- PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
- projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, select.getProjectedSymbols());
-
- // Set groups
- projectNode.addGroups(GroupsUsedByElementsVisitor.getGroups(select));
-
- attachLast(projectNode, plan);
- return projectNode;
- }
-
- static final void attachLast(PlanNode parent, PlanNode child) {
- if(child != null) {
- parent.addLastChild(child);
- }
- }
-
- /**
- * Adds temp metadata (if any) of child command to temp metadata
- * (if any) of parent command.
- * @param childCommand
- * @param parentCommand
- */
- static void mergeTempMetadata(
- Command childCommand,
- Command parentCommand) {
- Map childTempMetadata = childCommand.getTemporaryMetadata();
- if (childTempMetadata != null && !childTempMetadata.isEmpty()){
- // Add to parent temp metadata
- Map parentTempMetadata = parentCommand.getTemporaryMetadata();
- if (parentTempMetadata == null){
- parentCommand.setTemporaryMetadata(new HashMap(childTempMetadata));
- } else {
- parentTempMetadata.putAll(childTempMetadata);
- }
- }
- }
-
- private Command resolveVirtualGroup(GroupSymbol virtualGroup)
- throws QueryMetadataException, TeiidComponentException, TeiidProcessingException {
-
- QueryNode qnode = null;
-
- Object metadataID = virtualGroup.getMetadataID();
- boolean noCache = isNoCacheGroup(metadata, metadataID, option);
- boolean isMaterializedGroup = metadata.hasMaterialization(metadataID);
- String cacheString = SQLConstants.Reserved.SELECT;
- String groupName = metadata.getFullName(metadataID);
-
- if( isMaterializedGroup) {
- Object matMetadataId = metadata.getMaterialization(metadataID);
- String matTableName = null;
- CacheHint hint = null;
- boolean isImplicitGlobal = matMetadataId == null;
- if (isImplicitGlobal) {
- matTableName = MAT_PREFIX + groupName;
- matMetadataId = getGlobalTempTableMetadataId(virtualGroup, matTableName, context, metadata, analysisRecord);
- hint = ((TempMetadataID)matMetadataId).getCacheHint();
- } else {
- matTableName = metadata.getFullName(matMetadataId);
- }
-
- if(noCache){
- //not use cache
- qnode = metadata.getVirtualPlan(metadataID);
- //TODO: update the table for defaultMat
- recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.materialized_table_not_used", virtualGroup, matTableName)); //$NON-NLS-1$
- }else{
- qnode = new QueryNode(groupName, null);
- Query query = createMatViewQuery(matMetadataId, matTableName, Arrays.asList(new AllSymbol()), isImplicitGlobal);
- query.setCacheHint(hint);
- qnode.setCommand(query);
- cacheString = "matview"; //$NON-NLS-1$
- recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.Query_was_redirected_to_Mat_table", virtualGroup, matTableName)); //$NON-NLS-1$
- }
- } else {
- // Not a materialized view - query the primary transformation
- qnode = metadata.getVirtualPlan(metadataID);
- }
-
- Command result = getCommand(virtualGroup, qnode, cacheString, metadata, analysisRecord);
- return QueryRewriter.rewrite(result, metadata, context);
- }
-
- public static Query createMatViewQuery(Object matMetadataId, String matTableName, List<? extends SelectSymbol> select, boolean isGlobal) {
- Query query = new Query();
- query.setSelect(new Select(select));
- GroupSymbol gs = new GroupSymbol(matTableName);
- gs.setGlobalTable(isGlobal);
- gs.setMetadataID(matMetadataId);
- query.setFrom(new From(Arrays.asList(new UnaryFromClause(gs))));
- return query;
- }
-
- public static Object getGlobalTempTableMetadataId(GroupSymbol table, String matTableName, CommandContext context, QueryMetadataInterface metadata, AnalysisRecord analysisRecord)
- throws QueryMetadataException, TeiidComponentException, QueryResolverException, QueryValidatorException {
- TempMetadataStore store = context.getGlobalTableStore().getMetadataStore();
- TempMetadataID id = store.getTempGroupID(matTableName);
- //define the table preserving the primary key
- if (id == null) {
- synchronized (table.getMetadataID()) {
- id = store.getTempGroupID(matTableName);
- if (id == null) {
- //this is really just temporary and will be replaced by the real table
- id = store.addTempGroup(matTableName, ResolverUtil.resolveElementsInGroup(table, metadata), false, true);
- id.setQueryNode(metadata.getVirtualPlan(table.getMetadataID()));
- id.setCardinality(metadata.getCardinality(table.getMetadataID()));
-
- Object pk = metadata.getPrimaryKey(table.getMetadataID());
- //primary key
- if (pk != null) {
- List cols = metadata.getElementIDsInKey(pk);
- ArrayList<TempMetadataID> primaryKey = new ArrayList<TempMetadataID>(cols.size());
- for (Object coldId : cols) {
- int pos = metadata.getPosition(coldId) - 1;
- primaryKey.add(id.getElements().get(pos));
- }
- id.setPrimaryKey(primaryKey);
- }
- Command c = getCommand(table, metadata.getVirtualPlan(table.getMetadataID()), SQLConstants.Reserved.SELECT, metadata, analysisRecord);
- CacheHint hint = c.getCacheHint();
- if (hint != null) {
- recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.cache_hint_used", table, matTableName, hint)); //$NON-NLS-1$
- }
- id.setCacheHint(hint);
- }
- }
- } else if (id.getCacheHint() != null) {
- recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.cache_hint_used", table, matTableName, id.getCacheHint())); //$NON-NLS-1$
- }
- return id;
- }
-
- private static Command getCommand(GroupSymbol virtualGroup, QueryNode qnode,
- String cacheString, QueryMetadataInterface qmi, AnalysisRecord analysisRecord) throws TeiidComponentException,
- QueryMetadataException, QueryResolverException,
- QueryValidatorException {
- Command result = (Command)qmi.getFromMetadataCache(virtualGroup.getMetadataID(), "transformation/" + cacheString); //$NON-NLS-1$
- if (result != null) {
- result = (Command)result.clone();
- } else {
- result = qnode.getCommand();
-
- if (result == null) {
- try {
- result = QueryParser.getQueryParser().parseCommand(qnode.getQuery());
- } catch(QueryParserException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0011, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0011, qnode.getGroupName()));
- }
-
- //Handle bindings and references
- List bindings = qnode.getBindings();
- if (bindings != null){
- BindVariableVisitor.bindReferences(result, bindings, qmi);
- }
- }
- QueryResolver.resolveCommand(result, Collections.EMPTY_MAP, qmi, analysisRecord);
- Request.validateWithVisitor(new ValidationVisitor(), qmi, result);
- qmi.addToMetadataCache(virtualGroup.getMetadataID(), "transformation/" + cacheString, result.clone()); //$NON-NLS-1$
- }
- return result;
- }
-
- public static boolean isNoCacheGroup(QueryMetadataInterface metadata,
- Object metadataID,
- Option option) throws QueryMetadataException,
- TeiidComponentException {
- if(option == null || !option.isNoCache()){
- return false;
- }
- if(option.getNoCacheGroups() == null || option.getNoCacheGroups().isEmpty()){
- //only OPTION NOCACHE, no group specified
- return true;
- }
- for (String groupName : option.getNoCacheGroups()) {
- try {
- Object noCacheGroupID = metadata.getGroupID(groupName);
- if(metadataID.equals(noCacheGroupID)){
- return true;
- }
- } catch (QueryMetadataException e) {
- //log that an unknown groups was used in the no cache
- LogManager.logWarning(LogConstants.CTX_QUERY_RESOLVER, e, QueryPlugin.Util.getString("SimpleQueryResolver.unknown_group_in_nocache", groupName)); //$NON-NLS-1$
- }
- }
- return false;
- }
-
- private static void recordMaterializationTableAnnotation(AnalysisRecord analysis,
- String msg) {
- if ( analysis.recordAnnotations() ) {
- Annotation annotation = new Annotation(Annotation.MATERIALIZED_VIEW,
- msg,
- null,
- Priority.LOW);
- analysis.addAnnotation(annotation);
- }
- }
-
-}
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java (from rev 2472, trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java)
===================================================================
--- tags/teiid-7.1.0.Final/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java (rev 0)
+++ tags/teiid-7.1.0.Final/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,1062 @@
+/*
+ * 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.optimizer.relational;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.teiid.api.exception.query.QueryMetadataException;
+import org.teiid.api.exception.query.QueryParserException;
+import org.teiid.api.exception.query.QueryPlannerException;
+import org.teiid.api.exception.query.QueryResolverException;
+import org.teiid.api.exception.query.QueryValidatorException;
+import org.teiid.client.plan.Annotation;
+import org.teiid.client.plan.Annotation.Priority;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidProcessingException;
+import org.teiid.core.id.IDGenerator;
+import org.teiid.dqp.internal.process.Request;
+import org.teiid.language.SQLConstants;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.query.QueryPlugin;
+import org.teiid.query.analysis.AnalysisRecord;
+import org.teiid.query.execution.QueryExecPlugin;
+import org.teiid.query.mapping.relational.QueryNode;
+import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.metadata.TempMetadataAdapter;
+import org.teiid.query.metadata.TempMetadataID;
+import org.teiid.query.metadata.TempMetadataStore;
+import org.teiid.query.optimizer.QueryOptimizer;
+import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
+import org.teiid.query.optimizer.relational.plantree.NodeConstants;
+import org.teiid.query.optimizer.relational.plantree.NodeEditor;
+import org.teiid.query.optimizer.relational.plantree.NodeFactory;
+import org.teiid.query.optimizer.relational.plantree.PlanNode;
+import org.teiid.query.optimizer.relational.plantree.NodeConstants.Info;
+import org.teiid.query.optimizer.relational.rules.RuleConstants;
+import org.teiid.query.parser.QueryParser;
+import org.teiid.query.processor.ProcessorPlan;
+import org.teiid.query.processor.relational.RelationalPlan;
+import org.teiid.query.processor.relational.JoinNode.JoinStrategyType;
+import org.teiid.query.resolver.QueryResolver;
+import org.teiid.query.resolver.util.BindVariableVisitor;
+import org.teiid.query.resolver.util.ResolverUtil;
+import org.teiid.query.rewriter.QueryRewriter;
+import org.teiid.query.sql.LanguageObject;
+import org.teiid.query.sql.LanguageObject.Util;
+import org.teiid.query.sql.lang.CacheHint;
+import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.lang.Criteria;
+import org.teiid.query.sql.lang.From;
+import org.teiid.query.sql.lang.FromClause;
+import org.teiid.query.sql.lang.GroupBy;
+import org.teiid.query.sql.lang.Insert;
+import org.teiid.query.sql.lang.JoinPredicate;
+import org.teiid.query.sql.lang.JoinType;
+import org.teiid.query.sql.lang.Limit;
+import org.teiid.query.sql.lang.Option;
+import org.teiid.query.sql.lang.OrderBy;
+import org.teiid.query.sql.lang.ProcedureContainer;
+import org.teiid.query.sql.lang.Query;
+import org.teiid.query.sql.lang.QueryCommand;
+import org.teiid.query.sql.lang.Select;
+import org.teiid.query.sql.lang.SetQuery;
+import org.teiid.query.sql.lang.StoredProcedure;
+import org.teiid.query.sql.lang.SubqueryContainer;
+import org.teiid.query.sql.lang.SubqueryFromClause;
+import org.teiid.query.sql.lang.TableFunctionReference;
+import org.teiid.query.sql.lang.UnaryFromClause;
+import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
+import org.teiid.query.sql.symbol.AllSymbol;
+import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.Reference;
+import org.teiid.query.sql.symbol.SelectSymbol;
+import org.teiid.query.sql.symbol.SingleElementSymbol;
+import org.teiid.query.sql.util.SymbolMap;
+import org.teiid.query.sql.visitor.AggregateSymbolCollectorVisitor;
+import org.teiid.query.sql.visitor.CorrelatedReferenceCollectorVisitor;
+import org.teiid.query.sql.visitor.GroupCollectorVisitor;
+import org.teiid.query.sql.visitor.GroupsUsedByElementsVisitor;
+import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
+import org.teiid.query.util.CommandContext;
+import org.teiid.query.util.ErrorMessageKeys;
+import org.teiid.query.validator.ValidationVisitor;
+
+
+/**
+ * This class generates a relational plan for query execution. The output of
+ * this class is a {@link org.teiid.query.optimizer.relational.plantree.PlanNode PlanNode}
+ * object - this object then becomes the input to
+ * {@link PlanToProcessConverter PlanToProcessConverter}
+ * to produce a
+ * {@link org.teiid.query.processor.relational.RelationalPlan RelationalPlan}.
+ */
+public class RelationalPlanner {
+
+ public static final String MAT_PREFIX = "#MAT_"; //$NON-NLS-1$
+
+ private AnalysisRecord analysisRecord;
+ private Command parentCommand;
+ private IDGenerator idGenerator;
+ private CommandContext context;
+ private CapabilitiesFinder capFinder;
+ private QueryMetadataInterface metadata;
+ private PlanHints hints = new PlanHints();
+ private Option option;
+
+ public ProcessorPlan optimize(
+ Command command)
+ throws
+ QueryPlannerException,
+ QueryMetadataException,
+ TeiidComponentException {
+
+ boolean debug = analysisRecord.recordDebug();
+ if(debug) {
+ analysisRecord.println("\n----------------------------------------------------------------------------"); //$NON-NLS-1$
+ analysisRecord.println("GENERATE CANONICAL: \n" + command); //$NON-NLS-1$
+ }
+ PlanNode plan;
+ try {
+ plan = generatePlan(command);
+ } catch (TeiidProcessingException e) {
+ throw new QueryPlannerException(e, e.getMessage());
+ }
+
+ if(debug) {
+ analysisRecord.println("\nCANONICAL PLAN: \n" + plan); //$NON-NLS-1$
+ }
+
+ // Connect ProcessorPlan to SubqueryContainer (if any) of SELECT or PROJECT nodes
+ connectSubqueryContainers(plan); //TODO: merge with node creation
+
+ // Set top column information on top node
+ List<SingleElementSymbol> topCols = Util.deepClone(command.getProjectedSymbols(), SingleElementSymbol.class);
+
+ // Build rule set based on hints
+ RuleStack rules = RelationalPlanner.buildRules(hints);
+
+ // Run rule-based optimizer
+ plan = executeRules(rules, plan);
+
+ PlanToProcessConverter planToProcessConverter = null;
+ if (context != null) {
+ planToProcessConverter = context.getPlanToProcessConverter();
+ }
+ if (planToProcessConverter == null) {
+ planToProcessConverter = new PlanToProcessConverter(metadata, idGenerator, analysisRecord, capFinder);
+ }
+
+ RelationalPlan result = planToProcessConverter.convert(plan);
+
+ result.setOutputElements(topCols);
+
+ return result;
+ }
+
+ public void initialize(Command command, IDGenerator idGenerator,
+ QueryMetadataInterface metadata, CapabilitiesFinder capFinder,
+ AnalysisRecord analysisRecord, CommandContext context) {
+ this.parentCommand = command;
+ this.idGenerator = idGenerator;
+ this.metadata = metadata;
+ this.capFinder = capFinder;
+ this.analysisRecord = analysisRecord;
+ this.context = context;
+ }
+
+ private void connectSubqueryContainers(PlanNode plan) throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
+ Set<GroupSymbol> groupSymbols = getGroupSymbols(plan);
+
+ for (PlanNode node : NodeEditor.findAllNodes(plan, NodeConstants.Types.PROJECT | NodeConstants.Types.SELECT | NodeConstants.Types.JOIN)) {
+ List<SubqueryContainer> subqueryContainers = node.getSubqueryContainers();
+ if (subqueryContainers.isEmpty()){
+ continue;
+ }
+ Set<GroupSymbol> localGroupSymbols = groupSymbols;
+ if (node.getType() == NodeConstants.Types.JOIN) {
+ localGroupSymbols = getGroupSymbols(node);
+ }
+ for (SubqueryContainer container : subqueryContainers) {
+ ArrayList<Reference> correlatedReferences = new ArrayList<Reference>();
+ Command subCommand = container.getCommand();
+ ProcessorPlan procPlan = QueryOptimizer.optimizePlan(subCommand, metadata, idGenerator, capFinder, analysisRecord, context);
+ subCommand.setProcessorPlan(procPlan);
+ CorrelatedReferenceCollectorVisitor.collectReferences(subCommand, localGroupSymbols, correlatedReferences);
+ if (!correlatedReferences.isEmpty()) {
+ SymbolMap map = new SymbolMap();
+ for (Reference reference : correlatedReferences) {
+ map.addMapping(reference.getExpression(), reference.getExpression());
+ }
+ subCommand.setCorrelatedReferences(map);
+ }
+ }
+ node.addGroups(GroupsUsedByElementsVisitor.getGroups(node.getCorrelatedReferenceElements()));
+ }
+ }
+
+ private static Set<GroupSymbol> getGroupSymbols(PlanNode plan) {
+ Set<GroupSymbol> groupSymbols = new HashSet<GroupSymbol>();
+ for (PlanNode source : NodeEditor.findAllNodes(plan, NodeConstants.Types.SOURCE)) {
+ groupSymbols.addAll(source.getGroups());
+ }
+ return groupSymbols;
+ }
+
+ /**
+ * Distribute and "make (not) dependent" hints specified in the query into the
+ * fully resolved query plan. This is done after virtual group resolution so
+ * that all groups in the plan are known. The hint is attached to all SOURCE
+ * nodes for each group that should be made dependent/not dependent.
+ * @param groups List of groups (Strings) to be made dependent
+ * @param plan The canonical plan
+ */
+ private void distributeDependentHints(Collection<String> groups, PlanNode plan, NodeConstants.Info hintProperty)
+ throws QueryMetadataException, TeiidComponentException {
+
+ if(groups == null || groups.isEmpty()) {
+ return;
+ }
+ // Get all source nodes
+ List<PlanNode> nodes = NodeEditor.findAllNodes(plan, NodeConstants.Types.SOURCE);
+
+ // Walk through each dependent group hint and
+ // attach to the correct source node
+ for (String groupName : groups) {
+ // Walk through nodes and apply hint to all that match group name
+ boolean appliedHint = applyHint(nodes, groupName, hintProperty);
+
+ if(! appliedHint) {
+ //check if it is partial group name
+ Collection groupNames = metadata.getGroupsForPartialName(groupName);
+ if(groupNames.size() == 1) {
+ groupName = (String)groupNames.iterator().next();
+ appliedHint = applyHint(nodes, groupName, hintProperty);
+ }
+
+ if(! appliedHint) {
+ String msg = QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0010, groupName);
+ if (this.analysisRecord.recordAnnotations()) {
+ this.analysisRecord.addAnnotation(new Annotation(Annotation.HINTS, msg, "ignoring hint", Priority.MEDIUM)); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ }
+
+ private static boolean applyHint(List<PlanNode> nodes, String groupName, NodeConstants.Info hintProperty) {
+ boolean appliedHint = false;
+ for (PlanNode node : nodes) {
+ GroupSymbol nodeGroup = node.getGroups().iterator().next();
+
+ String sDefinition = nodeGroup.getDefinition();
+
+ if (nodeGroup.getName().equalsIgnoreCase(groupName)
+ || (sDefinition != null && sDefinition.equalsIgnoreCase(groupName)) ) {
+ node.setProperty(hintProperty, Boolean.TRUE);
+ appliedHint = true;
+ }
+ }
+ return appliedHint;
+ }
+
+ public static RuleStack buildRules(PlanHints hints) {
+ RuleStack rules = new RuleStack();
+
+ rules.push(RuleConstants.COLLAPSE_SOURCE);
+
+ rules.push(RuleConstants.PLAN_SORTS);
+
+ if(hints.hasJoin) {
+ rules.push(RuleConstants.IMPLEMENT_JOIN_STRATEGY);
+ }
+
+ rules.push(RuleConstants.ASSIGN_OUTPUT_ELEMENTS);
+
+ rules.push(RuleConstants.CALCULATE_COST);
+
+ if (hints.hasLimit) {
+ rules.push(RuleConstants.PUSH_LIMIT);
+ }
+ if (hints.hasJoin || hints.hasCriteria) {
+ rules.push(RuleConstants.MERGE_CRITERIA);
+ }
+ if (hints.hasRelationalProc) {
+ rules.push(RuleConstants.PLAN_PROCEDURES);
+ }
+ if(hints.hasJoin) {
+ rules.push(RuleConstants.CHOOSE_DEPENDENT);
+ }
+ if(hints.hasAggregates) {
+ rules.push(RuleConstants.PUSH_AGGREGATES);
+ }
+ if(hints.hasJoin) {
+ rules.push(RuleConstants.CHOOSE_JOIN_STRATEGY);
+ rules.push(RuleConstants.RAISE_ACCESS);
+ //after planning the joins, let the criteria be pushed back into place
+ rules.push(RuleConstants.PUSH_SELECT_CRITERIA);
+ rules.push(RuleConstants.PLAN_JOINS);
+ }
+ rules.push(RuleConstants.RAISE_ACCESS);
+ if (hints.hasSetQuery) {
+ rules.push(RuleConstants.PLAN_UNIONS);
+ }
+ if(hints.hasCriteria || hints.hasJoin) {
+ //after copy criteria, it is no longer necessary to have phantom criteria nodes, so do some cleaning
+ rules.push(RuleConstants.CLEAN_CRITERIA);
+ }
+ if(hints.hasJoin) {
+ rules.push(RuleConstants.COPY_CRITERIA);
+ rules.push(RuleConstants.PUSH_NON_JOIN_CRITERIA);
+ }
+ if(hints.hasVirtualGroups) {
+ rules.push(RuleConstants.MERGE_VIRTUAL);
+ }
+ if(hints.hasCriteria) {
+ rules.push(RuleConstants.PUSH_SELECT_CRITERIA);
+ }
+ if (hints.hasJoin && hints.hasOptionalJoin) {
+ rules.push(RuleConstants.REMOVE_OPTIONAL_JOINS);
+ }
+ rules.push(RuleConstants.PLACE_ACCESS);
+ return rules;
+ }
+
+ private PlanNode executeRules(RuleStack rules, PlanNode plan)
+ throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
+
+ boolean debug = analysisRecord.recordDebug();
+ while(! rules.isEmpty()) {
+ if(debug) {
+ analysisRecord.println("\n============================================================================"); //$NON-NLS-1$
+ }
+
+ OptimizerRule rule = rules.pop();
+ if(debug) {
+ analysisRecord.println("EXECUTING " + rule); //$NON-NLS-1$
+ }
+
+ plan = rule.execute(plan, metadata, capFinder, rules, analysisRecord, context);
+ if(debug) {
+ analysisRecord.println("\nAFTER: \n" + plan); //$NON-NLS-1$
+ }
+ }
+ return plan;
+ }
+
+ public PlanNode generatePlan(Command cmd) throws TeiidComponentException, TeiidProcessingException {
+ //cascade the option clause nocache
+ Option savedOption = option;
+ option = cmd.getOption();
+ if (option == null) {
+ if (savedOption != null) {
+ option = savedOption;
+ }
+ } else if (savedOption != null && savedOption.isNoCache()) { //merge no cache settings
+ if (savedOption.getNoCacheGroups() == null || savedOption.getNoCacheGroups().isEmpty()) {
+ if (option.getNoCacheGroups() != null) {
+ option.getNoCacheGroups().clear(); // full no cache
+ }
+ } else if (option.getNoCacheGroups() != null && !option.getNoCacheGroups().isEmpty()) {
+ for (String noCache : savedOption.getNoCacheGroups()) {
+ option.addNoCacheGroup(noCache); // only groups
+ }
+ }
+ option.setNoCache(true);
+ }
+
+ PlanNode result = null;
+ switch (cmd.getType()) {
+ case Command.TYPE_QUERY:
+ result = createQueryPlan((QueryCommand)cmd);
+ break;
+ case Command.TYPE_INSERT:
+ case Command.TYPE_UPDATE:
+ case Command.TYPE_DELETE:
+ case Command.TYPE_CREATE:
+ case Command.TYPE_DROP:
+ result = createUpdatePlan(cmd);
+ break;
+ case Command.TYPE_STORED_PROCEDURE:
+ result = createStoredProcedurePlan((StoredProcedure)cmd);
+ break;
+ default:
+ throw new AssertionError("Invalid command type"); //$NON-NLS-1$
+ }
+ // Distribute make dependent hints as necessary
+ if (cmd.getOption() != null) {
+ if(cmd.getOption().getDependentGroups() != null) {
+ distributeDependentHints(cmd.getOption().getDependentGroups(), result, NodeConstants.Info.MAKE_DEP);
+ }
+ if (cmd.getOption().getNotDependentGroups() != null) {
+ distributeDependentHints(cmd.getOption().getNotDependentGroups(), result, NodeConstants.Info.MAKE_NOT_DEP);
+ }
+ }
+ this.option = savedOption;
+ return result;
+ }
+
+ PlanNode createUpdatePlan(Command command) throws TeiidComponentException, TeiidProcessingException {
+ // Create top project node - define output columns for stored query / procedure
+ PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
+
+ Collection<GroupSymbol> groups = GroupCollectorVisitor.getGroups(command, false);
+ projectNode.addGroups(groups);
+
+ // Set output columns
+ List<SingleElementSymbol> cols = command.getProjectedSymbols();
+ projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, cols);
+
+ // Define source of data for stored query / procedure
+ PlanNode sourceNode = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
+ sourceNode.setProperty(NodeConstants.Info.ATOMIC_REQUEST, command);
+ sourceNode.setProperty(NodeConstants.Info.VIRTUAL_COMMAND, command);
+ if (command instanceof ProcedureContainer) {
+ ProcedureContainer container = (ProcedureContainer)command;
+ addNestedProcedure(sourceNode, container);
+ }
+ sourceNode.addGroups(groups);
+
+ attachLast(projectNode, sourceNode);
+
+ //for INTO query, attach source and project nodes
+ if(command instanceof Insert){
+ Insert insert = (Insert)command;
+ if (insert.getQueryExpression() != null) {
+ PlanNode plan = generatePlan(insert.getQueryExpression());
+ attachLast(sourceNode, plan);
+ mergeTempMetadata(insert.getQueryExpression(), insert);
+ projectNode.setProperty(NodeConstants.Info.INTO_GROUP, insert.getGroup());
+ }
+ }
+
+ return projectNode;
+ }
+
+ private void addNestedProcedure(PlanNode sourceNode,
+ ProcedureContainer container) throws TeiidComponentException,
+ QueryMetadataException, TeiidProcessingException {
+ //plan any subqueries in criteria/parameters/values
+ for (SubqueryContainer subqueryContainer : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(container)) {
+ ProcessorPlan plan = QueryOptimizer.optimizePlan(subqueryContainer.getCommand(), metadata, null, capFinder, analysisRecord, context);
+ subqueryContainer.getCommand().setProcessorPlan(plan);
+ }
+
+ String cacheString = "transformation/" + container.getClass().getSimpleName(); //$NON-NLS-1$
+ Command c = (Command)metadata.getFromMetadataCache(container.getGroup().getMetadataID(), cacheString);
+ if (c == null) {
+ c = QueryResolver.expandCommand(container, metadata, analysisRecord);
+ if (c != null) {
+ Request.validateWithVisitor(new ValidationVisitor(), metadata, c);
+ metadata.addToMetadataCache(container.getGroup().getMetadataID(), cacheString, c.clone());
+ }
+ } else {
+ c = (Command)c.clone();
+ if (c instanceof CreateUpdateProcedureCommand) {
+ ((CreateUpdateProcedureCommand)c).setUserCommand(container);
+ }
+ }
+ if (c != null) {
+ c = QueryRewriter.rewrite(c, metadata, context);
+ addNestedCommand(sourceNode, container.getGroup(), container, c, false);
+ }
+ }
+
+ PlanNode createStoredProcedurePlan(StoredProcedure storedProc) throws QueryMetadataException, TeiidComponentException, TeiidProcessingException {
+ // Create top project node - define output columns for stored query / procedure
+ PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
+
+ // Set output columns
+ List cols = storedProc.getProjectedSymbols();
+ projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, cols);
+
+ // Define source of data for stored query / procedure
+ PlanNode sourceNode = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
+ sourceNode.setProperty(NodeConstants.Info.VIRTUAL_COMMAND, storedProc);
+ addNestedProcedure(sourceNode, storedProc);
+
+ hints.hasRelationalProc |= storedProc.isProcedureRelational();
+
+ // Set group on source node
+ sourceNode.addGroup(storedProc.getGroup());
+
+ attachLast(projectNode, sourceNode);
+
+ return projectNode;
+ }
+
+ PlanNode createQueryPlan(QueryCommand command)
+ throws TeiidComponentException, TeiidProcessingException {
+ // Build canonical plan
+ PlanNode node = null;
+ if(command instanceof Query) {
+ node = createQueryPlan((Query) command);
+ } else {
+ hints.hasSetQuery = true;
+ SetQuery query = (SetQuery)command;
+ PlanNode leftPlan = createQueryPlan( query.getLeftQuery());
+ PlanNode rightPlan = createQueryPlan( query.getRightQuery());
+
+ node = NodeFactory.getNewNode(NodeConstants.Types.SET_OP);
+ node.setProperty(NodeConstants.Info.SET_OPERATION, query.getOperation());
+ node.setProperty(NodeConstants.Info.USE_ALL, query.isAll());
+
+ attachLast(node, leftPlan);
+ attachLast(node, rightPlan);
+ }
+
+ if(command.getOrderBy() != null) {
+ node = attachSorting(node, command.getOrderBy());
+ }
+
+ if (command.getLimit() != null) {
+ node = attachTupleLimit(node, command.getLimit(), hints);
+ }
+
+ return node;
+ }
+
+ private PlanNode createQueryPlan(Query query)
+ throws QueryMetadataException, TeiidComponentException, TeiidProcessingException {
+
+ PlanNode plan = null;
+
+ if(query.getFrom() != null){
+ FromClause fromClause = mergeClauseTrees(query.getFrom());
+
+ PlanNode dummyRoot = new PlanNode();
+
+ buildTree(fromClause, dummyRoot);
+
+ plan = dummyRoot.getFirstChild();
+
+ hints.hasJoin |= plan.getType() == NodeConstants.Types.JOIN;
+
+ // Attach criteria on top
+ if(query.getCriteria() != null) {
+ plan = attachCriteria(plan, query.getCriteria(), false);
+ hints.hasCriteria = true;
+ }
+
+ // Attach grouping node on top
+ if(query.getGroupBy() != null || query.getHaving() != null || !AggregateSymbolCollectorVisitor.getAggregates(query.getSelect(), false).isEmpty()) {
+ plan = attachGrouping(plan, query, hints);
+ }
+
+ // Attach having criteria node on top
+ if(query.getHaving() != null) {
+ plan = attachCriteria(plan, query.getHaving(), true);
+ hints.hasCriteria = true;
+ }
+
+ }
+
+ // Attach project on top
+ plan = attachProject(plan, query.getSelect());
+
+ // Attach dup removal on top
+ if(query.getSelect().isDistinct()) {
+ plan = attachDupRemoval(plan);
+ }
+
+ return plan;
+ }
+
+ /**
+ * Merges the from clause into a single join predicate if there are more than 1 from clauses
+ */
+ private static FromClause mergeClauseTrees(From from) {
+ List clauses = from.getClauses();
+
+ while (clauses.size() > 1) {
+ FromClause first = (FromClause)from.getClauses().remove(0);
+ FromClause second = (FromClause)from.getClauses().remove(0);
+ JoinPredicate jp = new JoinPredicate(first, second, JoinType.JOIN_CROSS);
+ clauses.add(0, jp);
+ }
+
+ return (FromClause)clauses.get(0);
+ }
+
+ /**
+ * Build a join plan based on the structure in a clause. These structures should be
+ * essentially the same tree, but with different objects and details.
+ * @param clause Clause to build tree from
+ * @param parent Parent node to attach join node structure to
+ * @param sourceMap Map of group to source node, used for connecting children to join plan
+ * @param markJoinsInternal Flag saying whether joins built in this method should be marked
+ * as internal
+ * @throws TeiidComponentException
+ * @throws QueryMetadataException
+ * @throws TeiidProcessingException
+ */
+ void buildTree(FromClause clause, PlanNode parent)
+ throws QueryMetadataException, TeiidComponentException, TeiidProcessingException {
+
+ PlanNode node = null;
+
+ if(clause instanceof UnaryFromClause) {
+ // No join required
+ UnaryFromClause ufc = (UnaryFromClause)clause;
+ GroupSymbol group = ufc.getGroup();
+ if (metadata.isVirtualGroup(group.getMetadataID())) {
+ hints.hasVirtualGroups = true;
+ }
+ Command nestedCommand = ufc.getExpandedCommand();
+ if (nestedCommand == null && !group.isTempGroupSymbol() && !group.isProcedure()
+ && (!(group.getMetadataID() instanceof TempMetadataID) || metadata.getVirtualPlan(group.getMetadataID()) != null)
+ && (metadata.isVirtualGroup(group.getMetadataID()))) {
+ //must be a view layer
+ nestedCommand = resolveVirtualGroup(group);
+ }
+ node = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
+ node.addGroup(group);
+ if (nestedCommand != null) {
+ addNestedCommand(node, group, nestedCommand, nestedCommand, true);
+ }
+ parent.addLastChild(node);
+ } else if(clause instanceof JoinPredicate) {
+ JoinPredicate jp = (JoinPredicate) clause;
+
+ // Set up new join node corresponding to this join predicate
+ node = NodeFactory.getNewNode(NodeConstants.Types.JOIN);
+ node.setProperty(NodeConstants.Info.JOIN_TYPE, jp.getJoinType());
+ node.setProperty(NodeConstants.Info.JOIN_STRATEGY, JoinStrategyType.NESTED_LOOP);
+ node.setProperty(NodeConstants.Info.JOIN_CRITERIA, jp.getJoinCriteria());
+
+ if (jp.getJoinType() == JoinType.JOIN_LEFT_OUTER) {
+ hints.hasOptionalJoin = true;
+ }
+
+ // Attach join node to parent
+ parent.addLastChild(node);
+
+ // Handle each child
+ FromClause[] clauses = new FromClause[] {jp.getLeftClause(), jp.getRightClause()};
+ for(int i=0; i<2; i++) {
+ buildTree(clauses[i], node);
+
+ // Add groups to joinNode
+ for (PlanNode child : node.getChildren()) {
+ node.addGroups(child.getGroups());
+ }
+ }
+ } else if (clause instanceof SubqueryFromClause) {
+ SubqueryFromClause sfc = (SubqueryFromClause)clause;
+ GroupSymbol group = sfc.getGroupSymbol();
+ Command nestedCommand = sfc.getCommand();
+ node = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
+ if (sfc.isTable()) {
+ sfc.getCommand().setCorrelatedReferences(getCorrelatedReferences(parent, node, sfc));
+ }
+ node.addGroup(group);
+ addNestedCommand(node, group, nestedCommand, nestedCommand, true);
+ hints.hasVirtualGroups = true;
+ parent.addLastChild(node);
+ } else if (clause instanceof TableFunctionReference) {
+ TableFunctionReference tt = (TableFunctionReference)clause;
+ GroupSymbol group = tt.getGroupSymbol();
+ node = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
+ node.setProperty(NodeConstants.Info.TABLE_FUNCTION, tt);
+ tt.setCorrelatedReferences(getCorrelatedReferences(parent, node, tt));
+ node.addGroup(group);
+ parent.addLastChild(node);
+ }
+
+ if (clause.isOptional()) {
+ node.setProperty(NodeConstants.Info.IS_OPTIONAL, Boolean.TRUE);
+ hints.hasOptionalJoin = true;
+ }
+
+ if (clause.isMakeDep()) {
+ node.setProperty(NodeConstants.Info.MAKE_DEP, Boolean.TRUE);
+ } else if (clause.isMakeNotDep()) {
+ node.setProperty(NodeConstants.Info.MAKE_NOT_DEP, Boolean.TRUE);
+ }
+ }
+
+ private SymbolMap getCorrelatedReferences(PlanNode parent, PlanNode node,
+ LanguageObject lo) {
+ PlanNode rootJoin = parent;
+ while (rootJoin.getParent() != null && rootJoin.getParent().getType() == NodeConstants.Types.JOIN && !rootJoin.getParent().getGroups().isEmpty()) {
+ rootJoin = rootJoin.getParent();
+ }
+ List<Reference> correlatedReferences = new ArrayList<Reference>();
+ CorrelatedReferenceCollectorVisitor.collectReferences(lo, rootJoin.getGroups(), correlatedReferences);
+
+ if (correlatedReferences.isEmpty()) {
+ return null;
+ }
+ SymbolMap map = new SymbolMap();
+ for (Reference reference : correlatedReferences) {
+ map.addMapping(reference.getExpression(), reference.getExpression());
+ }
+ node.setProperty(NodeConstants.Info.CORRELATED_REFERENCES, map);
+ return map;
+ }
+
+ private void addNestedCommand(PlanNode node,
+ GroupSymbol group, Command nestedCommand, Command toPlan, boolean merge) throws TeiidComponentException, QueryMetadataException, TeiidProcessingException {
+ if (nestedCommand instanceof QueryCommand) {
+ //remove unnecessary order by
+ QueryCommand queryCommand = (QueryCommand)nestedCommand;
+ if (queryCommand.getLimit() == null) {
+ queryCommand.setOrderBy(null);
+ }
+ }
+ node.setProperty(NodeConstants.Info.NESTED_COMMAND, nestedCommand);
+
+ if (merge && nestedCommand instanceof Query && QueryResolver.isXMLQuery((Query)nestedCommand, metadata)) {
+ merge = false;
+ }
+
+ if (merge) {
+ mergeTempMetadata(nestedCommand, parentCommand);
+ PlanNode childRoot = generatePlan(nestedCommand);
+ node.addFirstChild(childRoot);
+ List<SingleElementSymbol> projectCols = nestedCommand.getProjectedSymbols();
+ node.setProperty(NodeConstants.Info.SYMBOL_MAP, SymbolMap.createSymbolMap(group, projectCols, metadata));
+ } else {
+ QueryMetadataInterface actualMetadata = metadata;
+ if (actualMetadata instanceof TempMetadataAdapter) {
+ actualMetadata = ((TempMetadataAdapter)metadata).getMetadata();
+ }
+ ProcessorPlan plan = QueryOptimizer.optimizePlan(toPlan, actualMetadata, null, capFinder, analysisRecord, context);
+ node.setProperty(NodeConstants.Info.PROCESSOR_PLAN, plan);
+ }
+ }
+
+ /**
+ * Attach all criteria above the join nodes. The optimizer will push these
+ * criteria down to the appropriate source.
+ * @param plan Existing plan, which joins all source groups
+ * @param criteria Criteria from query
+ * @return Updated tree
+ */
+ private static PlanNode attachCriteria(PlanNode plan, Criteria criteria, boolean isHaving) {
+ List<Criteria> crits = Criteria.separateCriteriaByAnd(criteria);
+
+ for (Criteria crit : crits) {
+ PlanNode critNode = createSelectNode(crit, isHaving);
+ attachLast(critNode, plan);
+ plan = critNode;
+ }
+
+ return plan;
+ }
+
+ public static PlanNode createSelectNode(final Criteria crit, boolean isHaving) {
+ PlanNode critNode = NodeFactory.getNewNode(NodeConstants.Types.SELECT);
+ critNode.setProperty(NodeConstants.Info.SELECT_CRITERIA, crit);
+ if (isHaving && !AggregateSymbolCollectorVisitor.getAggregates(crit, false).isEmpty()) {
+ critNode.setProperty(NodeConstants.Info.IS_HAVING, Boolean.TRUE);
+ }
+ // Add groups to crit node
+ critNode.addGroups(GroupsUsedByElementsVisitor.getGroups(crit));
+ critNode.addGroups(GroupsUsedByElementsVisitor.getGroups(critNode.getCorrelatedReferenceElements()));
+ return critNode;
+ }
+
+ /**
+ * Attach a grouping node at top of tree.
+ * @param plan Existing plan
+ * @param groupBy Group by clause, which may be null
+ * @return Updated plan
+ */
+ private static PlanNode attachGrouping(PlanNode plan, Query query, PlanHints hints) {
+ PlanNode groupNode = NodeFactory.getNewNode(NodeConstants.Types.GROUP);
+
+ GroupBy groupBy = query.getGroupBy();
+ if(groupBy != null) {
+ groupNode.setProperty(NodeConstants.Info.GROUP_COLS, groupBy.getSymbols());
+ groupNode.addGroups(GroupsUsedByElementsVisitor.getGroups(groupBy));
+ }
+
+ attachLast(groupNode, plan);
+
+ // Mark in hints
+ hints.hasAggregates = true;
+
+ return groupNode;
+ }
+
+ /**
+ * Attach SORT node at top of tree. The SORT may be pushed down to a source (or sources)
+ * if possible by the optimizer.
+ * @param plan Existing plan
+ * @param orderBy Sort description from the query
+ * @return Updated plan
+ */
+ private static PlanNode attachSorting(PlanNode plan, OrderBy orderBy) {
+ PlanNode sortNode = NodeFactory.getNewNode(NodeConstants.Types.SORT);
+
+ sortNode.setProperty(NodeConstants.Info.SORT_ORDER, orderBy);
+ if (orderBy.hasUnrelated()) {
+ sortNode.setProperty(Info.UNRELATED_SORT, true);
+ }
+ sortNode.addGroups(GroupsUsedByElementsVisitor.getGroups(orderBy));
+
+ attachLast(sortNode, plan);
+ return sortNode;
+ }
+
+ private static PlanNode attachTupleLimit(PlanNode plan, Limit limit, PlanHints hints) {
+ hints.hasLimit = true;
+ PlanNode limitNode = NodeFactory.getNewNode(NodeConstants.Types.TUPLE_LIMIT);
+
+ boolean attach = false;
+ if (limit.getOffset() != null) {
+ limitNode.setProperty(NodeConstants.Info.OFFSET_TUPLE_COUNT, limit.getOffset());
+ attach = true;
+ }
+ if (limit.getRowLimit() != null) {
+ limitNode.setProperty(NodeConstants.Info.MAX_TUPLE_LIMIT, limit.getRowLimit());
+ attach = true;
+ }
+ if (attach) {
+ attachLast(limitNode, plan);
+ plan = limitNode;
+ }
+ return plan;
+ }
+
+ /**
+ * Attach DUP_REMOVE node at top of tree. The DUP_REMOVE may be pushed down
+ * to a source (or sources) if possible by the optimizer.
+ * @param plan Existing plan
+ * @return Updated plan
+ */
+ private static PlanNode attachDupRemoval(PlanNode plan) {
+ PlanNode dupNode = NodeFactory.getNewNode(NodeConstants.Types.DUP_REMOVE);
+ attachLast(dupNode, plan);
+ return dupNode;
+ }
+
+ private static PlanNode attachProject(PlanNode plan, Select select) {
+ PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
+ projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, select.getProjectedSymbols());
+
+ // Set groups
+ projectNode.addGroups(GroupsUsedByElementsVisitor.getGroups(select));
+
+ attachLast(projectNode, plan);
+ return projectNode;
+ }
+
+ static final void attachLast(PlanNode parent, PlanNode child) {
+ if(child != null) {
+ parent.addLastChild(child);
+ }
+ }
+
+ /**
+ * Adds temp metadata (if any) of child command to temp metadata
+ * (if any) of parent command.
+ * @param childCommand
+ * @param parentCommand
+ */
+ static void mergeTempMetadata(
+ Command childCommand,
+ Command parentCommand) {
+ Map childTempMetadata = childCommand.getTemporaryMetadata();
+ if (childTempMetadata != null && !childTempMetadata.isEmpty()){
+ // Add to parent temp metadata
+ Map parentTempMetadata = parentCommand.getTemporaryMetadata();
+ if (parentTempMetadata == null){
+ parentCommand.setTemporaryMetadata(new HashMap(childTempMetadata));
+ } else {
+ parentTempMetadata.putAll(childTempMetadata);
+ }
+ }
+ }
+
+ private Command resolveVirtualGroup(GroupSymbol virtualGroup)
+ throws QueryMetadataException, TeiidComponentException, TeiidProcessingException {
+
+ QueryNode qnode = null;
+
+ Object metadataID = virtualGroup.getMetadataID();
+ boolean noCache = isNoCacheGroup(metadata, metadataID, option);
+ boolean isMaterializedGroup = metadata.hasMaterialization(metadataID);
+ String cacheString = SQLConstants.Reserved.SELECT;
+ String groupName = metadata.getFullName(metadataID);
+
+ if( isMaterializedGroup) {
+ Object matMetadataId = metadata.getMaterialization(metadataID);
+ String matTableName = null;
+ CacheHint hint = null;
+ boolean isImplicitGlobal = matMetadataId == null;
+ if (isImplicitGlobal) {
+ matTableName = MAT_PREFIX + groupName;
+ matMetadataId = getGlobalTempTableMetadataId(virtualGroup, matTableName, context, metadata, analysisRecord);
+ hint = ((TempMetadataID)matMetadataId).getCacheHint();
+ } else {
+ matTableName = metadata.getFullName(matMetadataId);
+ }
+
+ if(noCache){
+ //not use cache
+ qnode = metadata.getVirtualPlan(metadataID);
+ //TODO: update the table for defaultMat
+ recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.materialized_table_not_used", virtualGroup, matTableName)); //$NON-NLS-1$
+ }else{
+ qnode = new QueryNode(groupName, null);
+ Query query = createMatViewQuery(matMetadataId, matTableName, Arrays.asList(new AllSymbol()), isImplicitGlobal);
+ query.setCacheHint(hint);
+ qnode.setCommand(query);
+ cacheString = "matview"; //$NON-NLS-1$
+ recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.Query_was_redirected_to_Mat_table", virtualGroup, matTableName)); //$NON-NLS-1$
+ }
+ } else {
+ // Not a materialized view - query the primary transformation
+ qnode = metadata.getVirtualPlan(metadataID);
+ }
+
+ Command result = getCommand(virtualGroup, qnode, cacheString, metadata, analysisRecord);
+ return QueryRewriter.rewrite(result, metadata, context);
+ }
+
+ public static Query createMatViewQuery(Object matMetadataId, String matTableName, List<? extends SelectSymbol> select, boolean isGlobal) {
+ Query query = new Query();
+ query.setSelect(new Select(select));
+ GroupSymbol gs = new GroupSymbol(matTableName);
+ gs.setGlobalTable(isGlobal);
+ gs.setMetadataID(matMetadataId);
+ query.setFrom(new From(Arrays.asList(new UnaryFromClause(gs))));
+ return query;
+ }
+
+ public static Object getGlobalTempTableMetadataId(GroupSymbol table, String matTableName, CommandContext context, QueryMetadataInterface metadata, AnalysisRecord analysisRecord)
+ throws QueryMetadataException, TeiidComponentException, QueryResolverException, QueryValidatorException {
+ TempMetadataStore store = context.getGlobalTableStore().getMetadataStore();
+ TempMetadataID id = store.getTempGroupID(matTableName);
+ //define the table preserving the primary key
+ if (id == null) {
+ synchronized (table.getMetadataID()) {
+ id = store.getTempGroupID(matTableName);
+ if (id == null) {
+ //this is really just temporary and will be replaced by the real table
+ id = store.addTempGroup(matTableName, ResolverUtil.resolveElementsInGroup(table, metadata), false, true);
+ id.setQueryNode(metadata.getVirtualPlan(table.getMetadataID()));
+ id.setCardinality(metadata.getCardinality(table.getMetadataID()));
+
+ Object pk = metadata.getPrimaryKey(table.getMetadataID());
+ //primary key
+ if (pk != null) {
+ List cols = metadata.getElementIDsInKey(pk);
+ ArrayList<TempMetadataID> primaryKey = new ArrayList<TempMetadataID>(cols.size());
+ for (Object coldId : cols) {
+ int pos = metadata.getPosition(coldId) - 1;
+ primaryKey.add(id.getElements().get(pos));
+ }
+ id.setPrimaryKey(primaryKey);
+ }
+ Command c = getCommand(table, metadata.getVirtualPlan(table.getMetadataID()), SQLConstants.Reserved.SELECT, metadata, analysisRecord);
+ CacheHint hint = c.getCacheHint();
+ if (hint != null) {
+ recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.cache_hint_used", table, matTableName, hint)); //$NON-NLS-1$
+ }
+ id.setCacheHint(hint);
+ }
+ }
+ } else if (id.getCacheHint() != null) {
+ recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.cache_hint_used", table, matTableName, id.getCacheHint())); //$NON-NLS-1$
+ }
+ return id;
+ }
+
+ private static Command getCommand(GroupSymbol virtualGroup, QueryNode qnode,
+ String cacheString, QueryMetadataInterface qmi, AnalysisRecord analysisRecord) throws TeiidComponentException,
+ QueryMetadataException, QueryResolverException,
+ QueryValidatorException {
+ Command result = (Command)qmi.getFromMetadataCache(virtualGroup.getMetadataID(), "transformation/" + cacheString); //$NON-NLS-1$
+ if (result != null) {
+ result = (Command)result.clone();
+ } else {
+ result = qnode.getCommand();
+
+ if (result == null) {
+ try {
+ result = QueryParser.getQueryParser().parseCommand(qnode.getQuery());
+ } catch(QueryParserException e) {
+ throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0011, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0011, qnode.getGroupName()));
+ }
+
+ //Handle bindings and references
+ List bindings = qnode.getBindings();
+ if (bindings != null){
+ BindVariableVisitor.bindReferences(result, bindings, qmi);
+ }
+ }
+ QueryResolver.resolveCommand(result, Collections.EMPTY_MAP, qmi, analysisRecord);
+ Request.validateWithVisitor(new ValidationVisitor(), qmi, result);
+ qmi.addToMetadataCache(virtualGroup.getMetadataID(), "transformation/" + cacheString, result.clone()); //$NON-NLS-1$
+ }
+ return result;
+ }
+
+ public static boolean isNoCacheGroup(QueryMetadataInterface metadata,
+ Object metadataID,
+ Option option) throws QueryMetadataException,
+ TeiidComponentException {
+ if(option == null || !option.isNoCache()){
+ return false;
+ }
+ if(option.getNoCacheGroups() == null || option.getNoCacheGroups().isEmpty()){
+ //only OPTION NOCACHE, no group specified
+ return true;
+ }
+ for (String groupName : option.getNoCacheGroups()) {
+ try {
+ Object noCacheGroupID = metadata.getGroupID(groupName);
+ if(metadataID.equals(noCacheGroupID)){
+ return true;
+ }
+ } catch (QueryMetadataException e) {
+ //log that an unknown groups was used in the no cache
+ LogManager.logWarning(LogConstants.CTX_QUERY_RESOLVER, e, QueryPlugin.Util.getString("SimpleQueryResolver.unknown_group_in_nocache", groupName)); //$NON-NLS-1$
+ }
+ }
+ return false;
+ }
+
+ private static void recordMaterializationTableAnnotation(AnalysisRecord analysis,
+ String msg) {
+ if ( analysis.recordAnnotations() ) {
+ Annotation annotation = new Annotation(Annotation.MATERIALIZED_VIEW,
+ msg,
+ null,
+ Priority.LOW);
+ analysis.addAnnotation(annotation);
+ }
+ }
+
+}
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,7515 +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.query.processor;
-
-import static org.junit.Assert.*;
-import static org.teiid.query.optimizer.TestOptimizer.*;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.sql.SQLException;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.junit.Test;
-import org.teiid.client.metadata.ParameterInfo;
-import org.teiid.common.buffer.BufferManager;
-import org.teiid.common.buffer.BufferManagerFactory;
-import org.teiid.common.buffer.TupleBuffer;
-import org.teiid.common.buffer.TupleSource;
-import org.teiid.common.buffer.impl.BufferManagerImpl;
-import org.teiid.core.TeiidComponentException;
-import org.teiid.core.TeiidException;
-import org.teiid.core.TeiidProcessingException;
-import org.teiid.core.TeiidRuntimeException;
-import org.teiid.core.types.DataTypeManager;
-import org.teiid.core.types.XMLType;
-import org.teiid.dqp.internal.process.SimpleQueryProcessorFactory;
-import org.teiid.query.analysis.AnalysisRecord;
-import org.teiid.query.function.FunctionLibrary;
-import org.teiid.query.function.FunctionTree;
-import org.teiid.query.function.SystemFunctionManager;
-import org.teiid.query.function.UDFSource;
-import org.teiid.query.mapping.relational.QueryNode;
-import org.teiid.query.metadata.QueryMetadataInterface;
-import org.teiid.query.metadata.TempMetadataAdapter;
-import org.teiid.query.metadata.TempMetadataStore;
-import org.teiid.query.optimizer.FakeFunctionMetadataSource;
-import org.teiid.query.optimizer.QueryOptimizer;
-import org.teiid.query.optimizer.TestOptimizer;
-import org.teiid.query.optimizer.TestRuleRaiseNull;
-import org.teiid.query.optimizer.TestOptimizer.ComparisonMode;
-import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
-import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
-import org.teiid.query.optimizer.capabilities.DefaultCapabilitiesFinder;
-import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
-import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
-import org.teiid.query.optimizer.relational.rules.RuleChooseDependent;
-import org.teiid.query.parser.QueryParser;
-import org.teiid.query.processor.relational.JoinNode;
-import org.teiid.query.processor.relational.RelationalNode;
-import org.teiid.query.processor.relational.RelationalPlan;
-import org.teiid.query.resolver.QueryResolver;
-import org.teiid.query.resolver.util.BindVariableVisitor;
-import org.teiid.query.rewriter.QueryRewriter;
-import org.teiid.query.sql.lang.Command;
-import org.teiid.query.sql.lang.SPParameter;
-import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.sql.symbol.Reference;
-import org.teiid.query.sql.util.VariableContext;
-import org.teiid.query.sql.visitor.ReferenceCollectorVisitor;
-import org.teiid.query.tempdata.TempTableDataManager;
-import org.teiid.query.tempdata.TempTableStore;
-import org.teiid.query.unittest.FakeMetadataFacade;
-import org.teiid.query.unittest.FakeMetadataFactory;
-import org.teiid.query.unittest.FakeMetadataObject;
-import org.teiid.query.unittest.FakeMetadataStore;
-import org.teiid.query.unittest.TimestampUtil;
-import org.teiid.query.util.CommandContext;
-import org.teiid.query.validator.Validator;
-import org.teiid.query.validator.ValidatorReport;
-
-@SuppressWarnings({"nls", "unchecked"})
-public class TestProcessor {
-
- // ################################## TEST HELPERS ################################
-
- static Command helpParse(String sql) {
- // parse
- try {
- return QueryParser.getQueryParser().parseCommand(sql);
- } catch(TeiidException e) {
- throw new TeiidRuntimeException(e);
- }
- }
-
- public static ProcessorPlan helpGetPlan(String sql, QueryMetadataInterface metadata) {
- return helpGetPlan(sql, metadata, null);
- }
-
- public static ProcessorPlan helpGetPlan(String sql, QueryMetadataInterface metadata, String[] bindings) {
- if(DEBUG) System.out.println("\n####################################\n" + sql); //$NON-NLS-1$
-
- Command command = helpParse(sql);
-
- // attach bindings
- if(bindings != null) {
- try {
- BindVariableVisitor.bindReferences(command, Arrays.asList(bindings), metadata);
- } catch(Throwable e) {
- throw new TeiidRuntimeException(e);
- }
- }
-
- ProcessorPlan process = helpGetPlan(command, metadata);
-
- return process;
- }
-
- static ProcessorPlan helpGetPlan(Command command, QueryMetadataInterface metadata) {
- return helpGetPlan(command, metadata, new DefaultCapabilitiesFinder());
- }
-
- static ProcessorPlan helpGetPlan(Command command, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) {
- CommandContext context = createCommandContext();
- try {
- return helpGetPlan(command, metadata, capFinder, context);
- } catch (TeiidException e) {
- throw new RuntimeException(e);
- }
- }
-
- static ProcessorPlan helpGetPlan(Command command, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, CommandContext context) throws TeiidException {
- if(DEBUG) System.out.println("\n####################################\n" + command); //$NON-NLS-1$
- AnalysisRecord analysisRecord = new AnalysisRecord(false, DEBUG);
- if (!(metadata instanceof TempMetadataAdapter)) {
- metadata = new TempMetadataAdapter(metadata, new TempMetadataStore());
- }
- context.setMetadata(metadata);
- try {
- QueryResolver.resolveCommand(command, metadata);
-
- ValidatorReport repo = Validator.validate(command, metadata);
- Collection failures = new ArrayList();
- repo.collectInvalidObjects(failures);
- if (failures.size() > 0){
- fail("Exception during validation (" + repo); //$NON-NLS-1$
- }
- command = QueryRewriter.rewrite(command, metadata, context);
- ProcessorPlan process = QueryOptimizer.optimizePlan(command, metadata, null, capFinder, analysisRecord, context);
- if(DEBUG) System.out.println("\n" + process); //$NON-NLS-1$
- //per defect 10022, clone this plan before processing, just to make sure
- //a cloned plan with correlated subquery references (or any cloned plan) can be processed
- process = process.clone();
-
- assertNotNull("Output elements of process plan are null", process.getOutputElements()); //$NON-NLS-1$
-
- return process;
- } finally {
- if(DEBUG) {
- System.out.println(analysisRecord.getDebugLog());
- }
- }
- }
-
- public static void helpProcess(ProcessorPlan plan, ProcessorDataManager dataManager, List[] expectedResults) {
- CommandContext context = createCommandContext();
- try {
- helpProcess(plan, context, dataManager, expectedResults);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public static void helpProcess(ProcessorPlan plan, CommandContext context, ProcessorDataManager dataManager, List[] expectedResults) throws Exception {
- ProcessorPlan clonePlan = plan.clone();
-
- // Process twice to test reset and clone
- doProcess(plan, dataManager, expectedResults, context);
- plan.reset();
- doProcess(plan, dataManager, expectedResults, context);
-
- // Execute cloned of original plan
- doProcess(clonePlan, dataManager, expectedResults, context);
- }
-
- private void helpProcessException(ProcessorPlan plan, ProcessorDataManager dataManager) {
- helpProcessException(plan, dataManager, null);
- }
-
- private void helpProcessException(ProcessorPlan plan, ProcessorDataManager dataManager, String expectedErrorMessage) {
- TupleBuffer tsId = null;
- BufferManager bufferMgr = null;
- try {
- bufferMgr = BufferManagerFactory.getStandaloneBufferManager();
- CommandContext context = new CommandContext("0", "test", null, null, 1); //$NON-NLS-1$ //$NON-NLS-2$
- QueryProcessor processor = new QueryProcessor(plan, context, bufferMgr, dataManager);
- processor.setNonBlocking(true);
- BatchCollector collector = processor.createBatchCollector();
- tsId = collector.collectTuples();
- fail("Expected error during processing, but got none."); //$NON-NLS-1$
- } catch(TeiidException e) {
- // ignore - this is expected
- if(expectedErrorMessage != null) {
- assertEquals(expectedErrorMessage, e.getMessage());
- }
- } finally {
- if (tsId != null) {
- tsId.remove();
- }
- }
- }
-
- public static void doProcess(ProcessorPlan plan, ProcessorDataManager dataManager, List[] expectedResults, CommandContext context) throws Exception {
- BufferManagerImpl bufferMgr = BufferManagerFactory.createBufferManager();
- bufferMgr.setProcessorBatchSize(context.getProcessorBatchSize());
- bufferMgr.setConnectorBatchSize(context.getProcessorBatchSize());
- context.getNextRand(0);
- if (context.getTempTableStore() == null) {
- context.setTempTableStore(new TempTableStore(context.getConnectionID()));
- }
- if (context.getGlobalTableStore() == null) {
- context.setGlobalTableStore(new TempTableStore("SYSTEM"));
- }
- if (!(dataManager instanceof TempTableDataManager)) {
- dataManager = new TempTableDataManager(dataManager, bufferMgr);
- }
- if (context.getQueryProcessorFactory() == null) {
- context.setQueryProcessorFactory(new SimpleQueryProcessorFactory(bufferMgr, dataManager, new DefaultCapabilitiesFinder(), null, context.getMetadata()));
- }
- TupleBuffer id = null;
- try {
- QueryProcessor processor = new QueryProcessor(plan, context, bufferMgr, dataManager);
- processor.setNonBlocking(true);
- BatchCollector collector = processor.createBatchCollector();
- id = collector.collectTuples();
- if ( expectedResults != null ) {
- examineResults(expectedResults, bufferMgr, id);
- }
- } finally {
- if (id != null) {
- id.remove();
- }
- }
- }
-
- /**
- * @param expectedResults
- * @param bufferMgr
- * @param tsID
- * @throws TeiidComponentException
- * @throws TeiidProcessingException
- * @since 4.3
- */
- static void examineResults(List[] expectedResults,BufferManager bufferMgr,TupleBuffer tsID)
- throws TeiidComponentException,SQLException, TeiidProcessingException {
-
- // Create QueryResults from TupleSource
- TupleSource ts = tsID.createIndexedTupleSource();
- int count = tsID.getRowCount();
-
- if(DEBUG) {
- System.out.println("\nResults:\n" + tsID.getSchema()); //$NON-NLS-1$
- TupleSource ts2 = tsID.createIndexedTupleSource();
- for(int j=0; j<count; j++) {
- System.out.println("" + j + ": " + ts2.nextTuple()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- ts2.closeSource();
- }
-
- // Compare actual to expected row count
- assertEquals("Did not get expected row count: ", expectedResults.length, count); //$NON-NLS-1$
-
- // Walk results and compare
- for(int i=0; i<count; i++) {
- List record = ts.nextTuple();
-
- //handle xml
- if(record.size() == 1){
- Object cellValue = record.get(0);
- if(cellValue instanceof XMLType){
- XMLType id = (XMLType)cellValue;
- String actualDoc = id.getString();
- if (expectedResults[i].size() == 1) {
- compareDocuments((String)expectedResults[i].get(0), actualDoc);
- continue;
- }
- }
- }
-
- assertEquals("Row " + i + " does not match expected: ", expectedResults[i], record); //$NON-NLS-1$ //$NON-NLS-2$
- }
- ts.closeSource();
- }
-
- public static void compareDocuments(String expectedDoc, String actualDoc) {
- StringTokenizer tokens1 = new StringTokenizer(expectedDoc, "\r\n"); //$NON-NLS-1$
- StringTokenizer tokens2 = new StringTokenizer(actualDoc, "\r\n");//$NON-NLS-1$
- while(tokens1.hasMoreTokens()){
- String token1 = tokens1.nextToken().trim();
- if(!tokens2.hasMoreTokens()){
- fail("XML doc mismatch: expected=" + token1 + "\nactual=none");//$NON-NLS-1$ //$NON-NLS-2$
- }
- String token2 = tokens2.nextToken().trim();
- assertEquals("XML doc mismatch: ", token1, token2); //$NON-NLS-1$
- }
- if(tokens2.hasMoreTokens()){
- fail("XML doc mismatch: expected=none\nactual=" + tokens2.nextToken().trim());//$NON-NLS-1$
- }
- }
-
- public static CommandContext createCommandContext() {
- Properties props = new Properties();
- props.setProperty("soap_host", "my.host.com"); //$NON-NLS-1$ //$NON-NLS-2$
- props.setProperty("soap_port", "12345"); //$NON-NLS-1$ //$NON-NLS-2$
- CommandContext context = new CommandContext("0", "test", "user", null, "myvdb", 1, props, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- context.setProcessorBatchSize(BufferManager.DEFAULT_PROCESSOR_BATCH_SIZE);
- context.setConnectorBatchSize(BufferManager.DEFAULT_CONNECTOR_BATCH_SIZE);
- context.setBufferManager(BufferManagerFactory.getStandaloneBufferManager());
- return context;
- }
-
- public static void sampleData1(FakeDataManager dataMgr) {
- try {
- FakeDataStore.sampleData1(dataMgr);
- } catch(Throwable e) {
- throw new RuntimeException(e);
- }
- }
-
- private void sampleData2(FakeDataManager dataMgr) {
- try {
- FakeDataStore.sampleData2(dataMgr);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- private void sampleData2a(FakeDataManager dataMgr) {
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- try {
- // Group pm1.g1
- FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
- List elementIDs = metadata.getElementIDsInGroupID(groupID);
- List elementSymbols = FakeDataStore.createElements(elementIDs);
-
- dataMgr.registerTuples(
- groupID,
- elementSymbols,
-
- new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- } );
-
- // Group pm2.g1
- groupID = (FakeMetadataObject) metadata.getGroupID("pm2.g1"); //$NON-NLS-1$
- elementIDs = metadata.getElementIDsInGroupID(groupID);
- elementSymbols = FakeDataStore.createElements(elementIDs);
-
- dataMgr.registerTuples(
- groupID,
- elementSymbols,
-
- new List[] {
- Arrays.asList(new Object[] { "b", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(7), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "d", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "e", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- } );
-
- // Group pm4.g1
- groupID = (FakeMetadataObject) metadata.getGroupID("pm4.g1"); //$NON-NLS-1$
- elementIDs = metadata.getElementIDsInGroupID(groupID);
- elementSymbols = FakeDataStore.createElements(elementIDs);
-
- dataMgr.registerTuples(
- groupID,
- elementSymbols,
-
- new List[] {
- Arrays.asList(new Object[] { "aa", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "bb", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "cc", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- } );
-
- } catch(TeiidException e) {
- throw new RuntimeException(e);
- }
- }
-
- public static void sampleData2b(FakeDataManager dataMgr) {
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- try {
- // Group pm1.g1
- FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
- List elementIDs = metadata.getElementIDsInGroupID(groupID);
- List elementSymbols = FakeDataStore.createElements(elementIDs);
-
- dataMgr.registerTuples(
- groupID,
- elementSymbols,
-
- new List[] {
- Arrays.asList(new Object[] { "aa ", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "bb ", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "cc ", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- } );
-
- // Group pm2.g1
- groupID = (FakeMetadataObject) metadata.getGroupID("pm2.g1"); //$NON-NLS-1$
- elementIDs = metadata.getElementIDsInGroupID(groupID);
- elementSymbols = FakeDataStore.createElements(elementIDs);
-
- dataMgr.registerTuples(
- groupID,
- elementSymbols,
-
- new List[] {
- Arrays.asList(new Object[] { "b", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "d", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "e", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- } );
-
- // Group pm4.g1
- groupID = (FakeMetadataObject) metadata.getGroupID("pm4.g1"); //$NON-NLS-1$
- elementIDs = metadata.getElementIDsInGroupID(groupID);
- elementSymbols = FakeDataStore.createElements(elementIDs);
-
- dataMgr.registerTuples(
- groupID,
- elementSymbols,
-
- new List[] {
- Arrays.asList(new Object[] { "aa ", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "bb ", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "cc ", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- } );
-
-
- } catch(TeiidException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void sampleData3(FakeDataManager dataMgr) {
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- try {
- // Group pm1.g1
- FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
- List elementSymbols = new ArrayList(1);
- ElementSymbol count = new ElementSymbol("Count"); //$NON-NLS-1$
- count.setType(Integer.class);
- elementSymbols.add(count);
-
- dataMgr.registerTuples(
- groupID,
- elementSymbols,
-
- new List[] {
- Arrays.asList(new Object[] { new Integer(1) }),
- } );
- }catch(TeiidException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void sampleDataStringTimestamps(FakeDataManager dataMgr) {
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- try {
- // Group pm1.g1
- FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
- List elementIDs = metadata.getElementIDsInGroupID(groupID);
- List elementSymbols = FakeDataStore.createElements(elementIDs);
-
- dataMgr.registerTuples(
- groupID,
- elementSymbols,
- new List[] {
- Arrays.asList(new Object[] { "Jan 01 2004 12:00:00", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "Dec 31 2004 12:00:00", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "Aug 01 2004 12:00:00", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- } );
-
-
- } catch(TeiidException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void sampleDataBQT1(FakeDataManager dataMgr) {
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- try {
- // Group bqt1.smalla
-
- List[] tuples = new List[20];
- for(int i=0; i<tuples.length; i++) {
- tuples[i] = new ArrayList(17);
- tuples[i].add(new Integer(i));
- for(int j=0; j<16; j++) {
- tuples[i].add(null);
- }
- }
-
- dataMgr.registerTuples(metadata, "bqt1.smalla", tuples); //$NON-NLS-1$
-
- // Group bqt2.mediumb
- tuples = new List[20];
- for(int i=0; i<tuples.length; i++) {
- tuples[i] = new ArrayList(17);
- tuples[i].add(new Integer(i));
- for(int j=0; j<16; j++) {
- tuples[i].add(null);
- }
- }
-
- dataMgr.registerTuples(metadata, "bqt2.mediumb", tuples); //$NON-NLS-1$
- } catch(TeiidException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void sampleDataBQT2(FakeDataManager dataMgr) {
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- String[] groups = new String[] {"bqt1.smalla", "bqt2.smalla", "bqt3.smalla" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- try {
- for(int i=0; i<groups.length; i++) {
- String groupName = groups[i];
-
- List[] tuples = new List[30];
- for(int row=0; row<tuples.length; row++) {
- tuples[row] = new ArrayList(17);
- tuples[row].add(new Integer(row));
- for(int col=0; col<16; col++) {
- tuples[row].add(null);
- }
- }
-
- dataMgr.registerTuples(metadata, groupName, tuples);
- }
-
- } catch(TeiidException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Just want to register two rows of all the integral types to test AVG
- * @param dataMgr
- * @since 4.2
- */
- private void sampleDataBQT_defect11682(FakeDataManager dataMgr) {
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- try {
- List[] tuples = new List[2];
- for(int i=1; i<=tuples.length; i++) {
- int index=i-1;
- tuples[index] = new ArrayList(17);
- tuples[index].add(new Integer(i)); //IntKey
- tuples[index].add(null);
- tuples[index].add(new Integer(i));
- tuples[index].add(null);
- tuples[index].add(new Float(i));
- tuples[index].add(new Long(i));
- tuples[index].add(new Double(i));
- tuples[index].add(new Byte((byte)i));
- tuples[index].add(null);
- tuples[index].add(null);
- tuples[index].add(null);
- tuples[index].add(null);
- tuples[index].add(null);
- tuples[index].add(new Short((short)i));
- tuples[index].add(new BigInteger(i+"")); //$NON-NLS-1$
- tuples[index].add(new BigDecimal(i+".0")); //$NON-NLS-1$
- tuples[index].add(null);
- }
-
- dataMgr.registerTuples(metadata, "bqt1.smalla", tuples); //$NON-NLS-1$
-
- } catch(TeiidException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void sampleDataBQTSmall(FakeDataManager dataMgr) {
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- try {
- List[] tuples = new List[1];
- for(int i=0; i<tuples.length; i++) {
- tuples[i] = new ArrayList(17);
- tuples[i].add(new Integer(i));
- for(int j=0; j<16; j++) {
- tuples[i].add(null);
- }
- }
-
- dataMgr.registerTuples(metadata, "bqt1.smalla", tuples); //$NON-NLS-1$
-
- } catch(TeiidException e) {
- throw new RuntimeException(e);
- }
- }
-
- private List createRowWithTimestamp(String tsStr) {
- Timestamp ts = Timestamp.valueOf(tsStr);
- return Arrays.asList(new Object[] {
- new Integer(0), "a", new Integer(1), "a", //$NON-NLS-1$ //$NON-NLS-2$
- null, null, null, null, null, null, ts, null, null, null, null, null, null
- });
- }
-
- private void sampleDataBQT_case1566(FakeDataManager dataMgr) throws Exception {
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- dataMgr.registerTuples(metadata, "bqt1.smalla", new List[] { //$NON-NLS-1$
- createRowWithTimestamp("2002-01-01 10:00:00"), //$NON-NLS-1$
- createRowWithTimestamp("2002-01-01 14:00:00"), //$NON-NLS-1$
- createRowWithTimestamp("2002-01-02 10:00:00"), //$NON-NLS-1$
- createRowWithTimestamp("2002-01-02 14:00:00"), //$NON-NLS-1$
- createRowWithTimestamp("2002-01-02 19:00:00.01"), //$NON-NLS-1$
- } );
- }
-
- static List getProcResultSetSymbols(List params){
- List result = new ArrayList();
- Iterator iter = params.iterator();
- while(iter.hasNext()){
- SPParameter param = (SPParameter)iter.next();
- if(param.getResultSetColumns() != null){
- result.addAll(param.getResultSetColumns());
- }
- }
- iter = params.iterator();
- while(iter.hasNext()){
- SPParameter param = (SPParameter)iter.next();
- if(param.getParameterType() == ParameterInfo.INOUT || param.getParameterType() == ParameterInfo.RETURN_VALUE) {
- result.add(param.getParameterSymbol());
- }
- }
- return result;
- }
-
- @Test public void test1() {
- // Create query
- String sql = "SELECT pm1.g1.e1, e2, pm1.g1.e3 as a, e4 as b FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void test2() {
- // Create query
- String sql = "SELECT COUNT(*) FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(6) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void test3() {
- // Create query
- String sql = "SELECT COUNT(*), COUNT(e1), COUNT(distinct e1), COUNT(distinct e2), COUNT(distinct e3), COUNT(distinct e4) FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(6), new Integer(5), new Integer(3), new Integer(4), new Integer(2), new Integer(4) }),
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** see also integer average defect 11682 */
- @Test public void test4() {
- // Create query
- String sql = "SELECT MIN(e2), MAX(e2), SUM(e2), AVG(e2), SUM(distinct e2), AVG(distinct e2) FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0), new Integer(3), new Long(7), new Double(1.1666666666666667), new Long(6), new Double(1.5) }),
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void test5() {
- // Create query
- String sql = "SELECT MIN(e4), MAX(e4), SUM(e4), AVG(e4), SUM(distinct e4), AVG(distinct e4) FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Double(0.0), new Double(7.0), new Double(12.0), new Double(2.4), new Double(10.0), new Double(2.5) }),
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void test7() {
- // Create query
- String sql = "SELECT * FROM vm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void test8() {
- // Create query
- String sql = "SELECT * FROM vm1.g2 order by 1, 2, 3"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void test9() {
- // Create query
- String sql = "SELECT * FROM vm1.g4 order by e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "2" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "3" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void test10() {
- // Create query
- String sql = "SELECT e1 FROM vm1.g4 where e1 = 'a'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testBooleanComparisonGT() {
- // Create query
- String sql = "SELECT pm1.g1.e3 FROM pm1.g1 WHERE e3 > {b'false'}"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { Boolean.TRUE }),
- Arrays.asList(new Object[] { Boolean.TRUE })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testBooleanComparisonGE() {
- // Create query
- String sql = "SELECT pm1.g1.e3 FROM pm1.g1 WHERE e3 >= {b'false'}"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { Boolean.FALSE }),
- Arrays.asList(new Object[] { Boolean.FALSE }),
- Arrays.asList(new Object[] { Boolean.TRUE }),
- Arrays.asList(new Object[] { Boolean.TRUE }),
- Arrays.asList(new Object[] { Boolean.FALSE }),
- Arrays.asList(new Object[] { Boolean.FALSE })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testBooleanComparisonLT() {
- // Create query
- String sql = "SELECT pm1.g1.e3 FROM pm1.g1 WHERE e3 < {b'true'}"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { Boolean.FALSE }),
- Arrays.asList(new Object[] { Boolean.FALSE }),
- Arrays.asList(new Object[] { Boolean.FALSE }),
- Arrays.asList(new Object[] { Boolean.FALSE })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testBooleanComparisonLE() {
- // Create query
- String sql = "SELECT pm1.g1.e3 FROM pm1.g1 WHERE e3 <= {b'true'}"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { Boolean.FALSE }),
- Arrays.asList(new Object[] { Boolean.FALSE }),
- Arrays.asList(new Object[] { Boolean.TRUE }),
- Arrays.asList(new Object[] { Boolean.TRUE }),
- Arrays.asList(new Object[] { Boolean.FALSE }),
- Arrays.asList(new Object[] { Boolean.FALSE })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testConcatOperator() {
- // Create query
- String sql = "SELECT pm1.g1.e1 || e2 AS x FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "a3" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c1" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b2" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a0" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** Duplicates defect #4841: SELECT e1 a, e1 b FROM pm1.g1 order by a */
- @Test public void testDefect4841_1() {
- // Create query
- String sql = "SELECT e1 a, e1 b FROM pm1.g1 order by a"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** Duplicates defect #4841: SELECT e1 a, e1 b FROM pm1.g1 order by a, b desc */
- @Test public void testDefect4841_2() {
- // Create query
- String sql = "SELECT e1 a, e1 b FROM pm1.g1 order by a"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** Duplicates defect #5292: SELECT DISTINCT e1, e1 a FROM pm1.g1 */
- @Test public void testDefect5292_1() {
- // Create query
- String sql = "SELECT DISTINCT e1, e1 a FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** Duplicates defect #5292: SELECT DISTINCT e1, e1 a FROM pm1.g1 ORDER BY a */
- @Test public void testDefect5292_2() {
- // Create query
- String sql = "SELECT DISTINCT e1, e1 a FROM pm1.g1 ORDER BY a"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** Duplicates defect #5004: SELECT COUNT(*) FROM pm1.g1 WHERE e1='xxxx' */
- @Test public void testDefect5004() {
- // Create query
- String sql = "SELECT COUNT(*) FROM pm1.g1 WHERE e1='xxxx'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Test to ensure that multiple empty batches are handled by the grouping node as well
- */
- @Test public void testDefect5004a() throws Exception {
- // Create query
- String sql = "SELECT COUNT(*) FROM pm1.g1 WHERE e1='xxxx'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- CommandContext context = createCommandContext();
- context.setProcessorBatchSize(2);
- context.setConnectorBatchSize(2);
- context.setMetadata(FakeMetadataFactory.example1Cached());
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached(), new DefaultCapabilitiesFinder(), context);
-
- // Run query
- helpProcess(plan, context, dataManager, expected);
- }
-
- /** SELECT COUNT(e2), MIN(e2), MAX(e2), SUM(e2), AVG(e2) FROM pm1.g1 WHERE e2=-999999 */
- @Test public void test13() {
- // Create query
- String sql = "SELECT COUNT(e2), MIN(e2), MAX(e2), SUM(e2), AVG(e2) FROM pm1.g1 WHERE e2=-999999"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] {new Integer(0), null, null, null, null})
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * This test uncovered a bug in the FakeDataManager; the element
- * symbol in the atomic query criteria has a canonical name
- * of "Y.e4", but the FakeDataManager sends a Map of ElementSymbols
- * having the unaliased names. The first symbol cannot be found
- * in the Map due to the implementation of Symbol.equals() being
- * based entirely on the canonical name, which causes a NPE.
- * (Alex says this wasn't previously a problem because aliased groups
- * did not previously get pushed down to the source.)
- */
- @Test public void testCriteriaAliasedGroup() {
- String sql = "select e1, e2 FROM pm2.g1 Y WHERE 2.0 = e4"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b", new Integer(0) }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT e1 FROM pm1.g1 WHERE 'abc' = 'xyz' */
- @Test public void testCriteriaComparesUnequalConstants() {
- // Create query
- String sql = "SELECT e1 FROM pm1.g1 WHERE 'abc' = 'xyz'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 RIGHT OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1 */
- @Test public void testRightOuterJoin1() {
- // Create query
- String sql = "SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 RIGHT OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { null, "d" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, "e" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 LEFT OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1 */
- @Test public void testLeftOuterJoin1() {
- // Create query
- String sql = "SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 LEFT OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 FULL OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1 */
- @Test public void testFullOuterJoin1() throws Exception {
- // Create query
- String sql = "SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 FULL OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, "d" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, "e" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testFullOuterJoin2() throws Exception {
- // Create query
- String sql = "SELECT a.e4 c0, b.e4 c1 FROM pm1.g1 a FULL OUTER JOIN pm1.g1 b ON a.e4=b.e4 order by c0"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { new Double(0), new Double(0) }),
- Arrays.asList(new Object[] { new Double(2), new Double(2) }),
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSortedFullOuterJoin() throws Exception {
- // Create query
- String sql = "SELECT pm1.g1.e2, pm2.g1.e2 FROM pm1.g1 FULL OUTER JOIN pm2.g1 ON pm1.g1.e2=pm2.g1.e2 and pm1.g1.e2 > 3"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, 2 }), //$NON-NLS-1$
- Arrays.asList(new Object[] { 3, null }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { null, 3 }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, 4 }), //$NON-NLS-1$
- };
-
- HardcodedDataManager hdm = new HardcodedDataManager();
- hdm.addData("SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0 ORDER BY c_0", new List[] {
- Arrays.asList(3),
- });
- hdm.addData("SELECT g_0.e2 AS c_0 FROM pm2.g1 AS g_0 ORDER BY c_0", new List[] {
- Arrays.asList(2),
- Arrays.asList(3),
- Arrays.asList(4),
-
- });
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder());
- CommandContext cc = createCommandContext();
- cc.setProcessorBatchSize(2);
- helpProcess(plan, cc, hdm, expected);
- }
-
- @Test public void testFullOuterJoin3() throws Exception {
- // Create query
- String sql = "SELECT a.e4 c0, b.e4 c1 FROM pm1.g1 b FULL OUTER JOIN (select e4, 1 x from pm1.g1 union all select e4, 2 from pm1.g1) a ON a.e4=b.e4 and a.x = 2 order by c0"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { new Double(0), new Double(0) }),
- Arrays.asList(new Object[] { new Double(0), null }),
- Arrays.asList(new Object[] { new Double(2), new Double(2) }),
- Arrays.asList(new Object[] { new Double(2), null }),
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT x.e1, pm2.g1.e1 FROM (SELECT e1 FROM pm1.g1) AS x LEFT OUTER JOIN pm2.g1 ON x.e1=pm2.g1.e1 */
- @Test public void testLeftOuterJoinWithInlineView() {
- // Create query
- String sql = "SELECT x.e1, pm2.g1.e1 FROM (SELECT e1 FROM pm1.g1) AS x LEFT OUTER JOIN pm2.g1 ON x.e1=pm2.g1.e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT * FROM vm1.g5 ORDER BY expr */
- @Test public void testDefect5273_1() {
- // Create query
- String sql = "SELECT expr FROM vm1.g5 ORDER BY expr"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "bval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "cval" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT expr AS e FROM vm1.g5 ORDER BY e */
- @Test public void testDefect5273_2() {
- // Create query
- String sql = "SELECT expr AS e FROM vm1.g5 ORDER BY e"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "bval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "cval" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT e2 AS e FROM vm1.g5 ORDER BY e */
- @Test public void testDefect5273_3() {
- // Create query
- String sql = "SELECT e2 AS e FROM vm1.g5 ORDER BY e"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(3) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT e AS f FROM vm1.g6 ORDER BY f */
- @Test public void testDefect5273_4() {
- // Create query
- String sql = "SELECT e AS f FROM vm1.g6 ORDER BY f"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "bval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "cval" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT e AS f FROM vm1.g7 ORDER BY f */
- @Test public void testDefect5273_5() {
- // Create query
- String sql = "SELECT e AS f FROM vm1.g7 ORDER BY f"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "a0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a3" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b2" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c1" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT e AS f FROM vm1.g7 ORDER BY f */
- @Test public void testDefect5273_6() {
- // Create query
- String sql = "SELECT e AS f FROM vm1.g8 ORDER BY f"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "bval" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "cval" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testFalseCriteria1() {
- // Create query
- String sql = "SELECT 5 FROM pm1.g1 WHERE 0=1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testFalseCriteria2() {
- // Create query
- String sql = "SELECT count(*) FROM pm1.g1 WHERE 0=1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) }),
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testTempGroup() {
- // Create query
- String sql = "SELECT e1 FROM tm1.g1 WHERE e1 = 'a'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSubquery1() {
- // Create query
- String sql = "SELECT e1 FROM (SELECT e1 FROM pm1.g1) AS x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSubquerySimple() {
- // Create query
- String sql = "SELECT e1 FROM (SELECT e1 FROM pm1.g1) AS x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCritInSubquery() {
- // Create query
- String sql = "SELECT e1 FROM (SELECT e1 FROM pm1.g1 WHERE e1 = 'a') AS x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCritAboveSubquery() {
- // Create query
- String sql = "SELECT e1 FROM (SELECT e1 FROM pm1.g1) AS x WHERE e1 = 'a'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSubqueryInJoinPredicate() {
- // Create query
- String sql = "SELECT x.e1 FROM (SELECT e1 FROM pm1.g1) AS x JOIN (SELECT e1 FROM pm1.g1) y ON x.e1=y.e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSubqueryWithRenaming() {
- // Create query
- String sql = "SELECT x.a FROM (SELECT e1 AS a FROM pm1.g1) AS x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testNestedSubquery() {
- // Create query
- String sql = "SELECT x.a FROM (SELECT e1 AS a FROM (SELECT e1 FROM pm1.g1) AS y) AS x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null }),
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery IN clause criteria
- */
- @Test public void testSubqueryINClause() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery IN clause criteria with nulls
- * in sample data
- */
- @Test public void testSubqueryINClauseWithNulls() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e4 IN (SELECT e4 FROM pm2.g1)"; //$NON-NLS-1$
-
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery IN clause criteria with nulls
- * in sample data
- */
- @Test public void testSubqueryINClauseWithNulls2() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e4 FROM pm2.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a compound criteria of two subqueries in IN clauses
- */
- @Test public void testSubqueryINClauses() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1) AND e1 IN (SELECT e1 FROM pm2.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a compound criteria of a subquery in IN clause and another type of
- * criteria
- */
- @Test public void testSubqueryINClauseMixedCriteria() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1) AND e1 IN ('b')"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a compound criteria of a subquery in IN clause and another type of
- * criteria
- */
- @Test public void testSubqueryINClauseMixedCriteria2() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1) AND NOT (e1 = 'a')"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests nesting of Subquery IN clause criteria
- */
- @Test public void testNestedSubqueryINClauses() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1 WHERE e1 IN (SELECT e1 FROM pm1.g1))"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSubqueryXML() {
- // Create query
- String sql = "SELECT * FROM (SELECT * FROM xmltest.doc1) AS x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] {
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + //$NON-NLS-1$
- "<root><node1><node2><node3/></node2></node1></root>" //$NON-NLS-1$
- })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery EXISTS predicate criteria
- */
- @Test public void testSubqueryExistsPredicate() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE EXISTS (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery EXISTS predicate criteria
- * where the subquery returns no rows
- */
- @Test public void testSubqueryExistsPredicate2() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE EXISTS (SELECT e2 FROM pm2.g1 WHERE e1 = 'ZZTop')"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[0];
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery in compare predicate criteria
- */
- @Test public void testSubqueryComparePredicate() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 = ANY (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery in compare predicate criteria
- */
- @Test public void testSubqueryComparePredicate2() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 = SOME (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery in compare predicate criteria
- */
- @Test public void testSubqueryComparePredicate3() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 = ALL (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[0];
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery in compare predicate criteria
- */
- @Test public void testSubqueryComparePredicate4() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 <= ALL (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery in compare predicate criteria
- */
- @Test public void testSubqueryComparePredicate5() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 < SOME (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery in compare predicate criteria
- */
- @Test public void testSubqueryComparePredicate5a() {
- String sql = "SELECT e1 FROM pm2.g1 WHERE e2 < SOME (SELECT e2 FROM pm1.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "e" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery in compare predicate criteria
- * without predicate quantifier
- */
- @Test public void testSubqueryComparePredicate6() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 < (SELECT e2 FROM pm2.g1 WHERE e1 = 'e')"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a single Subquery in compare predicate criteria
- */
- @Test public void testSubqueryComparePredicateNested() {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 < SOME (SELECT e2 FROM pm2.g1 WHERE EXISTS (SELECT e2 FROM pm2.g1))"; //$NON-NLS-1$
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- // Construct data manager with data
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData("SELECT pm1.g1.e2, pm1.g1.e1 FROM pm1.g1", new List[] { Arrays.asList(new Object[] { new Integer(0), "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { new Integer(1), "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(2), "c" }), //$NON-NLS-1$
- });
-
- dataManager.addData("SELECT pm2.g1.e2 FROM pm2.g1", new List[] { //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(3) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- });
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
- };
-
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a scalar subquery in the SELECT clause
- */
- @Test public void testSubqueryScalar() {
- String sql = "SELECT e1, (SELECT e2 FROM pm2.g1 WHERE e1 = 'b') FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a scalar subquery which returns no rows in the SELECT clause
- */
- @Test public void testSubqueryScalar2() {
- String sql = "SELECT e1, (SELECT e2 FROM pm2.g1 WHERE e1 = 'a') FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Tests a scalar subquery which returns more than one rows
- * causes the expected Exception
- */
- @Test public void testSubqueryScalarException() throws Exception {
- String sql = "SELECT e1, (SELECT e2 FROM pm2.g1) FROM pm1.g1"; //$NON-NLS-1$
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcessException(plan, dataManager);
- }
-
- @Test public void testSubqueryScalarInTransformation() {
- String sql = "select * from vm1.g25"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), new Double(0.0) }),
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), new Double(0.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSubqueryScalarInTransformation2() {
- String sql = "select * from vm1.g25 where e5 = 0.0"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), new Double(0.0) }),
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), new Double(0.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery_CASE2022() {
- String sql = "select * from BQT2_V WHERE BQT2_V.IntKey < 50"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[0];
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT1(dataManager);
- sampleDataBQT2(dataManager);
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
- caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, true);
- caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
- caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MIN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
- // Plan query
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.exampleBQTCached(), capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
- @Test public void testCorrelatedSubquery1() {
- String sql = "Select e1, e2, e4 from pm1.g1 where e2 in (select e2 FROM pm2.g1 WHERE pm1.g1.e4 = pm2.g1.e4)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0), new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- /**
- * There is a bug when the second query in a UNION ALL has a correlated subquery, and both
- * the outer and inner query are selecting from the same virtual group, and aliasing them
- * differently to distinguish between them. The generated atomic query has screwed up
- * aliasing.
- */
- @Test public void testCorrelatedSubqueryCase3667() {
-
- HardcodedDataManager dataManager = new HardcodedDataManager();
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
- caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
- caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
- caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
-
- // Plan query
- String sql = "Select e1, e2, e4 from pm2.g1 where 1=2 " + //$NON-NLS-1$
- "UNION ALL Select e1, e2, e4 from vm1.g1 outg1 where outg1.e2 in (select ing1.e2 FROM vm1.g1 ing1 WHERE outg1.e4 = ing1.e4)";//$NON-NLS-1$
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.example1Cached(), capFinder);
-
- // Run query
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "aString", new Integer(22), new Double(22.0) }), //$NON-NLS-1$
- };
-
- dataManager.addData("SELECT g_0.e1, g_0.e2, g_0.e4 FROM pm1.g1 AS g_0 WHERE g_0.e2 IN (SELECT g_1.e2 FROM pm1.g1 AS g_1 WHERE g_1.e4 = g_0.e4)", //$NON-NLS-1$
- expected);
-
- helpProcess(plan, dataManager, expected);
- }
-
- /** control query, this test passes */
- @Test public void testCorrelatedSubqueryCase3667a() {
-
- HardcodedDataManager dataManager = new HardcodedDataManager();
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
- caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
- caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
- caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- // Plan query
- String sql = "Select e1, e2, e4 from vm1.g1 outg1 where outg1.e2 in (select ing1.e2 FROM vm1.g1 ing1 WHERE outg1.e4 = ing1.e4)";//$NON-NLS-1$
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.example1Cached(), capFinder);
-
- // Run query
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "aString", new Integer(22), new Double(22.0) }), //$NON-NLS-1$
- };
-
- dataManager.addData("SELECT g_0.e1, g_0.e2, g_0.e4 FROM pm1.g1 AS g_0 WHERE g_0.e2 IN (SELECT g_1.e2 FROM pm1.g1 AS g_1 WHERE g_1.e4 = g_0.e4)", //$NON-NLS-1$
- expected);
-
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery2() {
- String sql = "Select e1, e2 from pm1.g1 where e2 in (select e2 FROM pm2.g1 WHERE pm1.g1.e4 = pm2.g1.e4)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testCorrelatedSubquery3() {
- String sql = "Select e1, (select e2 FROM pm2.g1 WHERE pm1.g1.e4 = pm2.g1.e4) from pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery3a() {
- String sql = "Select e1, (select e2 FROM pm2.g1 WHERE X.e4 = e4) from pm1.g1 X"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery3b() {
- String sql = "Select e1, (select e2 FROM pm2.g1 Y WHERE X.e4 = e4) from pm1.g1 X"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery3c() {
- String sql = "Select e1, (select e2 FROM pm2.g1 Y WHERE X.e4 = Y.e4) from pm1.g1 X"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery4() {
- String sql = "Select e1, e2 from pm1.g1 X where e2 in (select e2 FROM pm2.g1 WHERE X.e4 = pm2.g1.e4)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery4a() {
- String sql = "Select e1, e2 from pm1.g1 X where e2 = some (select e2 FROM pm2.g1 WHERE X.e4 = pm2.g1.e4)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery_defect9968() {
- String sql = "Select e1, e2 from pm1.g1 X where e2 in (select max(X.e2) FROM pm2.g1 WHERE X.e4 = pm2.g1.e4)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery_defect9968a() {
- String sql = "Select e1, e2 from pm1.g1 X where e2 in (select ((X.e2)/2) as e FROM pm2.g1 WHERE X.e4 = pm2.g1.e4)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery_defect9968b() {
- String sql = "Select e1, e2 from pm1.g1 X where e2 in (select (select e2 as e FROM pm2.g1 WHERE X.e4 = pm2.g1.e4) as e FROM pm2.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubquery_defect10021() {
- String sql = "Select e1, e2 from table1 X where e4 in (select max(Y.e4) FROM table1 Y WHERE X.e4 = Y.e4)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(2) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Note the subquery has a multi-column result - conceptually this is
- * legal for the EXISTS predicate
- */
- @Test public void testCorrelatedSubquery5() {
- String sql = "Select * from pm1.g1 where exists (select * FROM pm2.g1 WHERE pm1.g1.e1 = e1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "b", new Integer(1), Boolean.TRUE, null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Count the # of parent rows for which no child rows exist
- */
- @Test public void testCorrelatedSubquery6() {
- String sql = "Select count(*) from pm1.g1 where not (exists (select * FROM pm2.g1 WHERE pm1.g1.e1 = e1))"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { new Integer(2) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Select e2, e4, and the avg of e4 for each group of e1
- */
- @Test public void testCorrelatedSubquery7() {
- String sql = "select e2, e4, (select avg(e4) FROM pm1.g1 Y WHERE X.e1 = e1) from pm1.g1 X"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { new Integer(0), new Double(2.0), new Double(3.6666666666666665) }),
- Arrays.asList(new Object[] { new Integer(1), new Double(1.0), null }),
- Arrays.asList(new Object[] { new Integer(3), new Double(7.0), new Double(3.6666666666666665) }),
- Arrays.asList(new Object[] { new Integer(1), null , null }),
- Arrays.asList(new Object[] { new Integer(2), new Double(0.0), new Double(0.0) }),
- Arrays.asList(new Object[] { new Integer(0), new Double(2.0), new Double(3.6666666666666665) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Select e2, e4, and the avg of e4 for each group of e1
- */
- @Test public void testCorrelatedSubquery8() {
- String sql = "select X.e2, X.e4, (select avg(Y.e4) FROM pm1.g1 Y WHERE X.e1 = Y.e1) from pm1.g1 X"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { new Integer(0), new Double(2.0), new Double(3.6666666666666665) }),
- Arrays.asList(new Object[] { new Integer(1), new Double(1.0), null }),
- Arrays.asList(new Object[] { new Integer(3), new Double(7.0), new Double(3.6666666666666665) }),
- Arrays.asList(new Object[] { new Integer(1), null , null }),
- Arrays.asList(new Object[] { new Integer(2), new Double(0.0), new Double(0.0) }),
- Arrays.asList(new Object[] { new Integer(0), new Double(2.0), new Double(3.6666666666666665) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer1() {
- String sql = "Select e1, e2 from vm1.g1 X where e2 in (select e2 FROM vm1.g1 Y WHERE X.e4 = Y.e4)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1) }),
- Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer2() {
- String sql = "Select e1, e2 from vm1.g2 where e2 in (select e2 FROM vm1.g1 WHERE vm1.g2.e4 = vm1.g1.e4)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer3() {
- String sql = "Select e2 from vm1.g6 where e2 in (select e2 FROM vm1.g1 WHERE vm1.g6.e = e1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[0];
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer4() {
- String sql = "Select e2 from vm1.g7 where e2 in (select e2 FROM vm1.g1 WHERE vm1.g7.e = e1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[0];
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer5() {
- String sql = "Select e1 from vm1.g4 where not (e1 in (select e1 FROM vm1.g1 WHERE vm1.g4.e1 = e1)) order by e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "2" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "3" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer6() {
- String sql = "Select e2 from vm1.g1 X where e2 in (select X.e2 FROM vm1.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(3) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(0) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer6a() {
- String sql = "Select e2 from vm1.g1 where e2 in (select vm1.g1.e2 FROM vm1.g5)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(3) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(0) })
- };
-
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer6b() {
- String sql = "Select e2 from vm1.g1 where e2 in (select vm1.g1.e2 FROM vm1.g2)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(3) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(0) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer6c() {
- String sql = "Select e2 from vm1.g7 where e2 in (select vm1.g7.e FROM vm1.g1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[0];
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer6e() {
- String sql = "Select e2 from vm1.g1 where e2 in (select vm1.g1.e2 FROM vm1.g2a)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(3) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(0) })
- };
-
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryVirtualLayer7() {
- String sql = "Select e2 from vm1.g7 where e2 in (select vm1.g7.e FROM vm1.g1 WHERE vm1.g7.e = e1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[0];
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation() {
- String sql = "Select * from vm1.g21"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "b", new Integer(1), Boolean.TRUE, null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation2() {
- String sql = "Select * from vm1.g20"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation3() {
- String sql = "Select * from vm1.g19 order by e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "2" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "3" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * User correlated subquery, and one of the virtual group transformations
- * also has a correlated subquery
- */
- @Test public void testCorrelatedSubqueryInTransformation4() {
- String sql = "Select * from vm1.g20 where exists (Select * from vm1.g19 where convert(vm1.g20.e2, string) = vm1.g19.e1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * User correlated subquery, and one of the virtual group transformations
- * also has a correlated subquery
- */
- @Test public void testCorrelatedSubqueryInTransformation5() {
- String sql = "Select * from vm1.g19 where exists (Select e2 from vm1.g20 where convert(e2, string) = vm1.g19.e1) order by e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "2" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "3" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation6() {
- String sql = "Select * from vm1.g21 where e2 = some (Select e2 from pm1.g1 where e1 = vm1.g21.e1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "b", new Integer(1), Boolean.TRUE, null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation7() {
- String sql = "Select * from vm1.g21 where exists (Select e2 from pm1.g2 where e4 = convert(vm1.g21.e2, double))"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation8() {
- String sql = "Select * from vm1.g21 where exists (Select e2 from pm1.g1 where e4 = convert(vm1.g21.e2, double))"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation9() {
- String sql = "Select * from vm1.g22"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
-
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation10() {
- String sql = "Select * from vm1.g23"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation11() {
- String sql = "Select * from vm1.g24"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
-// Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }),
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation12() {
- String sql = "Select * from vm1.g24 X where exists (Select * from vm1.g24 Y where X.e2 = Y.e2)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
-// Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }),
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation13() {
- String sql = "Select e1, e2, e3, e4, (select e4 from vm1.g25 where pm1.g1.e4 = e5 and e4=0.0) as e5 from pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), null }),
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation14() {
- String sql = "Select e1, e2, e3, e4, (select e4 from vm1.g26 where pm1.g1.e4 = e5 and e4=0.0) as e5 from pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), null }),
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation15() {
- String sql = "Select e1, e2, e3, e4, (select e4 from vm1.g23 where vm1.g22.e4 = e5) as e5 from vm1.g22 where e1 = 'a'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** Test selecting a virtual element (e5) which is defined by a scalar subquery in the virtual transformation */
- @Test public void testCorrelatedSubqueryInTransformation15a() {
- String sql = "Select e1, e2, e3, e4 from pm1.g1 where exists (select * from vm1.g26 where pm1.g1.e3 = e3)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueryInTransformation15b() {
- String sql = "Select e1, e2, e3, e4, (select e4 from vm1.g23 where vm1.g22.e4 = e5) as e5 from vm1.g22 where e1 = 'a' and exists (select * from vm1.g23 where vm1.g22.e3 = e3)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** Test selecting a virtual element (e5) which is defined by a scalar subquery in the virtual transformation */
- @Test public void testCorrelatedSubqueryInTransformation15c() {
- String sql = "Select e1, e2, e3, e4 from pm1.g1 where exists (select e1, e2, e3, e4, e5 as e from vm1.g26 where pm1.g1.e3 = e3)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** Test selecting a virtual element (e5) which is defined by a scalar subquery in the virtual transformation */
- @Test public void testCorrelatedSubqueryInTransformation15d() {
- String sql = "Select e1, e2, e3, e4 from pm1.g1 where exists (select e1, e2, e3, e4, ((e4 + e5)/(e4 + 1)) as e from vm1.g26 where pm1.g1.e3 = e3)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
- Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
-// Here is select * from vm1.g26
-// Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }),
-// Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), null }),
-// Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), null }),
-// Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }),
-// Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }),
-// Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null })
-
-
- @Test public void testCorrelatedSubqueryInTransformation16() {
-// String sql = "Select e1, e2, e3, e4, (select e4 from vm1.g23 where vm1.g22.e4 = e5) as e5 from vm1.g22 where e1 = 'a'"/* and exists (select * from vm1.g23 where vm1.g22.e3 = e3)"*/;
- String sql = "select * from vm1.g26 where e5 = 0.0"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[]{
-// Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }),
-// Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), null }),
-// Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), null }),
-// Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }),
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }), //$NON-NLS-1$
-// Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedSubqueriesNested() {
- String sql =
- "Select e1, e2, e4 from pm1.g1 where e2 < all (" + //$NON-NLS-1$
- "select e2 from pm1.g2 where pm1.g1.e1 = e1 and exists("+ //$NON-NLS-1$
- "select e2 from pm2.g1 where pm1.g2.e4 = pm2.g1.e4))"; //$NON-NLS-1$
- Command query = helpParse(sql);
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0), new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(1), null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(2), new Double(0.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(query, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** defect 15124 */
- @Test public void testCorrelatedSubqueryAndInlineView() {
- String sql = "Select e1, (select e2 FROM pm2.g1 Y WHERE X.e4 = Y.e4) from (select * from pm1.g1) as X"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** defect 15124 */
- @Test public void testCorrelatedSubqueryAndInlineView2() {
- String sql = "Select e1 from (select * from pm1.g1) as X WHERE e2 IN (select e2 FROM pm2.g1 Y WHERE X.e4 = Y.e4)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** defect 15124 */
- @Test public void testCorrelatedSubqueryAndInlineView3() {
- String sql = "Select e1, (select e2 FROM pm2.g1 Y WHERE X.e4 = Y.e4) from (select * from pm1.g1 UNION ALL select * from pm1.g1) as X"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** defect 15124 */
- @Test public void testCorrelatedSubqueryAndInlineView4() {
- String sql = "Select e1, (select e2 FROM pm2.g1 Y WHERE X.e4 = Y.e4) from (select pm1.g1.e1, (select pm1.g1.e2 from pm1.g1 Z where pm1.g1.e1 = Z.e1), pm1.g1.e3, pm1.g1.e4 from pm1.g1) as X"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", null }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testXMLUnion_defect8373() {
- // Create query
- String sql = "SELECT * FROM xmltest.doc5"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] {
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + //$NON-NLS-1$
- "<root><node1><node2>a</node2></node1><node1><node2/></node1><node1><node2>a</node2></node1><node1><node2>c</node2></node1><node1><node2>b</node2></node1><node1><node2>a</node2></node1><node1><node2>a</node2></node1><node1><node2/></node1><node1><node2>a</node2></node1><node1><node2>c</node2></node1><node1><node2>b</node2></node1><node1><node2>a</node2></node1></root>" //$NON-NLS-1$
- })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testStoredQuery1() {
- // Create query
- String sql = "EXEC pm1.sq1()"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1) }),
- Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testStoredQuery2() {
- // Create query
- String sql = "EXEC pm1.sq2(\'a\')"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testStoredQuery3() {
- // Create query
- String sql = "select x.e1 from (EXEC pm1.sq1()) as x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { null}),
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testStoredQuery4() {
- // Create query
- String sql = "EXEC pm1.sq5('a')"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testStoredQuery5() {
- // Create query
- String sql = "EXEC pm1.sp1()"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, new Integer(1)}),
- Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Integer(1)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testStoredQuery6() {
- // Create query
- String sql = "EXEC pm1.sqsp1()"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { null}),
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testStoredQuery7() {
- // Create query
- String sql = "EXEC pm1.sq17()"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] {
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + //$NON-NLS-1$
- "<root><node1><node2><node3/></node2></node1></root>" //$NON-NLS-1$
- })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- // implict type conversion of parameter
- @Test public void testStoredQuery8() {
- // Create query
- String sql = "EXEC pm1.sq5(5)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- // function for parameter
- @Test public void testStoredQuery9() {
- // Create query
- String sql = "EXEC pm1.sq5(concat('a', ''))"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** named parameters */
- @Test public void testStoredQuery10() {
- // Create query
- String sql = "EXEC pm1.sq3b(\"in\" = 'a', in3 = 'something')"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testInsert() {
- // Create query
- String sql = "Insert into pm1.g1 (pm1.g1.e1, pm1.g1.e2) values ('MyString', 1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1)})
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData3(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA FULL OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20) */
- @Test public void testDefect7770_FullOuter() {
- // Create query
- String sql = "SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA FULL OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(5), new Integer(5) }),
- Arrays.asList(new Object[] { new Integer(6), new Integer(6) }),
- Arrays.asList(new Object[] { new Integer(7), new Integer(7) }),
- Arrays.asList(new Object[] { new Integer(8), new Integer(8) }),
- Arrays.asList(new Object[] { new Integer(9), new Integer(9) }),
- Arrays.asList(new Object[] { new Integer(10), new Integer(10) }),
- Arrays.asList(new Object[] { new Integer(11), new Integer(11) }),
- Arrays.asList(new Object[] { new Integer(12), new Integer(12) }),
- Arrays.asList(new Object[] { new Integer(13), new Integer(13) }),
- Arrays.asList(new Object[] { new Integer(14), new Integer(14) }),
- Arrays.asList(new Object[] { new Integer(15), new Integer(15) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA RIGHT OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20) */
- @Test public void testDefect7770_RightOuter() {
- // Create query
- String sql = "SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA RIGHT OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(5), new Integer(5) }),
- Arrays.asList(new Object[] { new Integer(6), new Integer(6) }),
- Arrays.asList(new Object[] { new Integer(7), new Integer(7) }),
- Arrays.asList(new Object[] { new Integer(8), new Integer(8) }),
- Arrays.asList(new Object[] { new Integer(9), new Integer(9) }),
- Arrays.asList(new Object[] { new Integer(10), new Integer(10) }),
- Arrays.asList(new Object[] { new Integer(11), new Integer(11) }),
- Arrays.asList(new Object[] { new Integer(12), new Integer(12) }),
- Arrays.asList(new Object[] { new Integer(13), new Integer(13) }),
- Arrays.asList(new Object[] { new Integer(14), new Integer(14) }),
- Arrays.asList(new Object[] { new Integer(15), new Integer(15) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA LEFT OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20) */
- @Test public void testDefect7770_LeftOuter() {
- // Create query
- String sql = "SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA LEFT OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(5), new Integer(5) }),
- Arrays.asList(new Object[] { new Integer(6), new Integer(6) }),
- Arrays.asList(new Object[] { new Integer(7), new Integer(7) }),
- Arrays.asList(new Object[] { new Integer(8), new Integer(8) }),
- Arrays.asList(new Object[] { new Integer(9), new Integer(9) }),
- Arrays.asList(new Object[] { new Integer(10), new Integer(10) }),
- Arrays.asList(new Object[] { new Integer(11), new Integer(11) }),
- Arrays.asList(new Object[] { new Integer(12), new Integer(12) }),
- Arrays.asList(new Object[] { new Integer(13), new Integer(13) }),
- Arrays.asList(new Object[] { new Integer(14), new Integer(14) }),
- Arrays.asList(new Object[] { new Integer(15), new Integer(15) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testReorder1() {
- // Create query
- String sql = "SELECT e1 AS x, {b'false'}, e2+e4, e3 FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", Boolean.FALSE, new Double(2.0), Boolean.FALSE }), //$NON-NLS-1$
- Arrays.asList(new Object[] { null, Boolean.FALSE, new Double(2.0), Boolean.FALSE }),
- Arrays.asList(new Object[] { "a", Boolean.FALSE, new Double(10.0), Boolean.TRUE }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", Boolean.FALSE, null, Boolean.TRUE }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", Boolean.FALSE, new Double(2.0), Boolean.FALSE }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", Boolean.FALSE, new Double(2.0), Boolean.FALSE }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testTwoFullOuterJoins1() {
- // Create query
- String sql = "SELECT A.IntKey AS A_IntKey, B.IntKey AS B_IntKey, C.IntKey AS C_IntKey " + //$NON-NLS-1$
- "FROM (BQT1.SmallA AS A FULL OUTER JOIN BQT2.SmallA AS B ON A.IntKey = B.IntKey) FULL OUTER JOIN BQT3.SmallA AS C ON B.IntKey = C.IntKey " + //$NON-NLS-1$
- "WHERE (A.IntKey >= 0) AND (A.IntKey <= 15) " + //$NON-NLS-1$
- "AND (B.IntKey >= 5) AND (B.IntKey <= 20) " + //$NON-NLS-1$
- "AND (C.IntKey >= 10) AND (C.IntKey <= 30)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(10), new Integer(10), new Integer(10) }),
- Arrays.asList(new Object[] { new Integer(11), new Integer(11), new Integer(11) }),
- Arrays.asList(new Object[] { new Integer(12), new Integer(12), new Integer(12) }),
- Arrays.asList(new Object[] { new Integer(13), new Integer(13), new Integer(13) }),
- Arrays.asList(new Object[] { new Integer(14), new Integer(14), new Integer(14) }),
- Arrays.asList(new Object[] { new Integer(15), new Integer(15), new Integer(15) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSelectDistinctOnBQT() {
- // Create query
- String sql = "SELECT DISTINCT IntKey FROM BQT1.SmallA"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(3) }),
- Arrays.asList(new Object[] { new Integer(4) }),
- Arrays.asList(new Object[] { new Integer(5) }),
- Arrays.asList(new Object[] { new Integer(6) }),
- Arrays.asList(new Object[] { new Integer(7) }),
- Arrays.asList(new Object[] { new Integer(8) }),
- Arrays.asList(new Object[] { new Integer(9) }),
- Arrays.asList(new Object[] { new Integer(10) }),
- Arrays.asList(new Object[] { new Integer(11) }),
- Arrays.asList(new Object[] { new Integer(12) }),
- Arrays.asList(new Object[] { new Integer(13) }),
- Arrays.asList(new Object[] { new Integer(14) }),
- Arrays.asList(new Object[] { new Integer(15) }),
- Arrays.asList(new Object[] { new Integer(16) }),
- Arrays.asList(new Object[] { new Integer(17) }),
- Arrays.asList(new Object[] { new Integer(18) }),
- Arrays.asList(new Object[] { new Integer(19) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSelectWithNoFrom() {
- // Create query
- String sql = "SELECT 5"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(5) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testBetween() {
- // Create query
- String sql = "SELECT * FROM pm1.g1 WHERE e2 BETWEEN 1 AND 2"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
- Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Test <code>QueryProcessor</code>'s ability to process a query containing
- * a <code>CASE</code> expression in which a <code>BETWEEN</code>
- * comparison is used in the queries <code>SELECT</code> statement.
- * <p>
- * For example:
- * <p>
- * SELECT CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END FROM pm1.g1
- */
- @Test public void testBetweenInCase() {
- // Create query
- final String sql = "SELECT CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(-1) }),
- Arrays.asList(new Object[] { new Integer(-1) }),
- Arrays.asList(new Object[] { new Integer(3) }),
- Arrays.asList(new Object[] { new Integer(-1) }),
- Arrays.asList(new Object[] { new Integer(-1) }),
- Arrays.asList(new Object[] { new Integer(-1) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Test <code>QueryProcessor</code>'s ability to process a query containing
- * an aggregate SUM with a <code>CASE</code> expression in which a
- * <code>BETWEEN</code> comparison is used in the queries <code>SELECT</code>
- * statement.
- * <p>
- * For example:
- * <p>
- * SELECT SUM(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END) FROM pm1.g1
- */
- @Test public void testBetweenInCaseInSum() {
- // Create query
- final String sql = "SELECT SUM(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END) FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Long(-2) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Test <code>QueryProcessor</code>'s ability to process a query containing
- * an aggregate SUM with a <code>CASE</code> expression in which a
- * <code>BETWEEN</code> comparison is used in the queries <code>SELECT</code>
- * statement and a GROUP BY is specified.
- * <p>
- * For example:
- * <p>
- * SELECT e1, SUM(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END)
- * FROM pm1.g1 GROUP BY e1 ORDER BY e1
- */
- @Test public void testBetweenInCaseInSumWithGroupBy() {
- // Create query
- final String sql = "SELECT e1, SUM(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END) FROM pm1.g1 GROUP BY e1 ORDER BY e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, new Long(-1) }),
- Arrays.asList(new Object[] { "a", new Long(1) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Long(-1) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c", new Long(-1) }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Test <code>QueryProcessor</code>'s ability to process a query containing
- * an aggregate COUNT with a <code>CASE</code> expression in which a
- * <code>BETWEEN</code> comparison is used in the queries <code>SELECT</code>
- * statement.
- * <p>
- * For example:
- * <p>
- * SELECT COUNT(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 END) FROM pm1.g1
- */
- @Test public void testBetweenInCaseInCount() {
- // Create query
- final String sql = "SELECT COUNT(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 END) FROM pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCase() {
- // Create query
- String sql = "SELECT e2, CASE e2 WHEN 1 THEN 2 ELSE 3 END FROM pm1.g1 WHERE e2 BETWEEN 1 AND 2"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(2), new Integer(3) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSelectNoFrom1() {
- // Create query
- String sql = "SELECT 1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSelectNoFrom2() {
- // Create query
- String sql = "SELECT 1, {b'true'}, 2.0 AS x, {d'2003-11-04'}"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), Boolean.TRUE, new Double(2.0), TimestampUtil.createDate(103, 10, 4) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCase1566() throws Exception {
- // Create query
- String sql = "SELECT x, COUNT(*) FROM (SELECT convert(TimestampValue, date) AS x FROM bqt1.smalla) as y GROUP BY x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { java.sql.Date.valueOf("2002-01-01"), new Integer(2) }),
- Arrays.asList(new Object[] { java.sql.Date.valueOf("2002-01-02"), new Integer(3) }) };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT_case1566(dataManager);
-
- // Create capabilities
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- // Parse query
- Command command = QueryParser.getQueryParser().parseCommand(sql);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.exampleBQTCached(), capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect10976(){
- String sql = "SELECT * FROM vm1.g28"; //$NON-NLS-1$
-
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { "A", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "B", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "C", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect10976_2(){
- String sql = "SELECT * FROM vm1.g29"; //$NON-NLS-1$
-
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { "A", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "B", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "C", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect10976_3(){
- String sql = "SELECT * FROM vm1.g30"; //$NON-NLS-1$
-
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect10976_4(){
- String sql = "SELECT * FROM vm1.g31 order by x"; //$NON-NLS-1$
-
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect10976_5(){
- String sql = "SELECT * FROM vm1.g32"; //$NON-NLS-1$
-
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect11236_MergeJoinWithFunctions() {
- // Create query
- String sql = "SELECT pm1.g1.e2, pm2.g1.e2 FROM pm1.g1, pm2.g1 WHERE pm1.g1.e2 = (pm2.g1.e2+1)"; //$NON-NLS-1$
- boolean pushDown = false;
- boolean dependent = false;
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(3), new Integer(2) })
- };
-
- helpTestMergeJoinWithExpression(sql, pushDown, dependent, expected);
- }
-
- @Test public void testMergeJoinWithFunctionsPushDown() {
- // Create query
- String sql = "SELECT pm1.g1.e2, pm2.g1.e2 FROM pm1.g1, pm2.g1 WHERE pm1.g1.e2 = (pm2.g1.e2+1)"; //$NON-NLS-1$
- boolean pushDown = true;
- boolean dependent = false;
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(3), new Integer(2) })
- };
-
- helpTestMergeJoinWithExpression(sql, pushDown, dependent, expected);
- }
-
- @Test public void testMergeJoinWithFunctionsPushDownDependent() {
- // Create query
- String sql = "SELECT pm1.g1.e2, pm2.g1.e2 FROM pm1.g1, pm2.g1 WHERE pm1.g1.e2 = (pm2.g1.e2+1) option makedep pm1.g1"; //$NON-NLS-1$
- boolean pushDown = true;
- boolean dependent = true;
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
- Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(3), new Integer(2) })
- };
-
- helpTestMergeJoinWithExpression(sql, pushDown, dependent, expected);
- }
-
-
- /**
- * @param sql
- * @param pushDown
- * @param expected
- */
- private void helpTestMergeJoinWithExpression(String sql,
- boolean pushDown,
- boolean dependent,
- List[] expected) {
- // Construct data manager with data
- ProcessorDataManager dataManager = null;
- if (!pushDown) {
- FakeDataManager fakeDataManager = new FakeDataManager();
- sampleData1(fakeDataManager);
- dataManager = fakeDataManager;
- } else {
- HardcodedDataManager hardCoded = new HardcodedDataManager();
- List[] results = new List[] {
- Arrays.asList(new Object[] {new Integer(0), new Integer(1)}),
- Arrays.asList(new Object[] {new Integer(0), new Integer(1)}),
- Arrays.asList(new Object[] {new Integer(1), new Integer(2)}),
- Arrays.asList(new Object[] {new Integer(1), new Integer(2)}),
- Arrays.asList(new Object[] {new Integer(2), new Integer(3)}),
- Arrays.asList(new Object[] {new Integer(3), new Integer(4)}),
- };
- hardCoded.addData("SELECT g_0.e2 AS c_0, (g_0.e2 + 1) AS c_1 FROM pm2.g1 AS g_0 ORDER BY c_1", results); //$NON-NLS-1$
- if (!dependent) {
- results = new List[] {
- Arrays.asList(new Object[] {new Integer(0),}),
- Arrays.asList(new Object[] {new Integer(0),}),
- Arrays.asList(new Object[] {new Integer(1),}),
- Arrays.asList(new Object[] {new Integer(1),}),
- Arrays.asList(new Object[] {new Integer(2),}),
- Arrays.asList(new Object[] {new Integer(3),}),
- };
- hardCoded.addData("SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0 ORDER BY c_0", results); //$NON-NLS-1$
- } else {
- results = new List[] {
- Arrays.asList(new Object[] {new Integer(1),}),
- Arrays.asList(new Object[] {new Integer(2),}),
- Arrays.asList(new Object[] {new Integer(1),}),
- };
- hardCoded.addData("SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0 WHERE g_0.e2 IN (1, 2)", results); //$NON-NLS-1$
- results = new List[] {
- Arrays.asList(new Object[] {new Integer(3),}),
- };
- hardCoded.addData("SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0 WHERE g_0.e2 IN (3, 4)", results); //$NON-NLS-1$
- }
- dataManager = hardCoded;
- }
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_IN, pushDown);
- caps.setCapabilitySupport(Capability.QUERY_ORDERBY, pushDown);
- caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(2));
- caps.setFunctionSupport("+", pushDown); //$NON-NLS-1$
- finder.addCapabilities("pm1", caps); //$NON-NLS-1$
- finder.addCapabilities("pm2", caps); //$NON-NLS-1$
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, finder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCase2() {
- // Create query
- String sql = "SELECT e2, CASE e2 WHEN 1 THEN 2 END FROM pm1.g1 WHERE e2 BETWEEN 1 AND 2"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(2), null })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCase3() {
- // Create query
- String sql = "SELECT e2, CASE e2 WHEN 1 THEN 2 ELSE null END FROM pm1.g1 WHERE e2 BETWEEN 1 AND 2"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(2), null })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** nested scalar subquery */
- @Test public void testCase4() {
- // Create query
- String nestedExpression = "(SELECT e1 FROM pm1.g2 WHERE e2 = 3)"; //$NON-NLS-1$
- String sql = "SELECT e2, CASE e2 WHEN 1 THEN " + nestedExpression + " ELSE null END FROM pm1.g1 WHERE e2 BETWEEN 1 AND 2"; //$NON-NLS-1$ //$NON-NLS-2$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(1), "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(2), null })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** nested correlated scalar subquery */
- @Test public void testCase5() {
- // Create query
- String nestedExpression = "(SELECT e2 FROM pm1.g2 WHERE pm1.g1.e2 = (e4 + 2))"; //$NON-NLS-1$
- String sql = "SELECT e2, CASE e2 WHEN " + nestedExpression + " THEN 1 ELSE null END FROM pm1.g1"; //$NON-NLS-1$ //$NON-NLS-2$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0), null }),
- Arrays.asList(new Object[] { new Integer(1), null }),
- Arrays.asList(new Object[] { new Integer(3), null }),
- Arrays.asList(new Object[] { new Integer(1), null }),
- Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(0), null })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * NOTE: this test depends on the ProcessorPlan being executed
- * twice and reset in between, which currently is done in the
- * helpProcess method
- */
- @Test public void testDefect12135(){
- String sql = "SELECT pm1.g1.e1, pm1.g2.e1 FROM pm1.g1 LEFT OUTER JOIN pm1.g2 ON pm1.g1.e1=pm1.g2.e1"; //$NON-NLS-1$
-
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect12081(){
- String sql = "SELECT DISTINCT vm1.g1.e1, upper(vm1.g1.e1) as Nuge, pm1.g1.e1, upper(pm1.g1.e1) as Nuge FROM vm1.g1, pm1.g1"; //$NON-NLS-1$
-
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", "A", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "a", "A", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "a", "A", "c", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "b", "B", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "b", "B", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "b", "B", "c", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "c", "C", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "c", "C", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "c", "C", "c", "C" }) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect12081_2(){
- String sql = "SELECT DISTINCT vm1.g1b.e1, vm1.g1b.e1Upper, pm1.g1.e1, upper(pm1.g1.e1) as e1Upper FROM vm1.g1b, pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", "A", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "a", "A", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "a", "A", "c", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "b", "B", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "b", "B", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "b", "B", "c", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "c", "C", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "c", "C", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "c", "C", "c", "C" }) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect12081_3(){
- String sql = "SELECT DISTINCT vm1.g1b.e1, vm1.g1b.e1Upper, pm1.g1.e1, vm1.g1b.e1Upper FROM vm1.g1b, pm1.g1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", "A", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "a", "A", "b", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "a", "A", "c", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "b", "B", "a", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "b", "B", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "b", "B", "c", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "c", "C", "a", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "c", "C", "b", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- Arrays.asList(new Object[] { "c", "C", "c", "C" }) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Basically the same as above, but with a limit node between the dup removal and the project
- */
- @Test public void testDefect12081_4(){
- String sql = "SELECT DISTINCT e1, e1 FROM pm1.g1 where e1 = 'a' LIMIT 1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", "a"}), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect12719(){
- String sql = "SELECT e1_, e2_, e2 FROM vm1.g34, pm1.g2 WHERE vm1.g34.e1_ = pm1.g2.e1 order by e1_, e2_"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0), new Integer(1) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(0), new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(0), new Integer(5) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(0), new Integer(2) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(1), new Integer(0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(1), new Integer(5) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(1), new Integer(2) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "d", new Integer(3), new Integer(2) }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect13034() {
- String sql = "SELECT CONCAT('http://', CONCAT(CASE WHEN (HOST IS NULL) OR (HOST = '') THEN 'soap_host' ELSE HOST END, CASE WHEN (PORT IS NULL) OR (PORT = '') THEN '/metamatrix-soap/services/DataService' ELSE CONCAT(':', CONCAT(PORT, '/metamatrix-soap/services/DataService')) END)) AS location " + //$NON-NLS-1$
- "FROM (SELECT env('soap_host') AS HOST, env('soap_port') AS PORT) AS props"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "http://my.host.com:12345/metamatrix-soap/services/DataService" }), //$NON-NLS-1$
- };
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, new FakeDataManager(), expected);
-
- }
-
- /** see also integer average defect 11682 */
- @Test public void testIntAvgDefect11682() {
- // Create query
- String sql = "SELECT AVG(IntKey), AVG(IntNum), AVG(FloatNum), AVG(LongNum), AVG(DoubleNum), AVG(ByteNum), AVG(ShortValue), AVG(BigIntegerValue), AVG(BigDecimalValue) FROM BQT1.SmallA"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Double(1.5), new Double(1.5), new Double(1.5), new Double(1.5), new Double(1.5), new Double(1.5), new Double(1.5), new BigDecimal("1.500000000"), new BigDecimal("1.500000000") }), //$NON-NLS-1$//$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT_defect11682(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testNonJoinCriteriaInFrom() {
- String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN pm2.g1 b ON a.e1=b.e1 AND b.e2 = 0"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", null, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", null, null }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testNonJoinCriteriaInWhere() {
- String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN pm2.g1 b ON a.e1=b.e1 WHERE b.e2 = 0"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testNonJoinCriteriaInWhere2() {
- String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN pm1.g2 b ON a.e1=b.e1 WHERE (a.e2 + b.e2 = 1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", "a", new Integer(1) }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testNonJoinCriteriaInWhere3() {
- String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN pm1.g2 b ON a.e1=b.e1 WHERE (a.e2 = 0) OR (b.e2 = 0)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", "a", new Integer(1) }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testNonJoinCriteriaInFromNestedInVirtual() {
- String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN (SELECT c.e1, d.e2 FROM pm2.g1 c JOIN pm2.g1 d ON c.e1=d.e1 AND d.e2 >= 0) b ON a.e1=b.e1 AND b.e2 = 0"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", null, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", null, null }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testNonJoinCriteriaInFromUsingDependentJoin() {
- String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN pm2.g1 b ON a.e1=b.e1 AND b.e2 = 0"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", null, null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", null, null }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.example1Cached(), capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect13700() {
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(10) }),
- };
-
- // Plan query
- ProcessorPlan plan = helpGetPlan("EXEC pm1.vsp36(5)", FakeMetadataFactory.example1Cached()); //$NON-NLS-1$
-
- // Run query
- helpProcess(plan, new FakeDataManager(), expected);
-
- }
-
- @Test public void testDefect13920() throws Exception {
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, false);
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- Command command = helpParse("SELECT e5, e2, e3, e4 FROM vm1.g1c WHERE e5 >= {ts'2004-08-01 00:00:00.0'}"); //$NON-NLS-1$
- ProcessorPlan plan = helpGetPlan(command,
- FakeMetadataFactory.example1Cached(), capFinder);
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataStringTimestamps(dataManager);
-
- Calendar cal = Calendar.getInstance();
- cal.set(2004, Calendar.DECEMBER, 31, 0, 0, 0);
- cal.set(Calendar.MILLISECOND, 0);
- Timestamp t1 = new Timestamp(cal.getTime().getTime());
- cal.clear();
- cal.set(2004, Calendar.AUGUST, 1, 0, 0, 0);
- cal.set(Calendar.MILLISECOND, 0);
- Timestamp t2 = new Timestamp(cal.getTime().getTime());
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { t1, new Integer(1), Boolean.TRUE, null }),
- Arrays.asList(new Object[] { t2, new Integer(2), Boolean.FALSE, new Double(0.0) }),
- };
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- /** RLM Case 2077
- * @throws Exception */
- @Test public void testComplexJoinExpressionsUsingDependentJoin() throws Exception {
- String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a, pm2.g1 b where rtrim(a.e1)=(b.e1 || b.e1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "bb ", "b", new Integer(0) }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2b(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
- caps.setFunctionSupport("||", true); //$NON-NLS-1$
- caps.setFunctionSupport("rtrim", true); //$NON-NLS-1$
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1();
- FakeMetadataObject g1 = metadata.getStore().findObject("pm1.g1", FakeMetadataObject.GROUP); //$NON-NLS-1$
- g1.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY + 1000));
- FakeMetadataObject g2 = metadata.getStore().findObject("pm2.g1", FakeMetadataObject.GROUP); //$NON-NLS-1$
- g2.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY - 1));
-
- Command command = helpParse(sql);
- CommandContext context = createCommandContext();
- context.setMetadata(metadata);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder,context);
-
- //Verify a dependent join (not merge join) was used
- assertTrue(plan instanceof RelationalPlan);
- RelationalPlan relationalPlan = (RelationalPlan)plan;
- RelationalNode project = relationalPlan.getRootNode();
- RelationalNode join = project.getChildren()[0];
- assertTrue("Expected instance of JoinNode (for dep join) but got " + join.getClass(), join instanceof JoinNode); //$NON-NLS-1$
-
- // Run query
- helpProcess(plan, context, dataManager, expected);
- }
-
- /** RLM Case 2077
- * @throws Exception */
- @Test public void testComplexJoinExpressionsUsingDependentJoinWithAccessPattern() throws Exception {
- String sql = "SELECT a.e1, b.e1, b.e2 FROM pm4.g1 a, pm2.g1 b where rtrim(a.e1)=(b.e1 || b.e1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "bb ", "b", new Integer(0) }) //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2b(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1));
- caps.setFunctionSupport("||", true); //$NON-NLS-1$
- caps.setFunctionSupport("rtrim", true); //$NON-NLS-1$
- capFinder.addCapabilities("pm4", caps); //$NON-NLS-1$
- capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1();
- FakeMetadataObject g1 = metadata.getStore().findObject("pm4.g1", FakeMetadataObject.GROUP); //$NON-NLS-1$
- g1.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY + 1000));
- FakeMetadataObject g2 = metadata.getStore().findObject("pm2.g1", FakeMetadataObject.GROUP); //$NON-NLS-1$
- g2.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY - 1));
-
- Command command = helpParse(sql);
- CommandContext context = createCommandContext();
- context.setMetadata(metadata);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder, context);
-
- //Verify a dependent join (not merge join) was used
- assertTrue(plan instanceof RelationalPlan);
- RelationalPlan relationalPlan = (RelationalPlan)plan;
- RelationalNode project = relationalPlan.getRootNode();
- RelationalNode join = project.getChildren()[0];
- assertTrue("Expected instance of JoinNode (for dep join) but got " + join.getClass(), join instanceof JoinNode); //$NON-NLS-1$
-
- // Run query
- helpProcess(plan, context, dataManager, expected);
- }
-
- @Test public void testPushingCriteriaUnderJoinButNotToSource() {
- // Create query
- String sql = "SELECT A.IntKey AS A_IntKey, B.IntKey AS B_IntKey, C.IntKey AS C_IntKey " + //$NON-NLS-1$
- "FROM (BQT1.SmallA AS A FULL OUTER JOIN BQT2.SmallA AS B ON A.IntKey = B.IntKey) LEFT OUTER JOIN BQT3.SmallA AS C ON B.IntKey = C.IntKey " + //$NON-NLS-1$
- "WHERE (sin(A.IntKey) >= 0) " + //$NON-NLS-1$
- "AND (C.IntKey >= 10)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(13), new Integer(13), new Integer(13) }),
- Arrays.asList(new Object[] { new Integer(14), new Integer(14), new Integer(14) }),
- Arrays.asList(new Object[] { new Integer(15), new Integer(15), new Integer(15) }),
- Arrays.asList(new Object[] { new Integer(19), new Integer(19), new Integer(19) }),
- Arrays.asList(new Object[] { new Integer(20), new Integer(20), new Integer(20) }),
- Arrays.asList(new Object[] { new Integer(21), new Integer(21), new Integer(21) }),
- Arrays.asList(new Object[] { new Integer(26), new Integer(26), new Integer(26) }),
- Arrays.asList(new Object[] { new Integer(27), new Integer(27), new Integer(27) }),
- Arrays.asList(new Object[] { new Integer(28), new Integer(28), new Integer(28) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testPushdownLiteralInSelectUnderAggregate() {
- String sql = "SELECT COUNT(*) FROM (SELECT '' AS y, a.IntKey FROM BQT1.SmallA a union all select '', b.intkey from bqt1.smallb b) AS x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(30) })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
- caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT_STAR, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testPushdownLiteralInSelectWithOrderBy() {
- String sql = "SELECT 1, concat('a', 'b' ) AS X FROM BQT1.SmallA where intkey = 0 " + //$NON-NLS-1$
- "UNION ALL " + //$NON-NLS-1$
- "select 2, 'Hello2' from BQT1.SmallA where intkey = 1 order by X desc"; //$NON-NLS-1$
-
-
- // Create expected results - would expect these to be:
- // 1, "ab"
- // 2, "Hello2"
- // but our fake tuple source is too dumb to return anything reasonable, so instead get:
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null, null }),
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQTSmall(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
- caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /** defect 15348
- * @throws Exception */
- @Test public void testPreparedStatementDefect15348() throws Exception{
- String sql = "SELECT e1 from pm1.g1 where myrtrim(?)=e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
- caps.setFunctionSupport("myrtrim", true); //$NON-NLS-1$
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- FunctionLibrary funcLibrary = new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(new FakeFunctionMetadataSource().getFunctionMethods())));
- FakeMetadataFacade metadata = new FakeMetadataFacade(FakeMetadataFactory.example1Cached().getStore(), funcLibrary);
-
- processPreparedStatement(sql, expected, dataManager, capFinder,
- metadata, Arrays.asList("a "));
- }
-
- static void processPreparedStatement(String sql, List[] expected,
- ProcessorDataManager dataManager, CapabilitiesFinder capFinder,
- QueryMetadataInterface metadata, List<?> values) throws Exception {
- Command command = helpParse(sql);
- CommandContext context = createCommandContext();
- context.setMetadata(metadata);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder, context);
-
- // Collect reference, set value
- VariableContext vc = new VariableContext();
- Iterator<?> valIter = values.iterator();
- for (Reference ref : ReferenceCollectorVisitor.getReferences(command)) {
- vc.setGlobalValue(ref.getContextSymbol(), valIter.next()); //$NON-NLS-1$
- }
- context.setVariableContext(vc);
- // Run query
- helpProcess(plan, context, dataManager, expected);
- }
-
- /** defect 15348
- * @throws Exception */
- @Test public void testPreparedStatementDefect15348b() throws Exception{
- String sql = "SELECT e1 from pm4.g1 where myrtrim(concat(?, 'a '))=e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "aa" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
- caps.setFunctionSupport("myrtrim", true); //$NON-NLS-1$
- caps.setFunctionSupport("concat", true); //$NON-NLS-1$
- capFinder.addCapabilities("pm4", caps); //$NON-NLS-1$
-
- FunctionLibrary funcLibrary = new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(new FakeFunctionMetadataSource().getFunctionMethods())));
- FakeMetadataFacade metadata = new FakeMetadataFacade(FakeMetadataFactory.example1Cached().getStore(), funcLibrary);
-
- processPreparedStatement(sql, expected, dataManager, capFinder,
- metadata, Arrays.asList("a"));
- }
-
- @Test public void testSourceDoesntSupportGroupAlias() {
- String sql = "SELECT a.IntKey, b.IntKey FROM BQT1.SmallA a, BQT1.SmallB b WHERE a.IntKey = 5 AND A.IntKey = b.IntKey"; //$NON-NLS-1$
-
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- Set atomicQueries = TestOptimizer.getAtomicQueries(plan);
- assertEquals("Expected one query to get pushed down", 1, atomicQueries.size()); //$NON-NLS-1$
- String atomicSql = atomicQueries.iterator().next().toString();
- String expectedSql = "SELECT BQT1.SmallA.IntKey, BQT1.SmallB.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE (BQT1.SmallA.IntKey = BQT1.SmallB.IntKey) AND (BQT1.SmallA.IntKey = 5) AND (BQT1.SmallB.IntKey = 5)"; //$NON-NLS-1$
- assertEquals(expectedSql, atomicSql);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(5), new Integer(5)}),
- };
-
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData(expectedSql, expected);
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testSourceDoesntSupportGroupAliasOrCriteria() {
- String sql = "SELECT a.IntKey, b.IntKey FROM BQT1.SmallA a, BQT1.SmallB b WHERE a.StringKey = '5' AND A.IntKey = b.IntKey"; //$NON-NLS-1$
-
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- Set atomicQueries = TestOptimizer.getAtomicQueries(plan);
- assertEquals("Expected 2 queries to get pushed down", 2, atomicQueries.size()); //$NON-NLS-1$
-
- String expectedSql = "SELECT BQT1.SmallA.StringKey, BQT1.SmallA.IntKey FROM BQT1.SmallA"; //$NON-NLS-1$
- String expectedSql2 = "SELECT BQT1.SmallB.IntKey FROM BQT1.SmallB"; //$NON-NLS-1$
- Set expectedQueries = new HashSet();
- expectedQueries.add(expectedSql);
- expectedQueries.add(expectedSql2);
- assertEquals(expectedQueries, atomicQueries);
-
- List[] input1 = new List[] {
- Arrays.asList(new Object[] { "5", new Integer(5)}), //$NON-NLS-1$
- };
- List[] input2 = new List[] {Arrays.asList(new Object[] {new Integer(5)}),
- };
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData(expectedSql, input1);
- dataManager.addData(expectedSql2, input2);
-
- List[] expected = new List[] {Arrays.asList(new Object[] {new Integer(5), new Integer(5)}),
- };
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Same as testSourceDoesntSupportGroupAlias, but query is in an inline view and only
- * the first column is selected.
- *
- * @since 4.2
- */
- @Test public void testSourceDoesntSupportGroupAliasInVirtual() {
- String sql = "SELECT x FROM (SELECT a.IntKey as x, b.IntKey as y FROM BQT1.SmallA a, BQT1.SmallB b WHERE a.IntKey = 5 AND A.IntKey = b.IntKey) AS z, BQT2.SmallA WHERE y = IntKey"; //$NON-NLS-1$
-
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- Set atomicQueries = TestOptimizer.getAtomicQueries(plan);
- assertEquals("Expected 2 queries to get pushed down", 2, atomicQueries.size()); //$NON-NLS-1$
-
- String expectedSql = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE (BQT1.SmallA.IntKey = BQT1.SmallB.IntKey) AND (BQT1.SmallA.IntKey = 5) AND (BQT1.SmallB.IntKey = 5)"; //$NON-NLS-1$
- String expectedSql2 = "SELECT BQT2.SmallA.IntKey FROM BQT2.SmallA WHERE BQT2.SmallA.IntKey = 5"; //$NON-NLS-1$
-
- Set expectedQueries = new HashSet();
- expectedQueries.add(expectedSql);
- expectedQueries.add(expectedSql2);
- assertEquals(expectedQueries, atomicQueries);
-
- List[] input1 = new List[] {
- Arrays.asList(new Object[] { new Integer(5), new Integer(5)}),
- };
- List[] input2 = new List[] {
- Arrays.asList(new Object[] { new Integer(5)}),
- };
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData(expectedSql, input1);
- dataManager.addData(expectedSql2, input2);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(5)}),
- };
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCaseInGroupBy() {
- String sql = "SELECT sum (IntKey), case when IntKey>=5000 then '5000 +' else '0-999' end " + //$NON-NLS-1$
- "FROM BQT1.SmallA GROUP BY case when IntKey>=5000 then '5000 +' else '0-999' end"; //$NON-NLS-1$
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
- caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- Set actualQueries = TestOptimizer.getAtomicQueries(plan);
- String expectedSql = "SELECT SUM(X_1.c_1), X_1.c_0 FROM (SELECT CASE WHEN BQT1.SmallA.IntKey >= 5000 THEN '5000 +' ELSE '0-999' END AS c_0, BQT1.SmallA.IntKey AS c_1 FROM BQT1.SmallA) AS v_0 GROUP BY X_1.c_0"; //$NON-NLS-1$
- assertEquals(1, actualQueries.size());
- assertEquals(expectedSql, actualQueries.iterator().next().toString());
-
- List[] input1 = new List[] {
- Arrays.asList(new Object[] { new Integer(5), new Integer(10)}),
- };
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData(expectedSql, input1);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(5), new Integer(10)}),
- };
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCaseInGroupByAndHavingCantPush() {
- String sql = "SELECT sum (IntKey), case when IntKey>=5000 then '5000 +' else '0-999' end " + //$NON-NLS-1$
- "FROM BQT1.SmallA GROUP BY case when IntKey>=5000 then '5000 +' else '0-999' end " + //$NON-NLS-1$
- "HAVING case when IntKey>=5000 then '5000 +' else '0-999' end = '5000 +'"; //$NON-NLS-1$
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false); // Can't push GROUP BY
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- Set actualQueries = TestOptimizer.getAtomicQueries(plan);
- String expectedSql = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA"; //$NON-NLS-1$
- assertEquals(1, actualQueries.size());
- assertEquals(expectedSql, actualQueries.iterator().next().toString());
-
- List[] input1 = new List[] {
- Arrays.asList(new Object[] { new Integer(2)}),
- Arrays.asList(new Object[] { new Integer(4)}),
- Arrays.asList(new Object[] { new Integer(10000)}),
- Arrays.asList(new Object[] { new Integer(10002)}),
- };
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData(expectedSql, input1);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Long(20002), "5000 +"}), //$NON-NLS-1$
- };
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCaseInGroupByAndHavingCantPush2() {
- String sql = "SELECT sum (IntKey), case when IntKey>=5000 then '5000 +' else '0-999' end || 'x' " + //$NON-NLS-1$
- "FROM BQT1.SmallA GROUP BY case when IntKey>=5000 then '5000 +' else '0-999' end " + //$NON-NLS-1$
- "HAVING length(case when IntKey>=5000 then '5000 +' else '0-999' end) > 5"; //$NON-NLS-1$
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false); // Can't push GROUP BY
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- Set actualQueries = TestOptimizer.getAtomicQueries(plan);
- String expectedSql = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA"; //$NON-NLS-1$
- assertEquals(1, actualQueries.size());
- assertEquals(expectedSql, actualQueries.iterator().next().toString());
-
- List[] input1 = new List[] {
- Arrays.asList(new Object[] { new Integer(2)}),
- Arrays.asList(new Object[] { new Integer(4)}),
- Arrays.asList(new Object[] { new Integer(10000)}),
- Arrays.asList(new Object[] { new Integer(10002)}),
- };
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData(expectedSql, input1);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Long(20002), "5000 +x"}), //$NON-NLS-1$
- };
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCaseInGroupByAndHavingCantPush3() {
- String sql = "SELECT s, c FROM (" + //$NON-NLS-1$
- "SELECT sum (IntKey) s, case when IntKey>=5000 then '5000 +' else '0-999' end || 'x' c " + //$NON-NLS-1$
- "FROM BQT1.SmallA GROUP BY case when IntKey>=5000 then '5000 +' else '0-999' end " + //$NON-NLS-1$
- ") AS x WHERE length(c) > 5 AND s = 20002"; //$NON-NLS-1$
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false); // Can't push GROUP BY
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- Set actualQueries = TestOptimizer.getAtomicQueries(plan);
- String expectedSql = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA"; //$NON-NLS-1$
- assertEquals(1, actualQueries.size());
- assertEquals(expectedSql, actualQueries.iterator().next().toString());
-
- List[] input1 = new List[] {
- Arrays.asList(new Object[] { new Integer(2)}),
- Arrays.asList(new Object[] { new Integer(4)}),
- Arrays.asList(new Object[] { new Integer(10000)}),
- Arrays.asList(new Object[] { new Integer(10002)}),
- };
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData(expectedSql, input1);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Long(20002), "5000 +x"}), //$NON-NLS-1$
- };
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testFunctionOfAggregateCantPush() {
- String sql = "SELECT StringKey || 'x', SUM(length(StringKey || 'x')) + 1 AS x FROM BQT1.SmallA GROUP BY StringKey || 'x' HAVING space(MAX(length((StringKey || 'x') || 'y'))) = ' '"; //$NON-NLS-1$
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- Set actualQueries = TestOptimizer.getAtomicQueries(plan);
- String expectedSql = "SELECT BQT1.SmallA.StringKey FROM BQT1.SmallA"; //$NON-NLS-1$
- assertEquals(1, actualQueries.size());
- assertEquals(expectedSql, actualQueries.iterator().next().toString());
-
- List[] input1 = new List[] {
- Arrays.asList(new Object[] { "0"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "1"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "10"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "11"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "100"}), //$NON-NLS-1$
- };
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData(expectedSql, input1);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "0x", new Long(3)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "1x", new Long(3)}), //$NON-NLS-1$
- };
- helpProcess(plan, dataManager, expected);
- }
-
-
- @Test public void testCase2634() {
-
- String sql = "SELECT x, IntKey FROM (SELECT IntKey, 'a' AS x FROM BQT1.SmallA UNION ALL SELECT IntKey, 'b' AS x FROM BQT1.SmallB) as Z"; //$NON-NLS-1$
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
- caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- Set actualQueries = TestOptimizer.getAtomicQueries(plan);
- String expectedSql = "SELECT 'a' AS c_0, BQT1.SmallA.IntKey AS c_1 FROM BQT1.SmallA UNION ALL SELECT 'b' AS c_0, BQT1.SmallB.IntKey AS c_1 FROM BQT1.SmallB"; //$NON-NLS-1$
- assertEquals(1, actualQueries.size());
- assertEquals(expectedSql, actualQueries.iterator().next().toString());
-
- List[] input1 = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(1)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(0)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(1)}), //$NON-NLS-1$
- };
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData(expectedSql, input1);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(0)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(1)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(0)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", new Integer(1)}), //$NON-NLS-1$
- };
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testQueryWithoutFromWithOrderBy() {
-
- String sql = "select 'three' as x ORDER BY x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "three"} ), //$NON-NLS-1$
- };
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testQueryWithoutFromWithOrderBy2() {
-
- String sql = "select concat('three', ' sixteen') as x ORDER BY x"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "three sixteen"} ), //$NON-NLS-1$
- };
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testQueryWithoutFromWithOrderBy3() {
-
- String sql = "SELECT CONCAT('yy', 'z') as c1234567890123456789012345678901234567890, " + //$NON-NLS-1$
- "CONCAT('21', '12') AS EXPR ORDER BY c1234567890123456789012345678901234567890"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "yyz", "2112"} ), //$NON-NLS-1$ //$NON-NLS-2$
- };
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testCase2507_3(){
-
- String sql = "SELECT CONCAT('yy', 'z') AS c1234567890123456789012345678901234567890, " + //$NON-NLS-1$
- "CONCAT('21', '12') AS EXPR ORDER BY c1234567890123456789012345678901234567890"; //$NON-NLS-1$
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setFunctionSupport("concat", true); //$NON-NLS-1$
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- ProcessorPlan plan = TestOptimizer.helpPlan(sql,
- metadata,
- null, capFinder,
- new String[0] ,
- TestOptimizer.SHOULD_SUCCEED );
-
- TestOptimizer.checkNodeTypes(plan, new int[] {
- 0, // Access
- 0, // DependentAccess
- 0, // DependentSelect
- 0, // DependentProject
- 0, // DupRemove
- 0, // Grouping
- 0, // Join
- 0, // MergeJoin
- 0, // Null
- 0, // PlanExecution
- 1, // Project
- 0, // Select
- 0, // Sort
- 0 // UnionAll
- });
-
- // TEST PROCESSING
-
- List[] expectedResults = new List[] {
- Arrays.asList(new Object[] { "yyz", "2112"}), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT1(dataManager);
-
- // Run query
- helpProcess(plan, dataManager, expectedResults);
-
- }
-
- @Test public void testMultiGroupJoinCriteria() {
-
- String sql = "SELECT X.NEWFIELD FROM " + //$NON-NLS-1$
- "(SELECT SMALLA.STRINGNUM, " + //$NON-NLS-1$
- "CASE WHEN SMALLA.STRINGNUM LIKE '1%' THEN SMALLA.INTKEY " + //$NON-NLS-1$
- "WHEN SMALLA.STRINGNUM LIKE '2%' THEN SMALLB.INTNUM " + //$NON-NLS-1$
- "WHEN SMALLA.STRINGNUM LIKE '3%' THEN MEDIUMA.INTKEY " + //$NON-NLS-1$
- "END AS NEWFIELD " + //$NON-NLS-1$
- "FROM BQT1.SMALLA, BQT1.SMALLB, BQT1.MEDIUMA " + //$NON-NLS-1$
- "WHERE SMALLA.INTKEY = SMALLB.INTKEY AND SMALLA.INTKEY = MEDIUMA.INTKEY) AS X " + //$NON-NLS-1$
- "WHERE X.NEWFIELD = -3"; //$NON-NLS-1$
-
- String expectedAtomic1 = "SELECT BQT1.SMALLB.INTKEY, BQT1.SMALLB.INTNUM FROM BQT1.SMALLB"; //$NON-NLS-1$
- String expectedAtomic2 = "SELECT BQT1.MEDIUMA.INTKEY FROM BQT1.MEDIUMA"; //$NON-NLS-1$
- String expectedAtomic3 = "SELECT BQT1.SMALLA.INTKEY, BQT1.SMALLA.STRINGNUM FROM BQT1.SMALLA"; //$NON-NLS-1$
-
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- ProcessorPlan plan = TestOptimizer.helpPlan(sql,
- metadata,
- null, capFinder,
- new String[] {expectedAtomic1, expectedAtomic2, expectedAtomic3} ,
- TestOptimizer.SHOULD_SUCCEED );
-
- TestOptimizer.checkNodeTypes(plan, new int[] {
- 3, // Access
- 0, // DependentAccess
- 0, // DependentSelect
- 0, // DependentProject
- 0, // DupRemove
- 0, // Grouping
- 0, // Join
- 2, // MergeJoin
- 0, // Null
- 0, // PlanExecution
- 1, // Project
- 0, // Select
- 0, // Sort
- 0 // UnionAll
- });
-
- // TEST PROCESSING
-
- List[] expectedResults = new List[] {
- Arrays.asList(new Object[] { new Integer(-3) }),
- };
-
- // Construct data manager with data
- HardcodedDataManager dataManager = new HardcodedDataManager();
- List[] input1 = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new Integer(-4)}),
- Arrays.asList(new Object[] { new Integer(2), new Integer(-3)}),
- Arrays.asList(new Object[] { new Integer(3), new Integer(-2)}),
- };
- dataManager.addData(expectedAtomic1, input1);
- List[] input2 = new List[] {
- Arrays.asList(new Object[] { new Integer(1)}),
- Arrays.asList(new Object[] { new Integer(2)}),
- Arrays.asList(new Object[] { new Integer(3)}),
- };
- dataManager.addData(expectedAtomic2, input2);
- List[] input3 = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new String("1")}), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(2), new String("2")}), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(3), new String("3")}), //$NON-NLS-1$
- };
- dataManager.addData(expectedAtomic3, input3);
-
- // Run query
- helpProcess(plan, dataManager, expectedResults);
-
- }
-
- /**
- * Cross-source join with group by on top but no aggregate functions - running some special cases
- * where there are no "aggregate groups" (the groups of the aggregate expressions) because there
- * are no aggregate expressions. In this case, need to switch the aggregate groups to be all the grouping
- * columns because they are all being "grouped on".
- *
- * @since 4.3
- */
- @Test public void testDefect18360(){
-
- String sql = "SELECT a.intkey, a.intnum FROM bqt1.smalla a join bqt2.mediumb b on a.stringkey = b.stringkey " + //$NON-NLS-1$
- "group by a.intkey, a.intnum"; //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- capFinder.addCapabilities("BQT1", new BasicSourceCapabilities()); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", new BasicSourceCapabilities()); //$NON-NLS-1$
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.exampleBQTCached(), capFinder);
-
- // Construct data manager with data
- HardcodedDataManager dataManager = new HardcodedDataManager();
- List[] data1 = new List[] {
- Arrays.asList(new Object[] { "1", new Integer(1), new Integer(5) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "2", new Integer(2), new Integer(6) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "3", new Integer(3), new Integer(7) }), //$NON-NLS-1$
- };
- dataManager.addData("SELECT bqt1.smalla.stringkey, bqt1.smalla.intkey, bqt1.smalla.intnum FROM bqt1.smalla", data1); //$NON-NLS-1$
-
- List[] data2 = new List[] {
- Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "2" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "3" }), //$NON-NLS-1$
- };
- dataManager.addData("SELECT bqt2.mediumb.stringkey FROM bqt2.mediumb", data2); //$NON-NLS-1$
-
- // Run query
- List[] expectedResults = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new Integer(5) }),
- Arrays.asList(new Object[] { new Integer(2), new Integer(6) }),
- Arrays.asList(new Object[] { new Integer(3), new Integer(7) }),
- };
- helpProcess(plan, dataManager, expectedResults);
-
- }
-
- @Test public void testDefect17407(){
- String sql = "select pm1.g1.e1 from pm1.g1, g7 MAKEDEP WHERE pm1.g1.e2=g7.e2 order by e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null}),
- Arrays.asList(new Object[] { null}),
- Arrays.asList(new Object[] { "a"}),//$NON-NLS-1$
- Arrays.asList(new Object[] { "a"}),//$NON-NLS-1$
- Arrays.asList(new Object[] { "a"}),//$NON-NLS-1$
- Arrays.asList(new Object[] { "a"}),//$NON-NLS-1$
- Arrays.asList(new Object[] { "a"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b"}),//$NON-NLS-1$
- Arrays.asList(new Object[] { "c"}),//$NON-NLS-1$
- Arrays.asList(new Object[] { "c"}),//$NON-NLS-1$
- };
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDecodeAsCriteria() {
- // Create query
- String sql = "SELECT x.foo, e2 FROM (select decodestring(e1, 'a,q,b,w') as foo, e2 from vm1.g1) as x where x.foo = 'w'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "w", new Integer(2) }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testInputParamInNestedExecParam() {
- // Create query
- String sql = "EXEC pm1.vsp48('a')"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testVariableInExecParam() {
- // Create query
- String sql = "EXEC pm1.vsp49()"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b", new Integer(2) }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testVariableInNestedExecParam() {
- // Create query
- String sql = "EXEC pm1.vsp50()"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testVariableInNestedExecParamInLoop() {
- // Create query
- String sql = "EXEC pm1.vsp51()"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "bb" }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testVariableInNestedExecParamInAssignment() {
- // Create query
- String sql = "EXEC pm1.vsp52()"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testInputParamInNestedExecParamInLoop() {
- // Create query
- String sql = "EXEC pm1.vsp53('b')"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "bb" }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testInputParamInNestedExecParamInAssignment() {
- // Create query
- String sql = "EXEC pm1.vsp54('c')"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testBitwiseAggregateProc() {
- // Create query
- String sql = "EXEC virt.agg()"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0), "a", new Integer(19) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(1), "b", new Integer(4) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(2), "c", new Integer(3) }), //$NON-NLS-1$
- };
-
- // Plan query
- FakeMetadataFacade metadata = FakeMetadataFactory.exampleBitwise();
- ProcessorPlan plan = helpGetPlan(sql, metadata);
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBitwise(dataManager, metadata);
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- private void sampleDataBitwise(FakeDataManager dataMgr, FakeMetadataFacade metadata) {
- try {
- // Group pm1.g1
- FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("phys.t"); //$NON-NLS-1$
- List elementIDs = metadata.getElementIDsInGroupID(groupID);
- List elementSymbols = FakeDataStore.createElements(elementIDs);
-
- dataMgr.registerTuples(
- groupID,
- elementSymbols,
-
- new List[] {
- Arrays.asList(new Object[] { new Integer(0), "a", new Integer(1) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(0), "a", new Integer(3) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(0), "a", new Integer(16) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(1), "b", new Integer(4) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(2), "c", new Integer(2) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new Integer(2), "c", new Integer(1) }), //$NON-NLS-1$
- } );
-
- } catch(Throwable e) {
- e.printStackTrace();
- fail("Exception building test data (" + e.getClass().getName() + "): " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- @Test public void testFunctionGroupByInJoinCriteria() {
- // Create query
- String sql = "SELECT lower(vm1.g1.e1) from vm1.g1, vm1.g2a where vm1.g1.e1 = vm1.g2a.e1 group by lower(vm1.g1.e1)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- private FakeMetadataFacade createProjectErrorMetadata() {
- FakeMetadataObject p1 = FakeMetadataFactory.createPhysicalModel("p1"); //$NON-NLS-1$
- FakeMetadataObject t1 = FakeMetadataFactory.createPhysicalGroup("p1.t", p1); //$NON-NLS-1$
- List e1 = FakeMetadataFactory.createElements(t1, new String[] {"a", "b" }, new String[] { "string", "string" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- FakeMetadataObject v1 = FakeMetadataFactory.createVirtualModel("v1"); //$NON-NLS-1$
- QueryNode n1 = new QueryNode("v1.t1", "SELECT convert(a, integer) as c, b FROM p1.t"); //$NON-NLS-1$ //$NON-NLS-2$
- FakeMetadataObject vt1 = FakeMetadataFactory.createVirtualGroup("v1.t1", v1, n1); //$NON-NLS-1$
- List vte1 = FakeMetadataFactory.createElements(vt1, new String[] {"c", "b" }, new String[] { "string", "string" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- QueryNode n2 = new QueryNode("v1.t2", "SELECT convert(a, integer) as c, b FROM p1.t"); //$NON-NLS-1$ //$NON-NLS-2$
- FakeMetadataObject vt2 = FakeMetadataFactory.createVirtualGroup("v1.t2", v1, n2); //$NON-NLS-1$
- List vte2 = FakeMetadataFactory.createElements(vt2, new String[] {"c", "b" }, new String[] { "string", "string" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- QueryNode n3 = new QueryNode("v1.u1", "SELECT c, b FROM v1.t1 UNION ALL SELECT c, b FROM v1.t1"); //$NON-NLS-1$ //$NON-NLS-2$
- FakeMetadataObject vu1 = FakeMetadataFactory.createVirtualGroup("v1.u1", v1, n3); //$NON-NLS-1$
- List vtu1 = FakeMetadataFactory.createElements(vu1, new String[] {"c", "b" }, new String[] { "string", "string" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- FakeMetadataStore store = new FakeMetadataStore();
- store.addObject(p1);
- store.addObject(t1);
- store.addObjects(e1);
- store.addObject(v1);
- store.addObject(vt1);
- store.addObjects(vte1);
- store.addObject(vt2);
- store.addObjects(vte2);
- store.addObject(vu1);
- store.addObjects(vtu1);
- return new FakeMetadataFacade(store);
- }
-
- @Test public void testProjectionErrorOverUnionWithConvert() {
- // Create query
- FakeMetadataFacade metadata = createProjectErrorMetadata();
- String sql = "SELECT COUNT(*) FROM v1.u1"; //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
- capFinder.addCapabilities("p1", caps); //$NON-NLS-1$
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(2) }),
- };
-
- // Construct data manager with data
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData("SELECT g_0.a FROM p1.t AS g_0", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1) })});
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testUpdatesInLoop() {
- String sql = "update vm1.g39 set e2=3"; //$NON-NLS-1$
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Construct data manager with data
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData("SELECT pm1.g1.e2 FROM pm1.g1", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(3) } )});
- dataManager.addData("UPDATE pm1.g1 SET e2 = 3 WHERE pm1.g1.e2 = 3", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1) } )});
-
- // Create expected results
- List[] expected = new List[] { Arrays.asList(new Object[] { new Integer(1)})};
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testRand() {
- // Create query
- String sql = "SELECT RAND(E2) FROM pm1.g1 where pm1.g1.e2=3"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] {new Double(0.731057369148862)}),
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /*
- * Prior to case 3994 testInsertTempTableCreation1 worked, but testInsertTempTableCreation did not.
- * Now they should both pass
- *
- */
- @Test public void testInsertTempTableCreation() {
- FakeMetadataObject v1 = FakeMetadataFactory.createVirtualModel("v1"); //$NON-NLS-1$
- QueryNode n1 = new QueryNode("v1.vp", "CREATE VIRTUAL PROCEDURE BEGIN insert into #temp (var1) values (1); select #temp.var1 from #temp; END"); //$NON-NLS-1$ //$NON-NLS-2$
- FakeMetadataObject rs = FakeMetadataFactory.createResultSet("rs", v1, new String[] { "var1" }, new String[] { DataTypeManager.DefaultDataTypes.INTEGER}); //$NON-NLS-1$ //$NON-NLS-2$
- FakeMetadataObject paramRS = FakeMetadataFactory.createParameter("ret", 1, ParameterInfo.RESULT_SET, DataTypeManager.DefaultDataTypes.OBJECT, rs); //$NON-NLS-1$
- FakeMetadataObject vp = FakeMetadataFactory.createVirtualProcedure("v1.vp", v1, Arrays.asList(new Object[] {paramRS}), n1); //$NON-NLS-1$
-
- FakeMetadataStore store = new FakeMetadataStore();
- store.addObject(v1);
- store.addObject(vp);
-
- ProcessorPlan plan = helpGetPlan("exec v1.vp()", new FakeMetadataFacade(store)); //$NON-NLS-1$
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1) })
- };
- helpProcess(plan, new FakeDataManager(), expected);
- }
-
- @Test public void testInsertTempTableCreation1() {
- FakeMetadataObject v1 = FakeMetadataFactory.createVirtualModel("v1"); //$NON-NLS-1$
- QueryNode n1 = new QueryNode("v1.vp", "CREATE VIRTUAL PROCEDURE BEGIN insert into #temp (var1) values (1); select 2 as var1 into #temp; select #temp.var1 from #temp; END"); //$NON-NLS-1$ //$NON-NLS-2$
- FakeMetadataObject rs = FakeMetadataFactory.createResultSet("rs", v1, new String[] { "var1" }, new String[] { DataTypeManager.DefaultDataTypes.INTEGER}); //$NON-NLS-1$ //$NON-NLS-2$
- FakeMetadataObject paramRS = FakeMetadataFactory.createParameter("ret", 1, ParameterInfo.RESULT_SET, DataTypeManager.DefaultDataTypes.OBJECT, rs); //$NON-NLS-1$
- FakeMetadataObject vp = FakeMetadataFactory.createVirtualProcedure("v1.vp", v1, Arrays.asList(new Object[] {paramRS}), n1); //$NON-NLS-1$
-
- FakeMetadataStore store = new FakeMetadataStore();
- store.addObject(v1);
- store.addObject(vp);
-
- ProcessorPlan plan = helpGetPlan("exec v1.vp()", new FakeMetadataFacade(store)); //$NON-NLS-1$
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(2) })
- };
- helpProcess(plan, new FakeDataManager(), expected);
- }
-
- @Test public void testCase4531() {
- String sql = "select intkey, intnum from (select intnum as intkey, 1 as intnum from bqt1.smalla union all select intkey, intnum from bqt1.smalla union all select intkey, intnum from bqt2.smalla) x"; //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.exampleBQTCached(), capFinder);
-
- // Run query
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(1) }),
- };
-
- // Construct data manager with data
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData("SELECT g_0.intkey, g_0.intnum FROM bqt2.smalla AS g_0", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1), new Integer(1) })});
- dataManager.addData("SELECT g_1.intnum AS c_0, 1 AS c_1 FROM bqt1.smalla AS g_1 UNION ALL SELECT g_0.IntKey AS c_0, g_0.IntNum AS c_1 FROM bqt1.smalla AS g_0", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1), new Integer(1) }),
- Arrays.asList(new Object[] { new Integer(1), new Integer(1) })});
- helpProcess(plan, dataManager, expected);
- }
-
- private void sampleDataBQT2a(FakeDataManager dataMgr) throws Exception {
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- String[] groups = new String[] {"bqt1.smalla", "bqt2.smalla", "bqt3.smalla" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- for(int groupIndex=0; groupIndex<groups.length; groupIndex++) {
- String groupName = groups[groupIndex];
-
- List[] tuples = new List[3];
- for(int row=0; row<tuples.length; row++) {
- tuples[row] = new ArrayList(17);
- tuples[row].add(new Integer(row)); //IntKey
- tuples[row].add(String.valueOf(row)); //StringKey
- tuples[row].add(new Integer(row)); //IntNum
- tuples[row].add(String.valueOf(row)); //StringNum
- for(int col=0; col<10; col++) { //FloatNum, LongNum, DoubleNum, ByteNum, DateValue, TimeValue, TimestampValue, BooleanValue, CharValue, ShortValue
- tuples[row].add(null);
- }
- tuples[row].add(new BigInteger(String.valueOf(row))); //BigIntegerValue
- tuples[row].add(new BigDecimal(row)); //BigDecimalValue
- tuples[row].add(null); //ObjectValue
- }
- dataMgr.registerTuples(metadata, groupName, tuples);
- }
- }
-
- @Test public void testDefect15355() throws Exception {
-
- String sql = "SELECT e1, e1 FROM pm1.g1 " //$NON-NLS-1$
- +"UNION ALL " //$NON-NLS-1$
- +"SELECT e1, (SELECT e1 FROM pm2.g1 WHERE pm2.g1.e2 = pm1.g2.e2) FROM pm1.g2"; //$NON-NLS-1$
-
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "c", "c" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "a", "e" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "d", null }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testDefect15355b() throws Exception {
-
- String sql = "SELECT StringKey, BigIntegerValue FROM BQT1.SmallA " //$NON-NLS-1$
- +"UNION ALL " //$NON-NLS-1$
- +"SELECT StringKey, (SELECT BigIntegerValue FROM BQT3.SmallA WHERE BQT3.SmallA.BigIntegerValue = BQT2.SmallA.StringNum) FROM BQT2.SmallA"; //$NON-NLS-1$
-
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "0", new BigInteger("0") }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "1", new BigInteger("1") }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "2", new BigInteger("2") }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "0", new BigInteger("0") }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "1", new BigInteger("1") }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "2", new BigInteger("2") }), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testDefect15355c() throws Exception {
-
- String sql = "SELECT StringKey, BigIntegerValue FROM VQT.Defect15355 WHERE StringKey = '0'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "0", new BigInteger("0") }), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testDefect15355d() throws Exception {
-
- String sql = "SELECT StringKey, BigIntegerValue FROM VQT.Defect15355a WHERE StringKey = '0'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "0", new BigInteger("0") }), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testDefect15355e() throws Exception {
-
- String sql = "SELECT BigIntegerValue, StringKey FROM VQT.Defect15355 WHERE StringKey = '0'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new BigInteger("0"), "0" }), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testDefect15355f() throws Exception {
-
- String sql = "SELECT BigIntegerValue FROM VQT.Defect15355 WHERE StringKey = '0'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testDefect15355f2() throws Exception {
-
- String sql = "SELECT BigIntegerValue FROM VQT.Defect15355 WHERE StringKey LIKE '%0' AND StringKey LIKE '0%'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testDefect15355g() throws Exception {
-
- String sql = "SELECT BigIntegerValue AS a, BigIntegerValue AS b FROM VQT.Defect15355 WHERE StringKey = '0'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new BigInteger("0"), new BigInteger("0") }), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testDefect15355h() throws Exception {
-
- String sql = "SELECT BigIntegerValue FROM VQT.Defect15355 WHERE BigIntegerValue = '0'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testDefect15355i() throws Exception {
-
- String sql = "SELECT BigIntegerValue FROM VQT.Defect15355b WHERE BigIntegerValue = '0'"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2a(dataManager);
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
- capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
-
- QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- /**
- * The inner most A.e1 was mistakenly getting transformed into pm1.g3.e1
- */
- @Test public void testInnerCorrelatedReference() throws Exception {
-
- String sql = "SELECT DISTINCT A.e1 FROM pm1.g3 AS A WHERE (A.e1 IN (SELECT A.e1 FROM pm1.g3))"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- };
-
- // Construct data manager with data
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData("SELECT DISTINCT g_0.e1 FROM pm1.g3 AS g_0 WHERE g_0.e1 IN (SELECT g_0.e1 FROM pm1.g3 AS g_1)", expected); //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- // Plan query
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
- caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- // Run query
- helpProcess(plan, dataManager, expected);
-
- }
-
- @Test public void testCase5413() throws Exception {
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- // Plan query
- String sql = "SELECT e1 FROM pm1.g2 WHERE LOOKUP('pm1.g1','e1', 'e2', 0) = e1";//$NON-NLS-1$
- QueryMetadataInterface metadata = FakeMetadataFactory.example1Cached();
- Command command = TestProcessor.helpParse(sql);
- CommandContext context = createCommandContext();
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder, context);
-
- // Run query
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a"}), //$NON-NLS-1$
- };
-
- FakeDataManager dataManager = new FakeDataManager();
- FakeDataStore.sampleData2(dataManager);
-
- helpProcess(plan, context, dataManager, expected);
- }
-
- @Test public void testRaiseNullWithSelectInto() {
- String sql = "select pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 into pm1.g2 from pm1.g1 where (1=0)"; //$NON-NLS-1$
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder());
-
- TestOptimizer.checkNodeTypes(plan, new int[] {
- 0, // Access
- 0, // DependentAccess
- 0, // DependentSelect
- 0, // DependentProject
- 0, // DupRemove
- 0, // Grouping
- 0, // NestedLoopJoinStrategy
- 0, // MergeJoinStrategy
- 1, // Null
- 0, // PlanExecution
- 1, // Project
- 0, // Select
- 0, // Sort
- 0 // UnionAll
- });
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0)}),
- };
-
- helpProcess(plan, new FakeDataManager(), expected);
-
- }
-
- /*
- * Test for Case6219
- */
- @Test public void testCase6219() {
- String sql = "SELECT e1 FROM pm1.g1, (SELECT 'ACT' AS StateCode,'A' AS StateAbbrv UNION ALL SELECT 'NSW' AS StateCode, 'N' AS StateAbbrv) AS StateNames_Abbrvs WHERE (pm1.g1.e1 = StateCode) AND ((StateNames_Abbrvs.StateAbbrv || pm1.g1.e1) = 'VVIC')"; //$NON-NLS-1$
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder());
-
- TestOptimizer.checkNodeTypes(plan, new int[] {
- 0, // Access
- 1, // DependentAccess
- 0, // DependentSelect
- 0, // DependentProject
- 0, // DupRemove
- 0, // Grouping
- 0, // NestedLoopJoinStrategy
- 1, // MergeJoinStrategy
- 0, // Null
- 0, // PlanExecution
- 3, // Project
- 0, // Select
- 0, // Sort
- 1 // UnionAll
- });
-
- List[] expected = new List[] {
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
-
- }
-
- @Test public void testSortWithLimit() {
- String sql = "select e1 from (select pm1.g1.e1, pm1.g1.e2 from pm1.g1 order by pm1.g1.e1, pm1.g1.e2 limit 1) x"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { null}),
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testSortWithLimit1() {
- String sql = "select c from (select pm1.g1.e1 a, pm1.g1.e2 b, pm1.g1.e3 c from pm1.g1 order by b limit 1) x"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { Boolean.FALSE}),
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- //note that the e1 column is not used in the source query
- assertEquals("SELECT pm1.g1.e3, pm1.g1.e2 FROM pm1.g1", manager.getQueries().iterator().next()); //$NON-NLS-1$
- }
-
- @Test public void testSortWithLimit2() {
- String sql = "select a from (select max(e2) a from pm1.g1 group by e2 order by a limit 1) x where a = 0"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) }),
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- /**
- * A more direct test of 1, where the nested order by is unrelated
- */
- @Test public void testSortWithLimit3() {
- String sql = "select c from (select pm1.g1.e3 c from pm1.g1 order by pm1.g1.e2 limit 1) x"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { Boolean.FALSE }),
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testSortWithLimit4() {
- String sql = "select c from (select pm1.g1.e1 a, pm1.g1.e2 b, pm1.g1.e3 c from pm1.g1 order by b limit 1) x"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_ORDERBY_UNRELATED, false);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, new DefaultCapabilitiesFinder(caps));
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { Boolean.FALSE }),
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- assertEquals("SELECT g_0.e3 AS c_0, g_0.e2 AS c_1 FROM pm1.g1 AS g_0 ORDER BY c_1", manager.getQueries().iterator().next()); //$NON-NLS-1$
- }
-
- @Test public void testCountWithHaving() {
- String sql = "select e1, count(*) from pm1.g1 group by e1 having count(*) > 1"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a" , new Integer(3)}), //$NON-NLS-1$
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testLimitZero() {
- String sql = "select e1 from pm1.g1 limit 0"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- TestOptimizer.checkNodeTypes(plan, TestRuleRaiseNull.FULLY_NULL);
-
- List[] expected = new List[] {
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testLimitZero1() {
- String sql = "select distinct vm1.g1.e1, y.e1 from vm1.g1 left outer join (select 1 x, e1 from vm1.g2 limit 0) y on vm1.g1.e1 = y.e1 where vm1.g1.e1 = 'a'"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- TestOptimizer.checkNodeTypes(plan, new int[] {
- 1, // Access
- 0, // DependentAccess
- 0, // DependentSelect
- 0, // DependentProject
- 1, // DupRemove
- 0, // Grouping
- 0, // NestedLoopJoinStrategy
- 0, // MergeJoinStrategy
- 0, // Null
- 0, // PlanExecution
- 1, // Project
- 0, // Select
- 0, // Sort
- 0 // UnionAll
- });
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", null }), //$NON-NLS-1$
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testLimitZero2() {
- String sql = "select vm1.g1.e1 from vm1.g1 union select e1 from pm1.g2 limit 0"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testLimitZero3() {
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.ROW_LIMIT, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- String sql = "select e1 from pm1.g2 limit 0"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, capFinder);
-
- List[] expected = new List[] {
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testUnionWithTypeConversion() {
- String sql = "select pm1.g1.e1, pm1.g1.e2 from pm1.g1 where e1 = 'b' union select e2, e1 from pm1.g2 where e1 = 'b' order by e1, e2"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "2", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList(new Object[] { "b", "2" }), //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- /**
- * Tests non-deterministic evaluation in the select clause.
- *
- * The evaluation of the rand function is delayed until processing time (which actually has predictable
- * values since the test initializes the command context with the same seed)
- *
- * If this function were deterministic, it would be evaluated during rewrite to a single value.
- */
- @Test public void testNonDeterministicEvaluation() throws Exception {
- String sql = "select e1, convert(rand()*1000, integer) as x from pm1.g1 where e1 = 'a'"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(240) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(637) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(550) }), //$NON-NLS-1$
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- /**
- * here the rand function is deterministic and should yield a single value
- */
- @Test public void testDeterministicEvaluation() throws Exception {
- String sql = "select e1, convert(rand(0)*1000, integer) as x from pm1.g1 where e1 = 'a'"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "a", new Integer(730) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(730) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "a", new Integer(730) }), //$NON-NLS-1$
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testEmptyAggregate() throws Exception {
- String sql = "select count(e1) from pm1.g1 where 1 = 0"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0) })
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testNullAggregate() throws Exception {
- String sql = "select count(*), count(e1), sum(convert(e1, integer)) from pm1.g1 where e1 is null"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), new Integer(0), null })
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- /**
- * here the presence of a group by causes no rows to be returned
- */
- @Test public void testNullAggregate1() throws Exception {
- String sql = "select e1 from pm1.g1 where 1 = 0 group by e1"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testReferenceReplacementWithExpression() throws Exception {
- String sql = "select e1, e2 from (select e1, convert(e2, string) e2 from pm1.g1) x where exists (select e3 from pm1.g2 where x.e2 = e1)"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {};
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- /**
- * Here a merge join will be used since there is at least one equi join predicate.
- * TODO: this can be optimized further
- */
- @Test public void testCase6193_1() throws Exception {
- // Create query
- String sql = "select a.INTKEY, b.intkey from bqt1.smalla a LEFT OUTER JOIN bqt2.SMALLA b on a.intkey=b.intkey and a.intkey=5 where a.intkey <10 "; //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- capFinder.addCapabilities("BQT2", caps);
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0), null }),
- Arrays.asList(new Object[] { new Integer(1), null }),
- Arrays.asList(new Object[] { new Integer(2), null }),
- Arrays.asList(new Object[] { new Integer(3), null }),
- Arrays.asList(new Object[] { new Integer(4), null }),
- Arrays.asList(new Object[] { new Integer(5), new Integer(5) }),
- Arrays.asList(new Object[] { new Integer(6), null }),
- Arrays.asList(new Object[] { new Integer(7), null }),
- Arrays.asList(new Object[] { new Integer(8), null }),
- Arrays.asList(new Object[] { new Integer(9), null })
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleDataBQT2(dataManager);
-
- // Plan query
- ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(),
- new String[] {"SELECT b.intkey FROM bqt2.SMALLA AS b", "SELECT a.intkey FROM bqt1.smalla AS a"}, new DefaultCapabilitiesFinder(), ComparisonMode.CORRECTED_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
-
- TestOptimizer.checkNodeTypes(plan, new int[] {
- 2, // Access
- 0, // DependentAccess
- 0, // DependentSelect
- 0, // DependentProject
- 0, // DupRemove
- 0, // Grouping
- 0, // NestedLoopJoinStrategy
- 1, // MergeJoinStrategy
- 0, // Null
- 0, // PlanExecution
- 1, // Project
- 1, // Select
- 0, // Sort
- 0 // UnionAll
- });
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Here a merge join will be used since there is at least one equi join predicate.
- */
- @Test public void testCase6193_2() throws Exception {
- // Create query
- String sql = "select a.e2, b.e2 from pm1.g1 a LEFT OUTER JOIN pm1.g2 b on a.e4=b.e4 and (a.e2+b.e2)=4 order by a.e2"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(0), null }),
- Arrays.asList(new Object[] { new Integer(0), null }),
- Arrays.asList(new Object[] { new Integer(1), null }),
- Arrays.asList(new Object[] { new Integer(1), null }),
- Arrays.asList(new Object[] { new Integer(2), new Integer(2) }),
- Arrays.asList(new Object[] { new Integer(3), null }),
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
- new String[] {"SELECT a.e4, a.e2 FROM pm1.g1 AS a", "SELECT b.e4, b.e2 FROM pm1.g2 AS b"}, new DefaultCapabilitiesFinder(), ComparisonMode.CORRECTED_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
-
- TestOptimizer.checkNodeTypes(plan, new int[] {
- 2, // Access
- 0, // DependentAccess
- 0, // DependentSelect
- 0, // DependentProject
- 0, // DupRemove
- 0, // Grouping
- 0, // NestedLoopJoinStrategy
- 1, // MergeJoinStrategy
- 0, // Null
- 0, // PlanExecution
- 1, // Project
- 0, // Select
- 1, // Sort
- 0 // UnionAll
- });
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * Here a merge join will be used since there is at least one equi join predicate.
- * The inner merge join is also a dependent join
- */
- @Test public void testCase6193_3() throws Exception {
- // Create query
- String sql = "select a.x, b.y from (select 4 x union select 1) a LEFT OUTER JOIN (select (a.e2 + b.e2) y from pm1.g1 a LEFT OUTER JOIN pm1.g2 b on a.e4=b.e4) b on (a.x = b.y)"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1), null }),
- Arrays.asList(new Object[] { new Integer(4), new Integer(4) }),
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- // Plan query
- ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
- new String[] {"SELECT a.e4, a.e2 FROM pm1.g1 AS a", "SELECT b.e4, b.e2 FROM pm1.g2 AS b"}, new DefaultCapabilitiesFinder(), ComparisonMode.CORRECTED_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
-
- TestOptimizer.checkNodeTypes(plan, new int[] {
- 2, // Access
- 0, // DependentAccess
- 0, // DependentSelect
- 0, // DependentProject
- 0, // DupRemove
- 0, // Grouping
- 0, // NestedLoopJoinStrategy
- 2, // MergeJoinStrategy
- 0, // Null
- 0, // PlanExecution
- 4, // Project
- 0, // Select
- 0, // Sort
- 1 // UnionAll
- });
-
- TestOptimizer.checkDependentJoinCount(plan, 1);
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- /**
- * This is a control test. It should work regardless of whether the reference is aliased
- * since accessnodes are now fully positional
- */
- @Test public void testPushdownNonAliasedSelectLiteral() throws Exception {
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- List[] expected = new List[] {
- Arrays.asList("a", "b"), //$NON-NLS-1$ //$NON-NLS-2$
- Arrays.asList("a", "c") //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- HardcodedDataManager manager = new HardcodedDataManager();
- manager.addData("SELECT 'a', pm1.g1.e1 FROM pm1.g1", expected); //$NON-NLS-1$
-
- processPreparedStatement("select ?, e1 from pm1.g1", expected, manager, capFinder,
- metadata, Arrays.asList("a"));
- }
-
- @Test public void testCase6486() {
- // Create query
- String sql = "select pm2.g1.e1 from pm1.g2, pm2.g1 where pm1.g2.e1=pm2.g1.e1 group by pm2.g1.e1"; //$NON-NLS-1$
-
- // Create expected results
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "d"}) //$NON-NLS-1$
- };
-
- // Construct data manager with data
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- // Plan query
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- // Run query
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testNonPushedOffset() throws Exception {
- String sql = "SELECT e1 FROM pm1.g1 LIMIT 1, 5"; //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.ROW_LIMIT, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b"}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "c"}), //$NON-NLS-1$
- };
-
- FakeDataManager dataManager = new FakeDataManager();
- sampleData2(dataManager);
-
- ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(), null, capFinder, new String[] {"SELECT pm1.g1.e1 FROM pm1.g1 LIMIT (5 + 1)"}, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testNonCorrelatedSubQueryExecution() throws Exception {
- String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
-
- // Construct data manager with data
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.setBlockOnce(true);
- dataManager.addData("SELECT pm1.g1.e2, pm1.g1.e1 FROM pm1.g1", new List[] { //$NON-NLS-1$
- Arrays.asList(Integer.valueOf(1), "a"), //$NON-NLS-1$
- Arrays.asList(Integer.valueOf(2), "b") //$NON-NLS-1$
- });
- dataManager.addData("SELECT pm2.g1.e2 FROM pm2.g1", new List[] { //$NON-NLS-1$
- Arrays.asList(Integer.valueOf(2))
- });
-
- ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
- };
-
- doProcess(plan, dataManager, expected, createCommandContext());
-
- //we expect 2 queries, 1 for the outer and 1 for the subquery
- assertEquals(2, dataManager.getCommandHistory().size());
- }
-
- /**
- * Test a query that uses ambiguous alias names in the top level query and
- * its sub-query and uses columns belonging to the alias as a parameter to a
- * function.
- * <p>
- * For example, <code>SELECT CONVERT(A.e2, biginteger) AS e2 FROM (SELECT
- * CONVERT(e2, long) AS e2 FROM pm1.g1 AS A) AS A</code>
- * <p>
- * The test is to ensure that A.e2 from the top level is not confused with
- * e2 in the second level.
- * <p>
- * Related Defects: JBEDSP-1137
- */
- @Test public void testAliasReuseInFunctionInSubQuery() throws Exception {
- // Create query
- String sql = "SELECT CONVERT(A.e2, biginteger) AS e2 FROM (" + //$NON-NLS-1$
- " SELECT CONVERT(e2, long) AS e2 FROM pm1.g1 AS A WHERE e1 = 'a'" + //$NON-NLS-1$
- ") AS A"; //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new BigInteger("3") }), //$NON-NLS-1$
- Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
- };
-
- FakeDataManager manager = new FakeDataManager();
- sampleData1(manager);
- helpProcess(plan, manager, expected);
- }
-
- @Test public void testImplicitAggregateWithInlineView() {
- String sql = "SELECT * FROM (SELECT b.count, enterprise_id FROM (SELECT COUNT(*), 2 AS enterprise_id FROM (SELECT 'A Name' AS Name, 1 AS enterprise_id) c ) b ) a WHERE enterprise_id = 1"; //$NON-NLS-1$
-
- List[] expected = new List[] {};
-
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedNestedTable() {
- String sql = "select y.e2, x.e1, x.e2 from (select * from pm1.g1) y, table (select * from pm1.g3 where e2 = y.e2) x"; //$NON-NLS-1$
-
- List[] expected = new List[] {
- Arrays.asList(0, "a", 0),
- Arrays.asList(0, "a", 0),
- Arrays.asList(1, null, 1),
- Arrays.asList(1, "c", 1),
- Arrays.asList(3, "a", 3),
- Arrays.asList(1, null, 1),
- Arrays.asList(1, "c", 1),
- Arrays.asList(2, "b", 2),
- Arrays.asList(0, "a", 0),
- Arrays.asList(0, "a", 0),
- };
-
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedNestedTable1() {
- String sql = "select y.e2, z.e2, x.e1, x.e2 from (select * from pm1.g1 order by e2 desc limit 2) y inner join pm1.g2 z on y.e1 = z.e1, table (select * from pm1.g3 where e2 = y.e2 + z.e2) x"; //$NON-NLS-1$
-
- List[] expected = new List[] {
- Arrays.asList(3, 0, "a", 3),
- Arrays.asList(3, 0, "a", 3),
- };
-
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedNestedTable2() {
- String sql = "select y.e1, x.e1 from (select distinct e1 from pm1.g1 where e1 is not null) y, table (call pm1.sq3b(\"in\" = e1, in3 = 'something')) x"; //$NON-NLS-1$
-
- List[] expected = new List[] {
- Arrays.asList("a", "a"),
- Arrays.asList("a", "a"),
- Arrays.asList("a", "a"),
- Arrays.asList("b", "b"),
- Arrays.asList("c", "c"),
- };
-
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedNestedTable3() {
- String sql = "select y.e1, x.e1 from (select * from pm1.g1) y left outer join table (call pm1.sq3b(\"in\" = e2, in3 = 'something')) x on (1=1)"; //$NON-NLS-1$
-
- List[] expected = new List[] {
- Arrays.asList("a", null),
- Arrays.asList(null, null),
- Arrays.asList("a", null),
- Arrays.asList("c", null),
- Arrays.asList("b", null),
- Arrays.asList("a", null),
- };
-
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testCorrelatedNestedTable4() {
- String sql = "select y.e1, y.e2, z.e2 from (select * from pm1.g1) y inner join table (select * from pm1.g3 where e2 = y.e2) x left outer join (select null as e1, e2 from pm1.g2) z on (x.e1 = z.e1) on (x.e1 = y.e1)"; //$NON-NLS-1$
-
- List[] expected = new List[] {
- Arrays.asList("a", 0, null),
- Arrays.asList("a", 0, null),
- Arrays.asList("a", 3, null),
- Arrays.asList("c", 1, null),
- Arrays.asList("b", 2, null),
- Arrays.asList("a", 0, null),
- Arrays.asList("a", 0, null),
- };
-
- FakeDataManager dataManager = new FakeDataManager();
- sampleData1(dataManager);
-
- ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
-
- helpProcess(plan, dataManager, expected);
- }
-
- @Test public void testUncorrelatedScalarSubqueryPushdown() throws Exception {
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- FakeMetadataFacade metadata = example1();
-
- BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, false);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- ProcessorPlan plan = helpPlan("select pm1.g1.e1 from pm1.g1 where e1 < (select max(vm1.g1.e1) from vm1.g1)", metadata, //$NON-NLS-1$
- null, capFinder,
- new String[] { "SELECT g_0.e1 FROM pm1.g1 AS g_0 WHERE g_0.e1 < (SELECT MAX(g_1.e1) FROM pm1.g1 AS g_1)" }, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
- checkNodeTypes(plan, FULL_PUSHDOWN);
-
- HardcodedDataManager hdm = new HardcodedDataManager();
- hdm.addData("SELECT MAX(g_0.e1) FROM pm1.g1 AS g_0", new List[] {Arrays.asList("c")});
- hdm.addData("SELECT g_0.e1 FROM pm1.g1 AS g_0 WHERE g_0.e1 < 'c'", new List[] {Arrays.asList("a")});
-
- List[] expected = new List[] {
- Arrays.asList("a"),
- };
-
- helpProcess(plan, hdm, expected);
- }
-
- private static final boolean DEBUG = false;
-}
Copied: tags/teiid-7.1.0.Final/engine/src/test/java/org/teiid/query/processor/TestProcessor.java (from rev 2472, trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java)
===================================================================
--- tags/teiid-7.1.0.Final/engine/src/test/java/org/teiid/query/processor/TestProcessor.java (rev 0)
+++ tags/teiid-7.1.0.Final/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,7530 @@
+/*
+ * 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.processor;
+
+import static org.junit.Assert.*;
+import static org.teiid.query.optimizer.TestOptimizer.*;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.junit.Test;
+import org.teiid.client.metadata.ParameterInfo;
+import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.BufferManagerFactory;
+import org.teiid.common.buffer.TupleBuffer;
+import org.teiid.common.buffer.TupleSource;
+import org.teiid.common.buffer.impl.BufferManagerImpl;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidException;
+import org.teiid.core.TeiidProcessingException;
+import org.teiid.core.TeiidRuntimeException;
+import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.types.XMLType;
+import org.teiid.dqp.internal.process.SimpleQueryProcessorFactory;
+import org.teiid.query.analysis.AnalysisRecord;
+import org.teiid.query.function.FunctionLibrary;
+import org.teiid.query.function.FunctionTree;
+import org.teiid.query.function.SystemFunctionManager;
+import org.teiid.query.function.UDFSource;
+import org.teiid.query.mapping.relational.QueryNode;
+import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.metadata.TempMetadataAdapter;
+import org.teiid.query.metadata.TempMetadataStore;
+import org.teiid.query.optimizer.FakeFunctionMetadataSource;
+import org.teiid.query.optimizer.QueryOptimizer;
+import org.teiid.query.optimizer.TestOptimizer;
+import org.teiid.query.optimizer.TestRuleRaiseNull;
+import org.teiid.query.optimizer.TestOptimizer.ComparisonMode;
+import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
+import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
+import org.teiid.query.optimizer.capabilities.DefaultCapabilitiesFinder;
+import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
+import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
+import org.teiid.query.optimizer.relational.rules.RuleChooseDependent;
+import org.teiid.query.parser.QueryParser;
+import org.teiid.query.processor.relational.JoinNode;
+import org.teiid.query.processor.relational.RelationalNode;
+import org.teiid.query.processor.relational.RelationalPlan;
+import org.teiid.query.resolver.QueryResolver;
+import org.teiid.query.resolver.util.BindVariableVisitor;
+import org.teiid.query.rewriter.QueryRewriter;
+import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.lang.SPParameter;
+import org.teiid.query.sql.symbol.ElementSymbol;
+import org.teiid.query.sql.symbol.Reference;
+import org.teiid.query.sql.util.VariableContext;
+import org.teiid.query.sql.visitor.ReferenceCollectorVisitor;
+import org.teiid.query.tempdata.TempTableDataManager;
+import org.teiid.query.tempdata.TempTableStore;
+import org.teiid.query.unittest.FakeMetadataFacade;
+import org.teiid.query.unittest.FakeMetadataFactory;
+import org.teiid.query.unittest.FakeMetadataObject;
+import org.teiid.query.unittest.FakeMetadataStore;
+import org.teiid.query.unittest.TimestampUtil;
+import org.teiid.query.util.CommandContext;
+import org.teiid.query.validator.Validator;
+import org.teiid.query.validator.ValidatorReport;
+
+@SuppressWarnings({"nls", "unchecked"})
+public class TestProcessor {
+
+ // ################################## TEST HELPERS ################################
+
+ static Command helpParse(String sql) {
+ // parse
+ try {
+ return QueryParser.getQueryParser().parseCommand(sql);
+ } catch(TeiidException e) {
+ throw new TeiidRuntimeException(e);
+ }
+ }
+
+ public static ProcessorPlan helpGetPlan(String sql, QueryMetadataInterface metadata) {
+ return helpGetPlan(sql, metadata, null);
+ }
+
+ public static ProcessorPlan helpGetPlan(String sql, QueryMetadataInterface metadata, String[] bindings) {
+ if(DEBUG) System.out.println("\n####################################\n" + sql); //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+
+ // attach bindings
+ if(bindings != null) {
+ try {
+ BindVariableVisitor.bindReferences(command, Arrays.asList(bindings), metadata);
+ } catch(Throwable e) {
+ throw new TeiidRuntimeException(e);
+ }
+ }
+
+ ProcessorPlan process = helpGetPlan(command, metadata);
+
+ return process;
+ }
+
+ static ProcessorPlan helpGetPlan(Command command, QueryMetadataInterface metadata) {
+ return helpGetPlan(command, metadata, new DefaultCapabilitiesFinder());
+ }
+
+ static ProcessorPlan helpGetPlan(Command command, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) {
+ CommandContext context = createCommandContext();
+ try {
+ return helpGetPlan(command, metadata, capFinder, context);
+ } catch (TeiidException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ static ProcessorPlan helpGetPlan(Command command, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, CommandContext context) throws TeiidException {
+ if(DEBUG) System.out.println("\n####################################\n" + command); //$NON-NLS-1$
+ AnalysisRecord analysisRecord = new AnalysisRecord(false, DEBUG);
+ if (!(metadata instanceof TempMetadataAdapter)) {
+ metadata = new TempMetadataAdapter(metadata, new TempMetadataStore());
+ }
+ context.setMetadata(metadata);
+ try {
+ QueryResolver.resolveCommand(command, metadata);
+
+ ValidatorReport repo = Validator.validate(command, metadata);
+ Collection failures = new ArrayList();
+ repo.collectInvalidObjects(failures);
+ if (failures.size() > 0){
+ fail("Exception during validation (" + repo); //$NON-NLS-1$
+ }
+ command = QueryRewriter.rewrite(command, metadata, context);
+ ProcessorPlan process = QueryOptimizer.optimizePlan(command, metadata, null, capFinder, analysisRecord, context);
+ if(DEBUG) System.out.println("\n" + process); //$NON-NLS-1$
+ //per defect 10022, clone this plan before processing, just to make sure
+ //a cloned plan with correlated subquery references (or any cloned plan) can be processed
+ process = process.clone();
+
+ assertNotNull("Output elements of process plan are null", process.getOutputElements()); //$NON-NLS-1$
+
+ return process;
+ } finally {
+ if(DEBUG) {
+ System.out.println(analysisRecord.getDebugLog());
+ }
+ }
+ }
+
+ public static void helpProcess(ProcessorPlan plan, ProcessorDataManager dataManager, List[] expectedResults) {
+ CommandContext context = createCommandContext();
+ try {
+ helpProcess(plan, context, dataManager, expectedResults);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void helpProcess(ProcessorPlan plan, CommandContext context, ProcessorDataManager dataManager, List[] expectedResults) throws Exception {
+ ProcessorPlan clonePlan = plan.clone();
+
+ // Process twice to test reset and clone
+ doProcess(plan, dataManager, expectedResults, context);
+ plan.reset();
+ doProcess(plan, dataManager, expectedResults, context);
+
+ // Execute cloned of original plan
+ doProcess(clonePlan, dataManager, expectedResults, context);
+ }
+
+ private void helpProcessException(ProcessorPlan plan, ProcessorDataManager dataManager) {
+ helpProcessException(plan, dataManager, null);
+ }
+
+ private void helpProcessException(ProcessorPlan plan, ProcessorDataManager dataManager, String expectedErrorMessage) {
+ TupleBuffer tsId = null;
+ BufferManager bufferMgr = null;
+ try {
+ bufferMgr = BufferManagerFactory.getStandaloneBufferManager();
+ CommandContext context = new CommandContext("0", "test", null, null, 1); //$NON-NLS-1$ //$NON-NLS-2$
+ QueryProcessor processor = new QueryProcessor(plan, context, bufferMgr, dataManager);
+ processor.setNonBlocking(true);
+ BatchCollector collector = processor.createBatchCollector();
+ tsId = collector.collectTuples();
+ fail("Expected error during processing, but got none."); //$NON-NLS-1$
+ } catch(TeiidException e) {
+ // ignore - this is expected
+ if(expectedErrorMessage != null) {
+ assertEquals(expectedErrorMessage, e.getMessage());
+ }
+ } finally {
+ if (tsId != null) {
+ tsId.remove();
+ }
+ }
+ }
+
+ public static void doProcess(ProcessorPlan plan, ProcessorDataManager dataManager, List[] expectedResults, CommandContext context) throws Exception {
+ BufferManagerImpl bufferMgr = BufferManagerFactory.createBufferManager();
+ bufferMgr.setProcessorBatchSize(context.getProcessorBatchSize());
+ bufferMgr.setConnectorBatchSize(context.getProcessorBatchSize());
+ context.getNextRand(0);
+ if (context.getTempTableStore() == null) {
+ context.setTempTableStore(new TempTableStore(context.getConnectionID()));
+ }
+ if (context.getGlobalTableStore() == null) {
+ context.setGlobalTableStore(new TempTableStore("SYSTEM"));
+ }
+ if (!(dataManager instanceof TempTableDataManager)) {
+ dataManager = new TempTableDataManager(dataManager, bufferMgr);
+ }
+ if (context.getQueryProcessorFactory() == null) {
+ context.setQueryProcessorFactory(new SimpleQueryProcessorFactory(bufferMgr, dataManager, new DefaultCapabilitiesFinder(), null, context.getMetadata()));
+ }
+ TupleBuffer id = null;
+ try {
+ QueryProcessor processor = new QueryProcessor(plan, context, bufferMgr, dataManager);
+ processor.setNonBlocking(true);
+ BatchCollector collector = processor.createBatchCollector();
+ id = collector.collectTuples();
+ if ( expectedResults != null ) {
+ examineResults(expectedResults, bufferMgr, id);
+ }
+ } finally {
+ if (id != null) {
+ id.remove();
+ }
+ }
+ }
+
+ /**
+ * @param expectedResults
+ * @param bufferMgr
+ * @param tsID
+ * @throws TeiidComponentException
+ * @throws TeiidProcessingException
+ * @since 4.3
+ */
+ static void examineResults(List[] expectedResults,BufferManager bufferMgr,TupleBuffer tsID)
+ throws TeiidComponentException,SQLException, TeiidProcessingException {
+
+ // Create QueryResults from TupleSource
+ TupleSource ts = tsID.createIndexedTupleSource();
+ int count = tsID.getRowCount();
+
+ if(DEBUG) {
+ System.out.println("\nResults:\n" + tsID.getSchema()); //$NON-NLS-1$
+ TupleSource ts2 = tsID.createIndexedTupleSource();
+ for(int j=0; j<count; j++) {
+ System.out.println("" + j + ": " + ts2.nextTuple()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ ts2.closeSource();
+ }
+
+ // Compare actual to expected row count
+ assertEquals("Did not get expected row count: ", expectedResults.length, count); //$NON-NLS-1$
+
+ // Walk results and compare
+ for(int i=0; i<count; i++) {
+ List record = ts.nextTuple();
+
+ //handle xml
+ if(record.size() == 1){
+ Object cellValue = record.get(0);
+ if(cellValue instanceof XMLType){
+ XMLType id = (XMLType)cellValue;
+ String actualDoc = id.getString();
+ if (expectedResults[i].size() == 1) {
+ compareDocuments((String)expectedResults[i].get(0), actualDoc);
+ continue;
+ }
+ }
+ }
+
+ assertEquals("Row " + i + " does not match expected: ", expectedResults[i], record); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ ts.closeSource();
+ }
+
+ public static void compareDocuments(String expectedDoc, String actualDoc) {
+ StringTokenizer tokens1 = new StringTokenizer(expectedDoc, "\r\n"); //$NON-NLS-1$
+ StringTokenizer tokens2 = new StringTokenizer(actualDoc, "\r\n");//$NON-NLS-1$
+ while(tokens1.hasMoreTokens()){
+ String token1 = tokens1.nextToken().trim();
+ if(!tokens2.hasMoreTokens()){
+ fail("XML doc mismatch: expected=" + token1 + "\nactual=none");//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ String token2 = tokens2.nextToken().trim();
+ assertEquals("XML doc mismatch: ", token1, token2); //$NON-NLS-1$
+ }
+ if(tokens2.hasMoreTokens()){
+ fail("XML doc mismatch: expected=none\nactual=" + tokens2.nextToken().trim());//$NON-NLS-1$
+ }
+ }
+
+ public static CommandContext createCommandContext() {
+ Properties props = new Properties();
+ props.setProperty("soap_host", "my.host.com"); //$NON-NLS-1$ //$NON-NLS-2$
+ props.setProperty("soap_port", "12345"); //$NON-NLS-1$ //$NON-NLS-2$
+ CommandContext context = new CommandContext("0", "test", "user", null, "myvdb", 1, props, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ context.setProcessorBatchSize(BufferManager.DEFAULT_PROCESSOR_BATCH_SIZE);
+ context.setConnectorBatchSize(BufferManager.DEFAULT_CONNECTOR_BATCH_SIZE);
+ context.setBufferManager(BufferManagerFactory.getStandaloneBufferManager());
+ return context;
+ }
+
+ public static void sampleData1(FakeDataManager dataMgr) {
+ try {
+ FakeDataStore.sampleData1(dataMgr);
+ } catch(Throwable e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void sampleData2(FakeDataManager dataMgr) {
+ try {
+ FakeDataStore.sampleData2(dataMgr);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void sampleData2a(FakeDataManager dataMgr) {
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ try {
+ // Group pm1.g1
+ FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
+ List elementIDs = metadata.getElementIDsInGroupID(groupID);
+ List elementSymbols = FakeDataStore.createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ } );
+
+ // Group pm2.g1
+ groupID = (FakeMetadataObject) metadata.getGroupID("pm2.g1"); //$NON-NLS-1$
+ elementIDs = metadata.getElementIDsInGroupID(groupID);
+ elementSymbols = FakeDataStore.createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList(new Object[] { "b", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(7), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "d", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "e", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ } );
+
+ // Group pm4.g1
+ groupID = (FakeMetadataObject) metadata.getGroupID("pm4.g1"); //$NON-NLS-1$
+ elementIDs = metadata.getElementIDsInGroupID(groupID);
+ elementSymbols = FakeDataStore.createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList(new Object[] { "aa", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "bb", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "cc", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ } );
+
+ } catch(TeiidException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void sampleData2b(FakeDataManager dataMgr) {
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ try {
+ // Group pm1.g1
+ FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
+ List elementIDs = metadata.getElementIDsInGroupID(groupID);
+ List elementSymbols = FakeDataStore.createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList(new Object[] { "aa ", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "bb ", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "cc ", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ } );
+
+ // Group pm2.g1
+ groupID = (FakeMetadataObject) metadata.getGroupID("pm2.g1"); //$NON-NLS-1$
+ elementIDs = metadata.getElementIDsInGroupID(groupID);
+ elementSymbols = FakeDataStore.createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList(new Object[] { "b", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "d", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "e", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ } );
+
+ // Group pm4.g1
+ groupID = (FakeMetadataObject) metadata.getGroupID("pm4.g1"); //$NON-NLS-1$
+ elementIDs = metadata.getElementIDsInGroupID(groupID);
+ elementSymbols = FakeDataStore.createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList(new Object[] { "aa ", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "bb ", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "cc ", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ } );
+
+
+ } catch(TeiidException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void sampleData3(FakeDataManager dataMgr) {
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ try {
+ // Group pm1.g1
+ FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
+ List elementSymbols = new ArrayList(1);
+ ElementSymbol count = new ElementSymbol("Count"); //$NON-NLS-1$
+ count.setType(Integer.class);
+ elementSymbols.add(count);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList(new Object[] { new Integer(1) }),
+ } );
+ }catch(TeiidException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void sampleDataStringTimestamps(FakeDataManager dataMgr) {
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ try {
+ // Group pm1.g1
+ FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("pm1.g1"); //$NON-NLS-1$
+ List elementIDs = metadata.getElementIDsInGroupID(groupID);
+ List elementSymbols = FakeDataStore.createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+ new List[] {
+ Arrays.asList(new Object[] { "Jan 01 2004 12:00:00", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "Dec 31 2004 12:00:00", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "Aug 01 2004 12:00:00", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ } );
+
+
+ } catch(TeiidException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void sampleDataBQT1(FakeDataManager dataMgr) {
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ try {
+ // Group bqt1.smalla
+
+ List[] tuples = new List[20];
+ for(int i=0; i<tuples.length; i++) {
+ tuples[i] = new ArrayList(17);
+ tuples[i].add(new Integer(i));
+ for(int j=0; j<16; j++) {
+ tuples[i].add(null);
+ }
+ }
+
+ dataMgr.registerTuples(metadata, "bqt1.smalla", tuples); //$NON-NLS-1$
+
+ // Group bqt2.mediumb
+ tuples = new List[20];
+ for(int i=0; i<tuples.length; i++) {
+ tuples[i] = new ArrayList(17);
+ tuples[i].add(new Integer(i));
+ for(int j=0; j<16; j++) {
+ tuples[i].add(null);
+ }
+ }
+
+ dataMgr.registerTuples(metadata, "bqt2.mediumb", tuples); //$NON-NLS-1$
+ } catch(TeiidException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void sampleDataBQT2(FakeDataManager dataMgr) {
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ String[] groups = new String[] {"bqt1.smalla", "bqt2.smalla", "bqt3.smalla" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ try {
+ for(int i=0; i<groups.length; i++) {
+ String groupName = groups[i];
+
+ List[] tuples = new List[30];
+ for(int row=0; row<tuples.length; row++) {
+ tuples[row] = new ArrayList(17);
+ tuples[row].add(new Integer(row));
+ for(int col=0; col<16; col++) {
+ tuples[row].add(null);
+ }
+ }
+
+ dataMgr.registerTuples(metadata, groupName, tuples);
+ }
+
+ } catch(TeiidException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Just want to register two rows of all the integral types to test AVG
+ * @param dataMgr
+ * @since 4.2
+ */
+ private void sampleDataBQT_defect11682(FakeDataManager dataMgr) {
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ try {
+ List[] tuples = new List[2];
+ for(int i=1; i<=tuples.length; i++) {
+ int index=i-1;
+ tuples[index] = new ArrayList(17);
+ tuples[index].add(new Integer(i)); //IntKey
+ tuples[index].add(null);
+ tuples[index].add(new Integer(i));
+ tuples[index].add(null);
+ tuples[index].add(new Float(i));
+ tuples[index].add(new Long(i));
+ tuples[index].add(new Double(i));
+ tuples[index].add(new Byte((byte)i));
+ tuples[index].add(null);
+ tuples[index].add(null);
+ tuples[index].add(null);
+ tuples[index].add(null);
+ tuples[index].add(null);
+ tuples[index].add(new Short((short)i));
+ tuples[index].add(new BigInteger(i+"")); //$NON-NLS-1$
+ tuples[index].add(new BigDecimal(i+".0")); //$NON-NLS-1$
+ tuples[index].add(null);
+ }
+
+ dataMgr.registerTuples(metadata, "bqt1.smalla", tuples); //$NON-NLS-1$
+
+ } catch(TeiidException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void sampleDataBQTSmall(FakeDataManager dataMgr) {
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ try {
+ List[] tuples = new List[1];
+ for(int i=0; i<tuples.length; i++) {
+ tuples[i] = new ArrayList(17);
+ tuples[i].add(new Integer(i));
+ for(int j=0; j<16; j++) {
+ tuples[i].add(null);
+ }
+ }
+
+ dataMgr.registerTuples(metadata, "bqt1.smalla", tuples); //$NON-NLS-1$
+
+ } catch(TeiidException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private List createRowWithTimestamp(String tsStr) {
+ Timestamp ts = Timestamp.valueOf(tsStr);
+ return Arrays.asList(new Object[] {
+ new Integer(0), "a", new Integer(1), "a", //$NON-NLS-1$ //$NON-NLS-2$
+ null, null, null, null, null, null, ts, null, null, null, null, null, null
+ });
+ }
+
+ private void sampleDataBQT_case1566(FakeDataManager dataMgr) throws Exception {
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ dataMgr.registerTuples(metadata, "bqt1.smalla", new List[] { //$NON-NLS-1$
+ createRowWithTimestamp("2002-01-01 10:00:00"), //$NON-NLS-1$
+ createRowWithTimestamp("2002-01-01 14:00:00"), //$NON-NLS-1$
+ createRowWithTimestamp("2002-01-02 10:00:00"), //$NON-NLS-1$
+ createRowWithTimestamp("2002-01-02 14:00:00"), //$NON-NLS-1$
+ createRowWithTimestamp("2002-01-02 19:00:00.01"), //$NON-NLS-1$
+ } );
+ }
+
+ static List getProcResultSetSymbols(List params){
+ List result = new ArrayList();
+ Iterator iter = params.iterator();
+ while(iter.hasNext()){
+ SPParameter param = (SPParameter)iter.next();
+ if(param.getResultSetColumns() != null){
+ result.addAll(param.getResultSetColumns());
+ }
+ }
+ iter = params.iterator();
+ while(iter.hasNext()){
+ SPParameter param = (SPParameter)iter.next();
+ if(param.getParameterType() == ParameterInfo.INOUT || param.getParameterType() == ParameterInfo.RETURN_VALUE) {
+ result.add(param.getParameterSymbol());
+ }
+ }
+ return result;
+ }
+
+ @Test public void test1() {
+ // Create query
+ String sql = "SELECT pm1.g1.e1, e2, pm1.g1.e3 as a, e4 as b FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void test2() {
+ // Create query
+ String sql = "SELECT COUNT(*) FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(6) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void test3() {
+ // Create query
+ String sql = "SELECT COUNT(*), COUNT(e1), COUNT(distinct e1), COUNT(distinct e2), COUNT(distinct e3), COUNT(distinct e4) FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(6), new Integer(5), new Integer(3), new Integer(4), new Integer(2), new Integer(4) }),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** see also integer average defect 11682 */
+ @Test public void test4() {
+ // Create query
+ String sql = "SELECT MIN(e2), MAX(e2), SUM(e2), AVG(e2), SUM(distinct e2), AVG(distinct e2) FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0), new Integer(3), new Long(7), new Double(1.1666666666666667), new Long(6), new Double(1.5) }),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void test5() {
+ // Create query
+ String sql = "SELECT MIN(e4), MAX(e4), SUM(e4), AVG(e4), SUM(distinct e4), AVG(distinct e4) FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Double(0.0), new Double(7.0), new Double(12.0), new Double(2.4), new Double(10.0), new Double(2.5) }),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void test7() {
+ // Create query
+ String sql = "SELECT * FROM vm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void test8() {
+ // Create query
+ String sql = "SELECT * FROM vm1.g2 order by 1, 2, 3"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void test9() {
+ // Create query
+ String sql = "SELECT * FROM vm1.g4 order by e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "2" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "3" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void test10() {
+ // Create query
+ String sql = "SELECT e1 FROM vm1.g4 where e1 = 'a'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testBooleanComparisonGT() {
+ // Create query
+ String sql = "SELECT pm1.g1.e3 FROM pm1.g1 WHERE e3 > {b'false'}"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { Boolean.TRUE }),
+ Arrays.asList(new Object[] { Boolean.TRUE })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testBooleanComparisonGE() {
+ // Create query
+ String sql = "SELECT pm1.g1.e3 FROM pm1.g1 WHERE e3 >= {b'false'}"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ Arrays.asList(new Object[] { Boolean.TRUE }),
+ Arrays.asList(new Object[] { Boolean.TRUE }),
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ Arrays.asList(new Object[] { Boolean.FALSE })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testBooleanComparisonLT() {
+ // Create query
+ String sql = "SELECT pm1.g1.e3 FROM pm1.g1 WHERE e3 < {b'true'}"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ Arrays.asList(new Object[] { Boolean.FALSE })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testBooleanComparisonLE() {
+ // Create query
+ String sql = "SELECT pm1.g1.e3 FROM pm1.g1 WHERE e3 <= {b'true'}"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ Arrays.asList(new Object[] { Boolean.TRUE }),
+ Arrays.asList(new Object[] { Boolean.TRUE }),
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ Arrays.asList(new Object[] { Boolean.FALSE })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testConcatOperator() {
+ // Create query
+ String sql = "SELECT pm1.g1.e1 || e2 AS x FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "a3" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b2" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a0" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** Duplicates defect #4841: SELECT e1 a, e1 b FROM pm1.g1 order by a */
+ @Test public void testDefect4841_1() {
+ // Create query
+ String sql = "SELECT e1 a, e1 b FROM pm1.g1 order by a"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** Duplicates defect #4841: SELECT e1 a, e1 b FROM pm1.g1 order by a, b desc */
+ @Test public void testDefect4841_2() {
+ // Create query
+ String sql = "SELECT e1 a, e1 b FROM pm1.g1 order by a"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** Duplicates defect #5292: SELECT DISTINCT e1, e1 a FROM pm1.g1 */
+ @Test public void testDefect5292_1() {
+ // Create query
+ String sql = "SELECT DISTINCT e1, e1 a FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** Duplicates defect #5292: SELECT DISTINCT e1, e1 a FROM pm1.g1 ORDER BY a */
+ @Test public void testDefect5292_2() {
+ // Create query
+ String sql = "SELECT DISTINCT e1, e1 a FROM pm1.g1 ORDER BY a"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** Duplicates defect #5004: SELECT COUNT(*) FROM pm1.g1 WHERE e1='xxxx' */
+ @Test public void testDefect5004() {
+ // Create query
+ String sql = "SELECT COUNT(*) FROM pm1.g1 WHERE e1='xxxx'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Test to ensure that multiple empty batches are handled by the grouping node as well
+ */
+ @Test public void testDefect5004a() throws Exception {
+ // Create query
+ String sql = "SELECT COUNT(*) FROM pm1.g1 WHERE e1='xxxx'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ CommandContext context = createCommandContext();
+ context.setProcessorBatchSize(2);
+ context.setConnectorBatchSize(2);
+ context.setMetadata(FakeMetadataFactory.example1Cached());
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached(), new DefaultCapabilitiesFinder(), context);
+
+ // Run query
+ helpProcess(plan, context, dataManager, expected);
+ }
+
+ /** SELECT COUNT(e2), MIN(e2), MAX(e2), SUM(e2), AVG(e2) FROM pm1.g1 WHERE e2=-999999 */
+ @Test public void test13() {
+ // Create query
+ String sql = "SELECT COUNT(e2), MIN(e2), MAX(e2), SUM(e2), AVG(e2) FROM pm1.g1 WHERE e2=-999999"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] {new Integer(0), null, null, null, null})
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * This test uncovered a bug in the FakeDataManager; the element
+ * symbol in the atomic query criteria has a canonical name
+ * of "Y.e4", but the FakeDataManager sends a Map of ElementSymbols
+ * having the unaliased names. The first symbol cannot be found
+ * in the Map due to the implementation of Symbol.equals() being
+ * based entirely on the canonical name, which causes a NPE.
+ * (Alex says this wasn't previously a problem because aliased groups
+ * did not previously get pushed down to the source.)
+ */
+ @Test public void testCriteriaAliasedGroup() {
+ String sql = "select e1, e2 FROM pm2.g1 Y WHERE 2.0 = e4"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b", new Integer(0) }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT e1 FROM pm1.g1 WHERE 'abc' = 'xyz' */
+ @Test public void testCriteriaComparesUnequalConstants() {
+ // Create query
+ String sql = "SELECT e1 FROM pm1.g1 WHERE 'abc' = 'xyz'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 RIGHT OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1 */
+ @Test public void testRightOuterJoin1() {
+ // Create query
+ String sql = "SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 RIGHT OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { null, "d" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, "e" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 LEFT OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1 */
+ @Test public void testLeftOuterJoin1() {
+ // Create query
+ String sql = "SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 LEFT OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 FULL OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1 */
+ @Test public void testFullOuterJoin1() throws Exception {
+ // Create query
+ String sql = "SELECT pm1.g1.e1, pm2.g1.e1 FROM pm1.g1 FULL OUTER JOIN pm2.g1 ON pm1.g1.e1=pm2.g1.e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, "d" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, "e" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testFullOuterJoin2() throws Exception {
+ // Create query
+ String sql = "SELECT a.e4 c0, b.e4 c1 FROM pm1.g1 a FULL OUTER JOIN pm1.g1 b ON a.e4=b.e4 order by c0"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { new Double(0), new Double(0) }),
+ Arrays.asList(new Object[] { new Double(2), new Double(2) }),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSortedFullOuterJoin() throws Exception {
+ // Create query
+ String sql = "SELECT pm1.g1.e2, pm2.g1.e2 FROM pm1.g1 FULL OUTER JOIN pm2.g1 ON pm1.g1.e2=pm2.g1.e2 and pm1.g1.e2 > 3"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, 2 }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { 3, null }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { null, 3 }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, 4 }), //$NON-NLS-1$
+ };
+
+ HardcodedDataManager hdm = new HardcodedDataManager();
+ hdm.addData("SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0 ORDER BY c_0", new List[] {
+ Arrays.asList(3),
+ });
+ hdm.addData("SELECT g_0.e2 AS c_0 FROM pm2.g1 AS g_0 ORDER BY c_0", new List[] {
+ Arrays.asList(2),
+ Arrays.asList(3),
+ Arrays.asList(4),
+
+ });
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder());
+ CommandContext cc = createCommandContext();
+ cc.setProcessorBatchSize(2);
+ helpProcess(plan, cc, hdm, expected);
+ }
+
+ @Test public void testFullOuterJoin3() throws Exception {
+ // Create query
+ String sql = "SELECT a.e4 c0, b.e4 c1 FROM pm1.g1 b FULL OUTER JOIN (select e4, 1 x from pm1.g1 union all select e4, 2 from pm1.g1) a ON a.e4=b.e4 and a.x = 2 order by c0"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { new Double(0), new Double(0) }),
+ Arrays.asList(new Object[] { new Double(0), null }),
+ Arrays.asList(new Object[] { new Double(2), new Double(2) }),
+ Arrays.asList(new Object[] { new Double(2), null }),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT x.e1, pm2.g1.e1 FROM (SELECT e1 FROM pm1.g1) AS x LEFT OUTER JOIN pm2.g1 ON x.e1=pm2.g1.e1 */
+ @Test public void testLeftOuterJoinWithInlineView() {
+ // Create query
+ String sql = "SELECT x.e1, pm2.g1.e1 FROM (SELECT e1 FROM pm1.g1) AS x LEFT OUTER JOIN pm2.g1 ON x.e1=pm2.g1.e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT * FROM vm1.g5 ORDER BY expr */
+ @Test public void testDefect5273_1() {
+ // Create query
+ String sql = "SELECT expr FROM vm1.g5 ORDER BY expr"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "bval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "cval" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT expr AS e FROM vm1.g5 ORDER BY e */
+ @Test public void testDefect5273_2() {
+ // Create query
+ String sql = "SELECT expr AS e FROM vm1.g5 ORDER BY e"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "bval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "cval" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT e2 AS e FROM vm1.g5 ORDER BY e */
+ @Test public void testDefect5273_3() {
+ // Create query
+ String sql = "SELECT e2 AS e FROM vm1.g5 ORDER BY e"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(3) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT e AS f FROM vm1.g6 ORDER BY f */
+ @Test public void testDefect5273_4() {
+ // Create query
+ String sql = "SELECT e AS f FROM vm1.g6 ORDER BY f"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "bval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "cval" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT e AS f FROM vm1.g7 ORDER BY f */
+ @Test public void testDefect5273_5() {
+ // Create query
+ String sql = "SELECT e AS f FROM vm1.g7 ORDER BY f"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "a0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a3" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b2" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c1" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT e AS f FROM vm1.g7 ORDER BY f */
+ @Test public void testDefect5273_6() {
+ // Create query
+ String sql = "SELECT e AS f FROM vm1.g8 ORDER BY f"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "aval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "bval" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "cval" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testFalseCriteria1() {
+ // Create query
+ String sql = "SELECT 5 FROM pm1.g1 WHERE 0=1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testFalseCriteria2() {
+ // Create query
+ String sql = "SELECT count(*) FROM pm1.g1 WHERE 0=1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) }),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testTempGroup() {
+ // Create query
+ String sql = "SELECT e1 FROM tm1.g1 WHERE e1 = 'a'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSubquery1() {
+ // Create query
+ String sql = "SELECT e1 FROM (SELECT e1 FROM pm1.g1) AS x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSubquerySimple() {
+ // Create query
+ String sql = "SELECT e1 FROM (SELECT e1 FROM pm1.g1) AS x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCritInSubquery() {
+ // Create query
+ String sql = "SELECT e1 FROM (SELECT e1 FROM pm1.g1 WHERE e1 = 'a') AS x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCritAboveSubquery() {
+ // Create query
+ String sql = "SELECT e1 FROM (SELECT e1 FROM pm1.g1) AS x WHERE e1 = 'a'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSubqueryInJoinPredicate() {
+ // Create query
+ String sql = "SELECT x.e1 FROM (SELECT e1 FROM pm1.g1) AS x JOIN (SELECT e1 FROM pm1.g1) y ON x.e1=y.e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSubqueryWithRenaming() {
+ // Create query
+ String sql = "SELECT x.a FROM (SELECT e1 AS a FROM pm1.g1) AS x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testNestedSubquery() {
+ // Create query
+ String sql = "SELECT x.a FROM (SELECT e1 AS a FROM (SELECT e1 FROM pm1.g1) AS y) AS x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null }),
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery IN clause criteria
+ */
+ @Test public void testSubqueryINClause() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery IN clause criteria with nulls
+ * in sample data
+ */
+ @Test public void testSubqueryINClauseWithNulls() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e4 IN (SELECT e4 FROM pm2.g1)"; //$NON-NLS-1$
+
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery IN clause criteria with nulls
+ * in sample data
+ */
+ @Test public void testSubqueryINClauseWithNulls2() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e4 FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a compound criteria of two subqueries in IN clauses
+ */
+ @Test public void testSubqueryINClauses() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1) AND e1 IN (SELECT e1 FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a compound criteria of a subquery in IN clause and another type of
+ * criteria
+ */
+ @Test public void testSubqueryINClauseMixedCriteria() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1) AND e1 IN ('b')"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a compound criteria of a subquery in IN clause and another type of
+ * criteria
+ */
+ @Test public void testSubqueryINClauseMixedCriteria2() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1) AND NOT (e1 = 'a')"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests nesting of Subquery IN clause criteria
+ */
+ @Test public void testNestedSubqueryINClauses() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1 WHERE e1 IN (SELECT e1 FROM pm1.g1))"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSubqueryXML() {
+ // Create query
+ String sql = "SELECT * FROM (SELECT * FROM xmltest.doc1) AS x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] {
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + //$NON-NLS-1$
+ "<root><node1><node2><node3/></node2></node1></root>" //$NON-NLS-1$
+ })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery EXISTS predicate criteria
+ */
+ @Test public void testSubqueryExistsPredicate() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE EXISTS (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery EXISTS predicate criteria
+ * where the subquery returns no rows
+ */
+ @Test public void testSubqueryExistsPredicate2() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE EXISTS (SELECT e2 FROM pm2.g1 WHERE e1 = 'ZZTop')"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[0];
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery in compare predicate criteria
+ */
+ @Test public void testSubqueryComparePredicate() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 = ANY (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery in compare predicate criteria
+ */
+ @Test public void testSubqueryComparePredicate2() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 = SOME (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery in compare predicate criteria
+ */
+ @Test public void testSubqueryComparePredicate3() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 = ALL (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[0];
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery in compare predicate criteria
+ */
+ @Test public void testSubqueryComparePredicate4() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 <= ALL (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery in compare predicate criteria
+ */
+ @Test public void testSubqueryComparePredicate5() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 < SOME (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery in compare predicate criteria
+ */
+ @Test public void testSubqueryComparePredicate5a() {
+ String sql = "SELECT e1 FROM pm2.g1 WHERE e2 < SOME (SELECT e2 FROM pm1.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "e" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery in compare predicate criteria
+ * without predicate quantifier
+ */
+ @Test public void testSubqueryComparePredicate6() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 < (SELECT e2 FROM pm2.g1 WHERE e1 = 'e')"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a single Subquery in compare predicate criteria
+ */
+ @Test public void testSubqueryComparePredicateNested() {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 < SOME (SELECT e2 FROM pm2.g1 WHERE EXISTS (SELECT e2 FROM pm2.g1))"; //$NON-NLS-1$
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ // Construct data manager with data
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("SELECT pm1.g1.e2, pm1.g1.e1 FROM pm1.g1", new List[] { Arrays.asList(new Object[] { new Integer(0), "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { new Integer(1), "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(2), "c" }), //$NON-NLS-1$
+ });
+
+ dataManager.addData("SELECT pm2.g1.e2 FROM pm2.g1", new List[] { //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(3) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ });
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
+ };
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a scalar subquery in the SELECT clause
+ */
+ @Test public void testSubqueryScalar() {
+ String sql = "SELECT e1, (SELECT e2 FROM pm2.g1 WHERE e1 = 'b') FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a scalar subquery which returns no rows in the SELECT clause
+ */
+ @Test public void testSubqueryScalar2() {
+ String sql = "SELECT e1, (SELECT e2 FROM pm2.g1 WHERE e1 = 'a') FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Tests a scalar subquery which returns more than one rows
+ * causes the expected Exception
+ */
+ @Test public void testSubqueryScalarException() throws Exception {
+ String sql = "SELECT e1, (SELECT e2 FROM pm2.g1) FROM pm1.g1"; //$NON-NLS-1$
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcessException(plan, dataManager);
+ }
+
+ @Test public void testSubqueryScalarInTransformation() {
+ String sql = "select * from vm1.g25"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), new Double(0.0) }),
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), new Double(0.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSubqueryScalarInTransformation2() {
+ String sql = "select * from vm1.g25 where e5 = 0.0"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), new Double(0.0) }),
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), new Double(0.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery_CASE2022() {
+ String sql = "select * from BQT2_V WHERE BQT2_V.IntKey < 50"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[0];
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT1(dataManager);
+ sampleDataBQT2(dataManager);
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
+ caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
+ caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.exampleBQTCached(), capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+ @Test public void testCorrelatedSubquery1() {
+ String sql = "Select e1, e2, e4 from pm1.g1 where e2 in (select e2 FROM pm2.g1 WHERE pm1.g1.e4 = pm2.g1.e4)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0), new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ /**
+ * There is a bug when the second query in a UNION ALL has a correlated subquery, and both
+ * the outer and inner query are selecting from the same virtual group, and aliasing them
+ * differently to distinguish between them. The generated atomic query has screwed up
+ * aliasing.
+ */
+ @Test public void testCorrelatedSubqueryCase3667() {
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
+ caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
+ caps.setCapabilitySupport(Capability.QUERY_UNION, true);
+ caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
+ caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
+
+ // Plan query
+ String sql = "Select e1, e2, e4 from pm2.g1 where 1=2 " + //$NON-NLS-1$
+ "UNION ALL Select e1, e2, e4 from vm1.g1 outg1 where outg1.e2 in (select ing1.e2 FROM vm1.g1 ing1 WHERE outg1.e4 = ing1.e4)";//$NON-NLS-1$
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.example1Cached(), capFinder);
+
+ // Run query
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "aString", new Integer(22), new Double(22.0) }), //$NON-NLS-1$
+ };
+
+ dataManager.addData("SELECT g_0.e1, g_0.e2, g_0.e4 FROM pm1.g1 AS g_0 WHERE g_0.e2 IN (SELECT g_1.e2 FROM pm1.g1 AS g_1 WHERE g_1.e4 = g_0.e4)", //$NON-NLS-1$
+ expected);
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** control query, this test passes */
+ @Test public void testCorrelatedSubqueryCase3667a() {
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
+ caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
+ caps.setCapabilitySupport(Capability.QUERY_UNION, true);
+ caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
+ caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ // Plan query
+ String sql = "Select e1, e2, e4 from vm1.g1 outg1 where outg1.e2 in (select ing1.e2 FROM vm1.g1 ing1 WHERE outg1.e4 = ing1.e4)";//$NON-NLS-1$
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.example1Cached(), capFinder);
+
+ // Run query
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "aString", new Integer(22), new Double(22.0) }), //$NON-NLS-1$
+ };
+
+ dataManager.addData("SELECT g_0.e1, g_0.e2, g_0.e4 FROM pm1.g1 AS g_0 WHERE g_0.e2 IN (SELECT g_1.e2 FROM pm1.g1 AS g_1 WHERE g_1.e4 = g_0.e4)", //$NON-NLS-1$
+ expected);
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery2() {
+ String sql = "Select e1, e2 from pm1.g1 where e2 in (select e2 FROM pm2.g1 WHERE pm1.g1.e4 = pm2.g1.e4)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testCorrelatedSubquery3() {
+ String sql = "Select e1, (select e2 FROM pm2.g1 WHERE pm1.g1.e4 = pm2.g1.e4) from pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery3a() {
+ String sql = "Select e1, (select e2 FROM pm2.g1 WHERE X.e4 = e4) from pm1.g1 X"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery3b() {
+ String sql = "Select e1, (select e2 FROM pm2.g1 Y WHERE X.e4 = e4) from pm1.g1 X"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery3c() {
+ String sql = "Select e1, (select e2 FROM pm2.g1 Y WHERE X.e4 = Y.e4) from pm1.g1 X"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery4() {
+ String sql = "Select e1, e2 from pm1.g1 X where e2 in (select e2 FROM pm2.g1 WHERE X.e4 = pm2.g1.e4)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery4a() {
+ String sql = "Select e1, e2 from pm1.g1 X where e2 = some (select e2 FROM pm2.g1 WHERE X.e4 = pm2.g1.e4)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery_defect9968() {
+ String sql = "Select e1, e2 from pm1.g1 X where e2 in (select max(X.e2) FROM pm2.g1 WHERE X.e4 = pm2.g1.e4)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery_defect9968a() {
+ String sql = "Select e1, e2 from pm1.g1 X where e2 in (select ((X.e2)/2) as e FROM pm2.g1 WHERE X.e4 = pm2.g1.e4)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery_defect9968b() {
+ String sql = "Select e1, e2 from pm1.g1 X where e2 in (select (select e2 as e FROM pm2.g1 WHERE X.e4 = pm2.g1.e4) as e FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubquery_defect10021() {
+ String sql = "Select e1, e2 from table1 X where e4 in (select max(Y.e4) FROM table1 Y WHERE X.e4 = Y.e4)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(2) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Note the subquery has a multi-column result - conceptually this is
+ * legal for the EXISTS predicate
+ */
+ @Test public void testCorrelatedSubquery5() {
+ String sql = "Select * from pm1.g1 where exists (select * FROM pm2.g1 WHERE pm1.g1.e1 = e1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "b", new Integer(1), Boolean.TRUE, null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Count the # of parent rows for which no child rows exist
+ */
+ @Test public void testCorrelatedSubquery6() {
+ String sql = "Select count(*) from pm1.g1 where not (exists (select * FROM pm2.g1 WHERE pm1.g1.e1 = e1))"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { new Integer(2) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Select e2, e4, and the avg of e4 for each group of e1
+ */
+ @Test public void testCorrelatedSubquery7() {
+ String sql = "select e2, e4, (select avg(e4) FROM pm1.g1 Y WHERE X.e1 = e1) from pm1.g1 X"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { new Integer(0), new Double(2.0), new Double(3.6666666666666665) }),
+ Arrays.asList(new Object[] { new Integer(1), new Double(1.0), null }),
+ Arrays.asList(new Object[] { new Integer(3), new Double(7.0), new Double(3.6666666666666665) }),
+ Arrays.asList(new Object[] { new Integer(1), null , null }),
+ Arrays.asList(new Object[] { new Integer(2), new Double(0.0), new Double(0.0) }),
+ Arrays.asList(new Object[] { new Integer(0), new Double(2.0), new Double(3.6666666666666665) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Select e2, e4, and the avg of e4 for each group of e1
+ */
+ @Test public void testCorrelatedSubquery8() {
+ String sql = "select X.e2, X.e4, (select avg(Y.e4) FROM pm1.g1 Y WHERE X.e1 = Y.e1) from pm1.g1 X"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { new Integer(0), new Double(2.0), new Double(3.6666666666666665) }),
+ Arrays.asList(new Object[] { new Integer(1), new Double(1.0), null }),
+ Arrays.asList(new Object[] { new Integer(3), new Double(7.0), new Double(3.6666666666666665) }),
+ Arrays.asList(new Object[] { new Integer(1), null , null }),
+ Arrays.asList(new Object[] { new Integer(2), new Double(0.0), new Double(0.0) }),
+ Arrays.asList(new Object[] { new Integer(0), new Double(2.0), new Double(3.6666666666666665) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer1() {
+ String sql = "Select e1, e2 from vm1.g1 X where e2 in (select e2 FROM vm1.g1 Y WHERE X.e4 = Y.e4)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1) }),
+ Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer2() {
+ String sql = "Select e1, e2 from vm1.g2 where e2 in (select e2 FROM vm1.g1 WHERE vm1.g2.e4 = vm1.g1.e4)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer3() {
+ String sql = "Select e2 from vm1.g6 where e2 in (select e2 FROM vm1.g1 WHERE vm1.g6.e = e1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[0];
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer4() {
+ String sql = "Select e2 from vm1.g7 where e2 in (select e2 FROM vm1.g1 WHERE vm1.g7.e = e1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[0];
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer5() {
+ String sql = "Select e1 from vm1.g4 where not (e1 in (select e1 FROM vm1.g1 WHERE vm1.g4.e1 = e1)) order by e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "2" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "3" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer6() {
+ String sql = "Select e2 from vm1.g1 X where e2 in (select X.e2 FROM vm1.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(3) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(0) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer6a() {
+ String sql = "Select e2 from vm1.g1 where e2 in (select vm1.g1.e2 FROM vm1.g5)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(3) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(0) })
+ };
+
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer6b() {
+ String sql = "Select e2 from vm1.g1 where e2 in (select vm1.g1.e2 FROM vm1.g2)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(3) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(0) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer6c() {
+ String sql = "Select e2 from vm1.g7 where e2 in (select vm1.g7.e FROM vm1.g1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[0];
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer6e() {
+ String sql = "Select e2 from vm1.g1 where e2 in (select vm1.g1.e2 FROM vm1.g2a)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(3) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(0) })
+ };
+
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryVirtualLayer7() {
+ String sql = "Select e2 from vm1.g7 where e2 in (select vm1.g7.e FROM vm1.g1 WHERE vm1.g7.e = e1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[0];
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation() {
+ String sql = "Select * from vm1.g21"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "b", new Integer(1), Boolean.TRUE, null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation2() {
+ String sql = "Select * from vm1.g20"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation3() {
+ String sql = "Select * from vm1.g19 order by e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "2" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "3" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * User correlated subquery, and one of the virtual group transformations
+ * also has a correlated subquery
+ */
+ @Test public void testCorrelatedSubqueryInTransformation4() {
+ String sql = "Select * from vm1.g20 where exists (Select * from vm1.g19 where convert(vm1.g20.e2, string) = vm1.g19.e1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * User correlated subquery, and one of the virtual group transformations
+ * also has a correlated subquery
+ */
+ @Test public void testCorrelatedSubqueryInTransformation5() {
+ String sql = "Select * from vm1.g19 where exists (Select e2 from vm1.g20 where convert(e2, string) = vm1.g19.e1) order by e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "0" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "2" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "3" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation6() {
+ String sql = "Select * from vm1.g21 where e2 = some (Select e2 from pm1.g1 where e1 = vm1.g21.e1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "b", new Integer(1), Boolean.TRUE, null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation7() {
+ String sql = "Select * from vm1.g21 where exists (Select e2 from pm1.g2 where e4 = convert(vm1.g21.e2, double))"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation8() {
+ String sql = "Select * from vm1.g21 where exists (Select e2 from pm1.g1 where e4 = convert(vm1.g21.e2, double))"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation9() {
+ String sql = "Select * from vm1.g22"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
+
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation10() {
+ String sql = "Select * from vm1.g23"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation11() {
+ String sql = "Select * from vm1.g24"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+// Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }),
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation12() {
+ String sql = "Select * from vm1.g24 X where exists (Select * from vm1.g24 Y where X.e2 = Y.e2)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+// Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }),
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation13() {
+ String sql = "Select e1, e2, e3, e4, (select e4 from vm1.g25 where pm1.g1.e4 = e5 and e4=0.0) as e5 from pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), null }),
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation14() {
+ String sql = "Select e1, e2, e3, e4, (select e4 from vm1.g26 where pm1.g1.e4 = e5 and e4=0.0) as e5 from pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), null }),
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation15() {
+ String sql = "Select e1, e2, e3, e4, (select e4 from vm1.g23 where vm1.g22.e4 = e5) as e5 from vm1.g22 where e1 = 'a'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** Test selecting a virtual element (e5) which is defined by a scalar subquery in the virtual transformation */
+ @Test public void testCorrelatedSubqueryInTransformation15a() {
+ String sql = "Select e1, e2, e3, e4 from pm1.g1 where exists (select * from vm1.g26 where pm1.g1.e3 = e3)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryInTransformation15b() {
+ String sql = "Select e1, e2, e3, e4, (select e4 from vm1.g23 where vm1.g22.e4 = e5) as e5 from vm1.g22 where e1 = 'a' and exists (select * from vm1.g23 where vm1.g22.e3 = e3)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** Test selecting a virtual element (e5) which is defined by a scalar subquery in the virtual transformation */
+ @Test public void testCorrelatedSubqueryInTransformation15c() {
+ String sql = "Select e1, e2, e3, e4 from pm1.g1 where exists (select e1, e2, e3, e4, e5 as e from vm1.g26 where pm1.g1.e3 = e3)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** Test selecting a virtual element (e5) which is defined by a scalar subquery in the virtual transformation */
+ @Test public void testCorrelatedSubqueryInTransformation15d() {
+ String sql = "Select e1, e2, e3, e4 from pm1.g1 where exists (select e1, e2, e3, e4, ((e4 + e5)/(e4 + 1)) as e from vm1.g26 where pm1.g1.e3 = e3)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
+ Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+// Here is select * from vm1.g26
+// Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }),
+// Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), null }),
+// Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), null }),
+// Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }),
+// Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }),
+// Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null })
+
+
+ @Test public void testCorrelatedSubqueryInTransformation16() {
+// String sql = "Select e1, e2, e3, e4, (select e4 from vm1.g23 where vm1.g22.e4 = e5) as e5 from vm1.g22 where e1 = 'a'"/* and exists (select * from vm1.g23 where vm1.g22.e3 = e3)"*/;
+ String sql = "select * from vm1.g26 where e5 = 0.0"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[]{
+// Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null }),
+// Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0), null }),
+// Arrays.asList(new Object[] { "a", new Integer(3), Boolean.TRUE, new Double(7.0), null }),
+// Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null, null }),
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0), new Double(0.0) }), //$NON-NLS-1$
+// Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0), null })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueriesNested() {
+ String sql =
+ "Select e1, e2, e4 from pm1.g1 where e2 < all (" + //$NON-NLS-1$
+ "select e2 from pm1.g2 where pm1.g1.e1 = e1 and exists("+ //$NON-NLS-1$
+ "select e2 from pm2.g1 where pm1.g2.e4 = pm2.g1.e4))"; //$NON-NLS-1$
+ Command query = helpParse(sql);
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0), new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(1), null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(2), new Double(0.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(query, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** defect 15124 */
+ @Test public void testCorrelatedSubqueryAndInlineView() {
+ String sql = "Select e1, (select e2 FROM pm2.g1 Y WHERE X.e4 = Y.e4) from (select * from pm1.g1) as X"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** defect 15124 */
+ @Test public void testCorrelatedSubqueryAndInlineView2() {
+ String sql = "Select e1 from (select * from pm1.g1) as X WHERE e2 IN (select e2 FROM pm2.g1 Y WHERE X.e4 = Y.e4)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** defect 15124 */
+ @Test public void testCorrelatedSubqueryAndInlineView3() {
+ String sql = "Select e1, (select e2 FROM pm2.g1 Y WHERE X.e4 = Y.e4) from (select * from pm1.g1 UNION ALL select * from pm1.g1) as X"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** defect 15124 */
+ @Test public void testCorrelatedSubqueryAndInlineView4() {
+ String sql = "Select e1, (select e2 FROM pm2.g1 Y WHERE X.e4 = Y.e4) from (select pm1.g1.e1, (select pm1.g1.e2 from pm1.g1 Z where pm1.g1.e1 = Z.e1), pm1.g1.e3, pm1.g1.e4 from pm1.g1) as X"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", null }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testXMLUnion_defect8373() {
+ // Create query
+ String sql = "SELECT * FROM xmltest.doc5"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] {
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + //$NON-NLS-1$
+ "<root><node1><node2>a</node2></node1><node1><node2/></node1><node1><node2>a</node2></node1><node1><node2>c</node2></node1><node1><node2>b</node2></node1><node1><node2>a</node2></node1><node1><node2>a</node2></node1><node1><node2/></node1><node1><node2>a</node2></node1><node1><node2>c</node2></node1><node1><node2>b</node2></node1><node1><node2>a</node2></node1></root>" //$NON-NLS-1$
+ })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testStoredQuery1() {
+ // Create query
+ String sql = "EXEC pm1.sq1()"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1) }),
+ Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testStoredQuery2() {
+ // Create query
+ String sql = "EXEC pm1.sq2(\'a\')"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testStoredQuery3() {
+ // Create query
+ String sql = "select x.e1 from (EXEC pm1.sq1()) as x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null}),
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testStoredQuery4() {
+ // Create query
+ String sql = "EXEC pm1.sq5('a')"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testStoredQuery5() {
+ // Create query
+ String sql = "EXEC pm1.sp1()"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, new Integer(1)}),
+ Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Integer(1)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testStoredQuery6() {
+ // Create query
+ String sql = "EXEC pm1.sqsp1()"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null}),
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testStoredQuery7() {
+ // Create query
+ String sql = "EXEC pm1.sq17()"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] {
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + //$NON-NLS-1$
+ "<root><node1><node2><node3/></node2></node1></root>" //$NON-NLS-1$
+ })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ // implict type conversion of parameter
+ @Test public void testStoredQuery8() {
+ // Create query
+ String sql = "EXEC pm1.sq5(5)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ // function for parameter
+ @Test public void testStoredQuery9() {
+ // Create query
+ String sql = "EXEC pm1.sq5(concat('a', ''))"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** named parameters */
+ @Test public void testStoredQuery10() {
+ // Create query
+ String sql = "EXEC pm1.sq3b(\"in\" = 'a', in3 = 'something')"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(3) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testInsert() {
+ // Create query
+ String sql = "Insert into pm1.g1 (pm1.g1.e1, pm1.g1.e2) values ('MyString', 1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1)})
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData3(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA FULL OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20) */
+ @Test public void testDefect7770_FullOuter() {
+ // Create query
+ String sql = "SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA FULL OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(5), new Integer(5) }),
+ Arrays.asList(new Object[] { new Integer(6), new Integer(6) }),
+ Arrays.asList(new Object[] { new Integer(7), new Integer(7) }),
+ Arrays.asList(new Object[] { new Integer(8), new Integer(8) }),
+ Arrays.asList(new Object[] { new Integer(9), new Integer(9) }),
+ Arrays.asList(new Object[] { new Integer(10), new Integer(10) }),
+ Arrays.asList(new Object[] { new Integer(11), new Integer(11) }),
+ Arrays.asList(new Object[] { new Integer(12), new Integer(12) }),
+ Arrays.asList(new Object[] { new Integer(13), new Integer(13) }),
+ Arrays.asList(new Object[] { new Integer(14), new Integer(14) }),
+ Arrays.asList(new Object[] { new Integer(15), new Integer(15) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA RIGHT OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20) */
+ @Test public void testDefect7770_RightOuter() {
+ // Create query
+ String sql = "SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA RIGHT OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(5), new Integer(5) }),
+ Arrays.asList(new Object[] { new Integer(6), new Integer(6) }),
+ Arrays.asList(new Object[] { new Integer(7), new Integer(7) }),
+ Arrays.asList(new Object[] { new Integer(8), new Integer(8) }),
+ Arrays.asList(new Object[] { new Integer(9), new Integer(9) }),
+ Arrays.asList(new Object[] { new Integer(10), new Integer(10) }),
+ Arrays.asList(new Object[] { new Integer(11), new Integer(11) }),
+ Arrays.asList(new Object[] { new Integer(12), new Integer(12) }),
+ Arrays.asList(new Object[] { new Integer(13), new Integer(13) }),
+ Arrays.asList(new Object[] { new Integer(14), new Integer(14) }),
+ Arrays.asList(new Object[] { new Integer(15), new Integer(15) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA LEFT OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20) */
+ @Test public void testDefect7770_LeftOuter() {
+ // Create query
+ String sql = "SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey FROM BQT1.SmallA LEFT OUTER JOIN BQT2.MediumB ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey WHERE (BQT1.SmallA.IntKey >= 0) AND (BQT1.SmallA.IntKey <= 15) AND (BQT2.MediumB.IntKey >= 5) AND (BQT2.MediumB.IntKey <= 20)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(5), new Integer(5) }),
+ Arrays.asList(new Object[] { new Integer(6), new Integer(6) }),
+ Arrays.asList(new Object[] { new Integer(7), new Integer(7) }),
+ Arrays.asList(new Object[] { new Integer(8), new Integer(8) }),
+ Arrays.asList(new Object[] { new Integer(9), new Integer(9) }),
+ Arrays.asList(new Object[] { new Integer(10), new Integer(10) }),
+ Arrays.asList(new Object[] { new Integer(11), new Integer(11) }),
+ Arrays.asList(new Object[] { new Integer(12), new Integer(12) }),
+ Arrays.asList(new Object[] { new Integer(13), new Integer(13) }),
+ Arrays.asList(new Object[] { new Integer(14), new Integer(14) }),
+ Arrays.asList(new Object[] { new Integer(15), new Integer(15) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testReorder1() {
+ // Create query
+ String sql = "SELECT e1 AS x, {b'false'}, e2+e4, e3 FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", Boolean.FALSE, new Double(2.0), Boolean.FALSE }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { null, Boolean.FALSE, new Double(2.0), Boolean.FALSE }),
+ Arrays.asList(new Object[] { "a", Boolean.FALSE, new Double(10.0), Boolean.TRUE }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", Boolean.FALSE, null, Boolean.TRUE }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", Boolean.FALSE, new Double(2.0), Boolean.FALSE }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", Boolean.FALSE, new Double(2.0), Boolean.FALSE }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testTwoFullOuterJoins1() {
+ // Create query
+ String sql = "SELECT A.IntKey AS A_IntKey, B.IntKey AS B_IntKey, C.IntKey AS C_IntKey " + //$NON-NLS-1$
+ "FROM (BQT1.SmallA AS A FULL OUTER JOIN BQT2.SmallA AS B ON A.IntKey = B.IntKey) FULL OUTER JOIN BQT3.SmallA AS C ON B.IntKey = C.IntKey " + //$NON-NLS-1$
+ "WHERE (A.IntKey >= 0) AND (A.IntKey <= 15) " + //$NON-NLS-1$
+ "AND (B.IntKey >= 5) AND (B.IntKey <= 20) " + //$NON-NLS-1$
+ "AND (C.IntKey >= 10) AND (C.IntKey <= 30)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(10), new Integer(10), new Integer(10) }),
+ Arrays.asList(new Object[] { new Integer(11), new Integer(11), new Integer(11) }),
+ Arrays.asList(new Object[] { new Integer(12), new Integer(12), new Integer(12) }),
+ Arrays.asList(new Object[] { new Integer(13), new Integer(13), new Integer(13) }),
+ Arrays.asList(new Object[] { new Integer(14), new Integer(14), new Integer(14) }),
+ Arrays.asList(new Object[] { new Integer(15), new Integer(15), new Integer(15) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSelectDistinctOnBQT() {
+ // Create query
+ String sql = "SELECT DISTINCT IntKey FROM BQT1.SmallA"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(3) }),
+ Arrays.asList(new Object[] { new Integer(4) }),
+ Arrays.asList(new Object[] { new Integer(5) }),
+ Arrays.asList(new Object[] { new Integer(6) }),
+ Arrays.asList(new Object[] { new Integer(7) }),
+ Arrays.asList(new Object[] { new Integer(8) }),
+ Arrays.asList(new Object[] { new Integer(9) }),
+ Arrays.asList(new Object[] { new Integer(10) }),
+ Arrays.asList(new Object[] { new Integer(11) }),
+ Arrays.asList(new Object[] { new Integer(12) }),
+ Arrays.asList(new Object[] { new Integer(13) }),
+ Arrays.asList(new Object[] { new Integer(14) }),
+ Arrays.asList(new Object[] { new Integer(15) }),
+ Arrays.asList(new Object[] { new Integer(16) }),
+ Arrays.asList(new Object[] { new Integer(17) }),
+ Arrays.asList(new Object[] { new Integer(18) }),
+ Arrays.asList(new Object[] { new Integer(19) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSelectWithNoFrom() {
+ // Create query
+ String sql = "SELECT 5"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(5) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testBetween() {
+ // Create query
+ String sql = "SELECT * FROM pm1.g1 WHERE e2 BETWEEN 1 AND 2"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, new Integer(1), Boolean.FALSE, new Double(1.0) }),
+ Arrays.asList(new Object[] { "c", new Integer(1), Boolean.TRUE, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(2), Boolean.FALSE, new Double(0.0) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Test <code>QueryProcessor</code>'s ability to process a query containing
+ * a <code>CASE</code> expression in which a <code>BETWEEN</code>
+ * comparison is used in the queries <code>SELECT</code> statement.
+ * <p>
+ * For example:
+ * <p>
+ * SELECT CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END FROM pm1.g1
+ */
+ @Test public void testBetweenInCase() {
+ // Create query
+ final String sql = "SELECT CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(-1) }),
+ Arrays.asList(new Object[] { new Integer(-1) }),
+ Arrays.asList(new Object[] { new Integer(3) }),
+ Arrays.asList(new Object[] { new Integer(-1) }),
+ Arrays.asList(new Object[] { new Integer(-1) }),
+ Arrays.asList(new Object[] { new Integer(-1) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Test <code>QueryProcessor</code>'s ability to process a query containing
+ * an aggregate SUM with a <code>CASE</code> expression in which a
+ * <code>BETWEEN</code> comparison is used in the queries <code>SELECT</code>
+ * statement.
+ * <p>
+ * For example:
+ * <p>
+ * SELECT SUM(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END) FROM pm1.g1
+ */
+ @Test public void testBetweenInCaseInSum() {
+ // Create query
+ final String sql = "SELECT SUM(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END) FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Long(-2) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Test <code>QueryProcessor</code>'s ability to process a query containing
+ * an aggregate SUM with a <code>CASE</code> expression in which a
+ * <code>BETWEEN</code> comparison is used in the queries <code>SELECT</code>
+ * statement and a GROUP BY is specified.
+ * <p>
+ * For example:
+ * <p>
+ * SELECT e1, SUM(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END)
+ * FROM pm1.g1 GROUP BY e1 ORDER BY e1
+ */
+ @Test public void testBetweenInCaseInSumWithGroupBy() {
+ // Create query
+ final String sql = "SELECT e1, SUM(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 ELSE -1 END) FROM pm1.g1 GROUP BY e1 ORDER BY e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, new Long(-1) }),
+ Arrays.asList(new Object[] { "a", new Long(1) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Long(-1) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c", new Long(-1) }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Test <code>QueryProcessor</code>'s ability to process a query containing
+ * an aggregate COUNT with a <code>CASE</code> expression in which a
+ * <code>BETWEEN</code> comparison is used in the queries <code>SELECT</code>
+ * statement.
+ * <p>
+ * For example:
+ * <p>
+ * SELECT COUNT(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 END) FROM pm1.g1
+ */
+ @Test public void testBetweenInCaseInCount() {
+ // Create query
+ final String sql = "SELECT COUNT(CASE WHEN e2 BETWEEN 3 AND 5 THEN e2 END) FROM pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCase() {
+ // Create query
+ String sql = "SELECT e2, CASE e2 WHEN 1 THEN 2 ELSE 3 END FROM pm1.g1 WHERE e2 BETWEEN 1 AND 2"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(3) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSelectNoFrom1() {
+ // Create query
+ String sql = "SELECT 1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSelectNoFrom2() {
+ // Create query
+ String sql = "SELECT 1, {b'true'}, 2.0 AS x, {d'2003-11-04'}"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), Boolean.TRUE, new Double(2.0), TimestampUtil.createDate(103, 10, 4) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCase1566() throws Exception {
+ // Create query
+ String sql = "SELECT x, COUNT(*) FROM (SELECT convert(TimestampValue, date) AS x FROM bqt1.smalla) as y GROUP BY x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { java.sql.Date.valueOf("2002-01-01"), new Integer(2) }),
+ Arrays.asList(new Object[] { java.sql.Date.valueOf("2002-01-02"), new Integer(3) }) };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT_case1566(dataManager);
+
+ // Create capabilities
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, false);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ // Parse query
+ Command command = QueryParser.getQueryParser().parseCommand(sql);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.exampleBQTCached(), capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect10976(){
+ String sql = "SELECT * FROM vm1.g28"; //$NON-NLS-1$
+
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { "A", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "B", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "C", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect10976_2(){
+ String sql = "SELECT * FROM vm1.g29"; //$NON-NLS-1$
+
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { "A", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "B", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "C", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect10976_3(){
+ String sql = "SELECT * FROM vm1.g30"; //$NON-NLS-1$
+
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect10976_4(){
+ String sql = "SELECT * FROM vm1.g31 order by x"; //$NON-NLS-1$
+
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect10976_5(){
+ String sql = "SELECT * FROM vm1.g32"; //$NON-NLS-1$
+
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", "c" }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect11236_MergeJoinWithFunctions() {
+ // Create query
+ String sql = "SELECT pm1.g1.e2, pm2.g1.e2 FROM pm1.g1, pm2.g1 WHERE pm1.g1.e2 = (pm2.g1.e2+1)"; //$NON-NLS-1$
+ boolean pushDown = false;
+ boolean dependent = false;
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(3), new Integer(2) })
+ };
+
+ helpTestMergeJoinWithExpression(sql, pushDown, dependent, expected);
+ }
+
+ @Test public void testMergeJoinWithFunctionsPushDown() {
+ // Create query
+ String sql = "SELECT pm1.g1.e2, pm2.g1.e2 FROM pm1.g1, pm2.g1 WHERE pm1.g1.e2 = (pm2.g1.e2+1)"; //$NON-NLS-1$
+ boolean pushDown = true;
+ boolean dependent = false;
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(3), new Integer(2) })
+ };
+
+ helpTestMergeJoinWithExpression(sql, pushDown, dependent, expected);
+ }
+
+ @Test public void testMergeJoinWithFunctionsPushDownDependent() {
+ // Create query
+ String sql = "SELECT pm1.g1.e2, pm2.g1.e2 FROM pm1.g1, pm2.g1 WHERE pm1.g1.e2 = (pm2.g1.e2+1) option makedep pm1.g1"; //$NON-NLS-1$
+ boolean pushDown = true;
+ boolean dependent = true;
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0) }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(3), new Integer(2) })
+ };
+
+ helpTestMergeJoinWithExpression(sql, pushDown, dependent, expected);
+ }
+
+
+ /**
+ * @param sql
+ * @param pushDown
+ * @param expected
+ */
+ private void helpTestMergeJoinWithExpression(String sql,
+ boolean pushDown,
+ boolean dependent,
+ List[] expected) {
+ // Construct data manager with data
+ ProcessorDataManager dataManager = null;
+ if (!pushDown) {
+ FakeDataManager fakeDataManager = new FakeDataManager();
+ sampleData1(fakeDataManager);
+ dataManager = fakeDataManager;
+ } else {
+ HardcodedDataManager hardCoded = new HardcodedDataManager();
+ List[] results = new List[] {
+ Arrays.asList(new Object[] {new Integer(0), new Integer(1)}),
+ Arrays.asList(new Object[] {new Integer(0), new Integer(1)}),
+ Arrays.asList(new Object[] {new Integer(1), new Integer(2)}),
+ Arrays.asList(new Object[] {new Integer(1), new Integer(2)}),
+ Arrays.asList(new Object[] {new Integer(2), new Integer(3)}),
+ Arrays.asList(new Object[] {new Integer(3), new Integer(4)}),
+ };
+ hardCoded.addData("SELECT g_0.e2 AS c_0, (g_0.e2 + 1) AS c_1 FROM pm2.g1 AS g_0 ORDER BY c_1", results); //$NON-NLS-1$
+ if (!dependent) {
+ results = new List[] {
+ Arrays.asList(new Object[] {new Integer(0),}),
+ Arrays.asList(new Object[] {new Integer(0),}),
+ Arrays.asList(new Object[] {new Integer(1),}),
+ Arrays.asList(new Object[] {new Integer(1),}),
+ Arrays.asList(new Object[] {new Integer(2),}),
+ Arrays.asList(new Object[] {new Integer(3),}),
+ };
+ hardCoded.addData("SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0 ORDER BY c_0", results); //$NON-NLS-1$
+ } else {
+ results = new List[] {
+ Arrays.asList(new Object[] {new Integer(1),}),
+ Arrays.asList(new Object[] {new Integer(2),}),
+ Arrays.asList(new Object[] {new Integer(1),}),
+ };
+ hardCoded.addData("SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0 WHERE g_0.e2 IN (1, 2)", results); //$NON-NLS-1$
+ results = new List[] {
+ Arrays.asList(new Object[] {new Integer(3),}),
+ };
+ hardCoded.addData("SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0 WHERE g_0.e2 IN (3, 4)", results); //$NON-NLS-1$
+ }
+ dataManager = hardCoded;
+ }
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+ FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, pushDown);
+ caps.setCapabilitySupport(Capability.QUERY_ORDERBY, pushDown);
+ caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(2));
+ caps.setFunctionSupport("+", pushDown); //$NON-NLS-1$
+ finder.addCapabilities("pm1", caps); //$NON-NLS-1$
+ finder.addCapabilities("pm2", caps); //$NON-NLS-1$
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, finder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCase2() {
+ // Create query
+ String sql = "SELECT e2, CASE e2 WHEN 1 THEN 2 END FROM pm1.g1 WHERE e2 BETWEEN 1 AND 2"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(2), null })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCase3() {
+ // Create query
+ String sql = "SELECT e2, CASE e2 WHEN 1 THEN 2 ELSE null END FROM pm1.g1 WHERE e2 BETWEEN 1 AND 2"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(2), null })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** nested scalar subquery */
+ @Test public void testCase4() {
+ // Create query
+ String nestedExpression = "(SELECT e1 FROM pm1.g2 WHERE e2 = 3)"; //$NON-NLS-1$
+ String sql = "SELECT e2, CASE e2 WHEN 1 THEN " + nestedExpression + " ELSE null END FROM pm1.g1 WHERE e2 BETWEEN 1 AND 2"; //$NON-NLS-1$ //$NON-NLS-2$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(1), "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(2), null })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** nested correlated scalar subquery */
+ @Test public void testCase5() {
+ // Create query
+ String nestedExpression = "(SELECT e2 FROM pm1.g2 WHERE pm1.g1.e2 = (e4 + 2))"; //$NON-NLS-1$
+ String sql = "SELECT e2, CASE e2 WHEN " + nestedExpression + " THEN 1 ELSE null END FROM pm1.g1"; //$NON-NLS-1$ //$NON-NLS-2$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0), null }),
+ Arrays.asList(new Object[] { new Integer(1), null }),
+ Arrays.asList(new Object[] { new Integer(3), null }),
+ Arrays.asList(new Object[] { new Integer(1), null }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(0), null })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * NOTE: this test depends on the ProcessorPlan being executed
+ * twice and reset in between, which currently is done in the
+ * helpProcess method
+ */
+ @Test public void testDefect12135(){
+ String sql = "SELECT pm1.g1.e1, pm1.g2.e1 FROM pm1.g1 LEFT OUTER JOIN pm1.g2 ON pm1.g1.e1=pm1.g2.e1"; //$NON-NLS-1$
+
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", null }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect12081(){
+ String sql = "SELECT DISTINCT vm1.g1.e1, upper(vm1.g1.e1) as Nuge, pm1.g1.e1, upper(pm1.g1.e1) as Nuge FROM vm1.g1, pm1.g1"; //$NON-NLS-1$
+
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", "A", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "a", "A", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "a", "A", "c", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "b", "B", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "b", "B", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "b", "B", "c", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "c", "C", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "c", "C", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "c", "C", "c", "C" }) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect12081_2(){
+ String sql = "SELECT DISTINCT vm1.g1b.e1, vm1.g1b.e1Upper, pm1.g1.e1, upper(pm1.g1.e1) as e1Upper FROM vm1.g1b, pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", "A", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "a", "A", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "a", "A", "c", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "b", "B", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "b", "B", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "b", "B", "c", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "c", "C", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "c", "C", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "c", "C", "c", "C" }) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect12081_3(){
+ String sql = "SELECT DISTINCT vm1.g1b.e1, vm1.g1b.e1Upper, pm1.g1.e1, vm1.g1b.e1Upper FROM vm1.g1b, pm1.g1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", "A", "a", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "a", "A", "b", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "a", "A", "c", "A" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "b", "B", "a", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "b", "B", "b", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "b", "B", "c", "B" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "c", "C", "a", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "c", "C", "b", "C" }), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Arrays.asList(new Object[] { "c", "C", "c", "C" }) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Basically the same as above, but with a limit node between the dup removal and the project
+ */
+ @Test public void testDefect12081_4(){
+ String sql = "SELECT DISTINCT e1, e1 FROM pm1.g1 where e1 = 'a' LIMIT 1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", "a"}), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect12719(){
+ String sql = "SELECT e1_, e2_, e2 FROM vm1.g34, pm1.g2 WHERE vm1.g34.e1_ = pm1.g2.e1 order by e1_, e2_"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0), new Integer(1) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(0), new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(0), new Integer(5) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(0), new Integer(2) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(1), new Integer(0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(1), new Integer(5) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(1), new Integer(2) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "d", new Integer(3), new Integer(2) }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect13034() {
+ String sql = "SELECT CONCAT('http://', CONCAT(CASE WHEN (HOST IS NULL) OR (HOST = '') THEN 'soap_host' ELSE HOST END, CASE WHEN (PORT IS NULL) OR (PORT = '') THEN '/metamatrix-soap/services/DataService' ELSE CONCAT(':', CONCAT(PORT, '/metamatrix-soap/services/DataService')) END)) AS location " + //$NON-NLS-1$
+ "FROM (SELECT env('soap_host') AS HOST, env('soap_port') AS PORT) AS props"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "http://my.host.com:12345/metamatrix-soap/services/DataService" }), //$NON-NLS-1$
+ };
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, new FakeDataManager(), expected);
+
+ }
+
+ /** see also integer average defect 11682 */
+ @Test public void testIntAvgDefect11682() {
+ // Create query
+ String sql = "SELECT AVG(IntKey), AVG(IntNum), AVG(FloatNum), AVG(LongNum), AVG(DoubleNum), AVG(ByteNum), AVG(ShortValue), AVG(BigIntegerValue), AVG(BigDecimalValue) FROM BQT1.SmallA"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Double(1.5), new Double(1.5), new Double(1.5), new Double(1.5), new Double(1.5), new Double(1.5), new Double(1.5), new BigDecimal("1.500000000"), new BigDecimal("1.500000000") }), //$NON-NLS-1$//$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT_defect11682(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testNonJoinCriteriaInFrom() {
+ String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN pm2.g1 b ON a.e1=b.e1 AND b.e2 = 0"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", null, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", null, null }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testNonJoinCriteriaInWhere() {
+ String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN pm2.g1 b ON a.e1=b.e1 WHERE b.e2 = 0"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testNonJoinCriteriaInWhere2() {
+ String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN pm1.g2 b ON a.e1=b.e1 WHERE (a.e2 + b.e2 = 1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", "a", new Integer(1) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testNonJoinCriteriaInWhere3() {
+ String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN pm1.g2 b ON a.e1=b.e1 WHERE (a.e2 = 0) OR (b.e2 = 0)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", "a", new Integer(1) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testNonJoinCriteriaInFromNestedInVirtual() {
+ String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN (SELECT c.e1, d.e2 FROM pm2.g1 c JOIN pm2.g1 d ON c.e1=d.e1 AND d.e2 >= 0) b ON a.e1=b.e1 AND b.e2 = 0"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", null, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", null, null }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testNonJoinCriteriaInFromUsingDependentJoin() {
+ String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a LEFT OUTER JOIN pm2.g1 b ON a.e1=b.e1 AND b.e2 = 0"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", null, null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", "b", new Integer(0) }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", null, null }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.example1Cached(), capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect13700() {
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(10) }),
+ };
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan("EXEC pm1.vsp36(5)", FakeMetadataFactory.example1Cached()); //$NON-NLS-1$
+
+ // Run query
+ helpProcess(plan, new FakeDataManager(), expected);
+
+ }
+
+ @Test public void testDefect13920() throws Exception {
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ Command command = helpParse("SELECT e5, e2, e3, e4 FROM vm1.g1c WHERE e5 >= {ts'2004-08-01 00:00:00.0'}"); //$NON-NLS-1$
+ ProcessorPlan plan = helpGetPlan(command,
+ FakeMetadataFactory.example1Cached(), capFinder);
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataStringTimestamps(dataManager);
+
+ Calendar cal = Calendar.getInstance();
+ cal.set(2004, Calendar.DECEMBER, 31, 0, 0, 0);
+ cal.set(Calendar.MILLISECOND, 0);
+ Timestamp t1 = new Timestamp(cal.getTime().getTime());
+ cal.clear();
+ cal.set(2004, Calendar.AUGUST, 1, 0, 0, 0);
+ cal.set(Calendar.MILLISECOND, 0);
+ Timestamp t2 = new Timestamp(cal.getTime().getTime());
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { t1, new Integer(1), Boolean.TRUE, null }),
+ Arrays.asList(new Object[] { t2, new Integer(2), Boolean.FALSE, new Double(0.0) }),
+ };
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ /** RLM Case 2077
+ * @throws Exception */
+ @Test public void testComplexJoinExpressionsUsingDependentJoin() throws Exception {
+ String sql = "SELECT a.e1, b.e1, b.e2 FROM pm1.g1 a, pm2.g1 b where rtrim(a.e1)=(b.e1 || b.e1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "bb ", "b", new Integer(0) }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2b(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
+ caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
+ caps.setFunctionSupport("||", true); //$NON-NLS-1$
+ caps.setFunctionSupport("rtrim", true); //$NON-NLS-1$
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1();
+ FakeMetadataObject g1 = metadata.getStore().findObject("pm1.g1", FakeMetadataObject.GROUP); //$NON-NLS-1$
+ g1.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY + 1000));
+ FakeMetadataObject g2 = metadata.getStore().findObject("pm2.g1", FakeMetadataObject.GROUP); //$NON-NLS-1$
+ g2.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY - 1));
+
+ Command command = helpParse(sql);
+ CommandContext context = createCommandContext();
+ context.setMetadata(metadata);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder,context);
+
+ //Verify a dependent join (not merge join) was used
+ assertTrue(plan instanceof RelationalPlan);
+ RelationalPlan relationalPlan = (RelationalPlan)plan;
+ RelationalNode project = relationalPlan.getRootNode();
+ RelationalNode join = project.getChildren()[0];
+ assertTrue("Expected instance of JoinNode (for dep join) but got " + join.getClass(), join instanceof JoinNode); //$NON-NLS-1$
+
+ // Run query
+ helpProcess(plan, context, dataManager, expected);
+ }
+
+ /** RLM Case 2077
+ * @throws Exception */
+ @Test public void testComplexJoinExpressionsUsingDependentJoinWithAccessPattern() throws Exception {
+ String sql = "SELECT a.e1, b.e1, b.e2 FROM pm4.g1 a, pm2.g1 b where rtrim(a.e1)=(b.e1 || b.e1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "bb ", "b", new Integer(0) }) //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2b(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
+ caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1));
+ caps.setFunctionSupport("||", true); //$NON-NLS-1$
+ caps.setFunctionSupport("rtrim", true); //$NON-NLS-1$
+ capFinder.addCapabilities("pm4", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1();
+ FakeMetadataObject g1 = metadata.getStore().findObject("pm4.g1", FakeMetadataObject.GROUP); //$NON-NLS-1$
+ g1.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY + 1000));
+ FakeMetadataObject g2 = metadata.getStore().findObject("pm2.g1", FakeMetadataObject.GROUP); //$NON-NLS-1$
+ g2.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY - 1));
+
+ Command command = helpParse(sql);
+ CommandContext context = createCommandContext();
+ context.setMetadata(metadata);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder, context);
+
+ //Verify a dependent join (not merge join) was used
+ assertTrue(plan instanceof RelationalPlan);
+ RelationalPlan relationalPlan = (RelationalPlan)plan;
+ RelationalNode project = relationalPlan.getRootNode();
+ RelationalNode join = project.getChildren()[0];
+ assertTrue("Expected instance of JoinNode (for dep join) but got " + join.getClass(), join instanceof JoinNode); //$NON-NLS-1$
+
+ // Run query
+ helpProcess(plan, context, dataManager, expected);
+ }
+
+ @Test public void testPushingCriteriaUnderJoinButNotToSource() {
+ // Create query
+ String sql = "SELECT A.IntKey AS A_IntKey, B.IntKey AS B_IntKey, C.IntKey AS C_IntKey " + //$NON-NLS-1$
+ "FROM (BQT1.SmallA AS A FULL OUTER JOIN BQT2.SmallA AS B ON A.IntKey = B.IntKey) LEFT OUTER JOIN BQT3.SmallA AS C ON B.IntKey = C.IntKey " + //$NON-NLS-1$
+ "WHERE (sin(A.IntKey) >= 0) " + //$NON-NLS-1$
+ "AND (C.IntKey >= 10)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(13), new Integer(13), new Integer(13) }),
+ Arrays.asList(new Object[] { new Integer(14), new Integer(14), new Integer(14) }),
+ Arrays.asList(new Object[] { new Integer(15), new Integer(15), new Integer(15) }),
+ Arrays.asList(new Object[] { new Integer(19), new Integer(19), new Integer(19) }),
+ Arrays.asList(new Object[] { new Integer(20), new Integer(20), new Integer(20) }),
+ Arrays.asList(new Object[] { new Integer(21), new Integer(21), new Integer(21) }),
+ Arrays.asList(new Object[] { new Integer(26), new Integer(26), new Integer(26) }),
+ Arrays.asList(new Object[] { new Integer(27), new Integer(27), new Integer(27) }),
+ Arrays.asList(new Object[] { new Integer(28), new Integer(28), new Integer(28) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.exampleBQTCached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testPushdownLiteralInSelectUnderAggregate() {
+ String sql = "SELECT COUNT(*) FROM (SELECT '' AS y, a.IntKey FROM BQT1.SmallA a union all select '', b.intkey from bqt1.smallb b) AS x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(30) })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
+ caps.setCapabilitySupport(Capability.QUERY_UNION, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT_STAR, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testPushdownLiteralInSelectWithOrderBy() {
+ String sql = "SELECT 1, concat('a', 'b' ) AS X FROM BQT1.SmallA where intkey = 0 " + //$NON-NLS-1$
+ "UNION ALL " + //$NON-NLS-1$
+ "select 2, 'Hello2' from BQT1.SmallA where intkey = 1 order by X desc"; //$NON-NLS-1$
+
+
+ // Create expected results - would expect these to be:
+ // 1, "ab"
+ // 2, "Hello2"
+ // but our fake tuple source is too dumb to return anything reasonable, so instead get:
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null, null }),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQTSmall(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
+ caps.setCapabilitySupport(Capability.QUERY_UNION, true);
+ caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /** defect 15348
+ * @throws Exception */
+ @Test public void testPreparedStatementDefect15348() throws Exception{
+ String sql = "SELECT e1 from pm1.g1 where myrtrim(?)=e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setFunctionSupport("myrtrim", true); //$NON-NLS-1$
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ FunctionLibrary funcLibrary = new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(new FakeFunctionMetadataSource().getFunctionMethods())));
+ FakeMetadataFacade metadata = new FakeMetadataFacade(FakeMetadataFactory.example1Cached().getStore(), funcLibrary);
+
+ processPreparedStatement(sql, expected, dataManager, capFinder,
+ metadata, Arrays.asList("a "));
+ }
+
+ static void processPreparedStatement(String sql, List[] expected,
+ ProcessorDataManager dataManager, CapabilitiesFinder capFinder,
+ QueryMetadataInterface metadata, List<?> values) throws Exception {
+ Command command = helpParse(sql);
+ CommandContext context = createCommandContext();
+ context.setMetadata(metadata);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder, context);
+
+ // Collect reference, set value
+ VariableContext vc = new VariableContext();
+ Iterator<?> valIter = values.iterator();
+ for (Reference ref : ReferenceCollectorVisitor.getReferences(command)) {
+ vc.setGlobalValue(ref.getContextSymbol(), valIter.next()); //$NON-NLS-1$
+ }
+ context.setVariableContext(vc);
+ // Run query
+ helpProcess(plan, context, dataManager, expected);
+ }
+
+ /** defect 15348
+ * @throws Exception */
+ @Test public void testPreparedStatementDefect15348b() throws Exception{
+ String sql = "SELECT e1 from pm4.g1 where myrtrim(concat(?, 'a '))=e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "aa" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setFunctionSupport("myrtrim", true); //$NON-NLS-1$
+ caps.setFunctionSupport("concat", true); //$NON-NLS-1$
+ capFinder.addCapabilities("pm4", caps); //$NON-NLS-1$
+
+ FunctionLibrary funcLibrary = new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(new FakeFunctionMetadataSource().getFunctionMethods())));
+ FakeMetadataFacade metadata = new FakeMetadataFacade(FakeMetadataFactory.example1Cached().getStore(), funcLibrary);
+
+ processPreparedStatement(sql, expected, dataManager, capFinder,
+ metadata, Arrays.asList("a"));
+ }
+
+ @Test public void testSourceDoesntSupportGroupAlias() {
+ String sql = "SELECT a.IntKey, b.IntKey FROM BQT1.SmallA a, BQT1.SmallB b WHERE a.IntKey = 5 AND A.IntKey = b.IntKey"; //$NON-NLS-1$
+
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ Set atomicQueries = TestOptimizer.getAtomicQueries(plan);
+ assertEquals("Expected one query to get pushed down", 1, atomicQueries.size()); //$NON-NLS-1$
+ String atomicSql = atomicQueries.iterator().next().toString();
+ String expectedSql = "SELECT BQT1.SmallA.IntKey, BQT1.SmallB.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE (BQT1.SmallA.IntKey = BQT1.SmallB.IntKey) AND (BQT1.SmallA.IntKey = 5) AND (BQT1.SmallB.IntKey = 5)"; //$NON-NLS-1$
+ assertEquals(expectedSql, atomicSql);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(5), new Integer(5)}),
+ };
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData(expectedSql, expected);
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testSourceDoesntSupportGroupAliasOrCriteria() {
+ String sql = "SELECT a.IntKey, b.IntKey FROM BQT1.SmallA a, BQT1.SmallB b WHERE a.StringKey = '5' AND A.IntKey = b.IntKey"; //$NON-NLS-1$
+
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ Set atomicQueries = TestOptimizer.getAtomicQueries(plan);
+ assertEquals("Expected 2 queries to get pushed down", 2, atomicQueries.size()); //$NON-NLS-1$
+
+ String expectedSql = "SELECT BQT1.SmallA.StringKey, BQT1.SmallA.IntKey FROM BQT1.SmallA"; //$NON-NLS-1$
+ String expectedSql2 = "SELECT BQT1.SmallB.IntKey FROM BQT1.SmallB"; //$NON-NLS-1$
+ Set expectedQueries = new HashSet();
+ expectedQueries.add(expectedSql);
+ expectedQueries.add(expectedSql2);
+ assertEquals(expectedQueries, atomicQueries);
+
+ List[] input1 = new List[] {
+ Arrays.asList(new Object[] { "5", new Integer(5)}), //$NON-NLS-1$
+ };
+ List[] input2 = new List[] {Arrays.asList(new Object[] {new Integer(5)}),
+ };
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData(expectedSql, input1);
+ dataManager.addData(expectedSql2, input2);
+
+ List[] expected = new List[] {Arrays.asList(new Object[] {new Integer(5), new Integer(5)}),
+ };
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Same as testSourceDoesntSupportGroupAlias, but query is in an inline view and only
+ * the first column is selected.
+ *
+ * @since 4.2
+ */
+ @Test public void testSourceDoesntSupportGroupAliasInVirtual() {
+ String sql = "SELECT x FROM (SELECT a.IntKey as x, b.IntKey as y FROM BQT1.SmallA a, BQT1.SmallB b WHERE a.IntKey = 5 AND A.IntKey = b.IntKey) AS z, BQT2.SmallA WHERE y = IntKey"; //$NON-NLS-1$
+
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ Set atomicQueries = TestOptimizer.getAtomicQueries(plan);
+ assertEquals("Expected 2 queries to get pushed down", 2, atomicQueries.size()); //$NON-NLS-1$
+
+ String expectedSql = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE (BQT1.SmallA.IntKey = BQT1.SmallB.IntKey) AND (BQT1.SmallA.IntKey = 5) AND (BQT1.SmallB.IntKey = 5)"; //$NON-NLS-1$
+ String expectedSql2 = "SELECT BQT2.SmallA.IntKey FROM BQT2.SmallA WHERE BQT2.SmallA.IntKey = 5"; //$NON-NLS-1$
+
+ Set expectedQueries = new HashSet();
+ expectedQueries.add(expectedSql);
+ expectedQueries.add(expectedSql2);
+ assertEquals(expectedQueries, atomicQueries);
+
+ List[] input1 = new List[] {
+ Arrays.asList(new Object[] { new Integer(5), new Integer(5)}),
+ };
+ List[] input2 = new List[] {
+ Arrays.asList(new Object[] { new Integer(5)}),
+ };
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData(expectedSql, input1);
+ dataManager.addData(expectedSql2, input2);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(5)}),
+ };
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCaseInGroupBy() {
+ String sql = "SELECT sum (IntKey), case when IntKey>=5000 then '5000 +' else '0-999' end " + //$NON-NLS-1$
+ "FROM BQT1.SmallA GROUP BY case when IntKey>=5000 then '5000 +' else '0-999' end"; //$NON-NLS-1$
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
+ caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ Set actualQueries = TestOptimizer.getAtomicQueries(plan);
+ String expectedSql = "SELECT SUM(X_1.c_1), X_1.c_0 FROM (SELECT CASE WHEN BQT1.SmallA.IntKey >= 5000 THEN '5000 +' ELSE '0-999' END AS c_0, BQT1.SmallA.IntKey AS c_1 FROM BQT1.SmallA) AS v_0 GROUP BY X_1.c_0"; //$NON-NLS-1$
+ assertEquals(1, actualQueries.size());
+ assertEquals(expectedSql, actualQueries.iterator().next().toString());
+
+ List[] input1 = new List[] {
+ Arrays.asList(new Object[] { new Integer(5), new Integer(10)}),
+ };
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData(expectedSql, input1);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(5), new Integer(10)}),
+ };
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCaseInGroupByAndHavingCantPush() {
+ String sql = "SELECT sum (IntKey), case when IntKey>=5000 then '5000 +' else '0-999' end " + //$NON-NLS-1$
+ "FROM BQT1.SmallA GROUP BY case when IntKey>=5000 then '5000 +' else '0-999' end " + //$NON-NLS-1$
+ "HAVING case when IntKey>=5000 then '5000 +' else '0-999' end = '5000 +'"; //$NON-NLS-1$
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false); // Can't push GROUP BY
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ Set actualQueries = TestOptimizer.getAtomicQueries(plan);
+ String expectedSql = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA"; //$NON-NLS-1$
+ assertEquals(1, actualQueries.size());
+ assertEquals(expectedSql, actualQueries.iterator().next().toString());
+
+ List[] input1 = new List[] {
+ Arrays.asList(new Object[] { new Integer(2)}),
+ Arrays.asList(new Object[] { new Integer(4)}),
+ Arrays.asList(new Object[] { new Integer(10000)}),
+ Arrays.asList(new Object[] { new Integer(10002)}),
+ };
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData(expectedSql, input1);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Long(20002), "5000 +"}), //$NON-NLS-1$
+ };
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCaseInGroupByAndHavingCantPush2() {
+ String sql = "SELECT sum (IntKey), case when IntKey>=5000 then '5000 +' else '0-999' end || 'x' " + //$NON-NLS-1$
+ "FROM BQT1.SmallA GROUP BY case when IntKey>=5000 then '5000 +' else '0-999' end " + //$NON-NLS-1$
+ "HAVING length(case when IntKey>=5000 then '5000 +' else '0-999' end) > 5"; //$NON-NLS-1$
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false); // Can't push GROUP BY
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ Set actualQueries = TestOptimizer.getAtomicQueries(plan);
+ String expectedSql = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA"; //$NON-NLS-1$
+ assertEquals(1, actualQueries.size());
+ assertEquals(expectedSql, actualQueries.iterator().next().toString());
+
+ List[] input1 = new List[] {
+ Arrays.asList(new Object[] { new Integer(2)}),
+ Arrays.asList(new Object[] { new Integer(4)}),
+ Arrays.asList(new Object[] { new Integer(10000)}),
+ Arrays.asList(new Object[] { new Integer(10002)}),
+ };
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData(expectedSql, input1);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Long(20002), "5000 +x"}), //$NON-NLS-1$
+ };
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCaseInGroupByAndHavingCantPush3() {
+ String sql = "SELECT s, c FROM (" + //$NON-NLS-1$
+ "SELECT sum (IntKey) s, case when IntKey>=5000 then '5000 +' else '0-999' end || 'x' c " + //$NON-NLS-1$
+ "FROM BQT1.SmallA GROUP BY case when IntKey>=5000 then '5000 +' else '0-999' end " + //$NON-NLS-1$
+ ") AS x WHERE length(c) > 5 AND s = 20002"; //$NON-NLS-1$
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false); // Can't push GROUP BY
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ Set actualQueries = TestOptimizer.getAtomicQueries(plan);
+ String expectedSql = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA"; //$NON-NLS-1$
+ assertEquals(1, actualQueries.size());
+ assertEquals(expectedSql, actualQueries.iterator().next().toString());
+
+ List[] input1 = new List[] {
+ Arrays.asList(new Object[] { new Integer(2)}),
+ Arrays.asList(new Object[] { new Integer(4)}),
+ Arrays.asList(new Object[] { new Integer(10000)}),
+ Arrays.asList(new Object[] { new Integer(10002)}),
+ };
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData(expectedSql, input1);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Long(20002), "5000 +x"}), //$NON-NLS-1$
+ };
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testFunctionOfAggregateCantPush() {
+ String sql = "SELECT StringKey || 'x', SUM(length(StringKey || 'x')) + 1 AS x FROM BQT1.SmallA GROUP BY StringKey || 'x' HAVING space(MAX(length((StringKey || 'x') || 'y'))) = ' '"; //$NON-NLS-1$
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ Set actualQueries = TestOptimizer.getAtomicQueries(plan);
+ String expectedSql = "SELECT BQT1.SmallA.StringKey FROM BQT1.SmallA"; //$NON-NLS-1$
+ assertEquals(1, actualQueries.size());
+ assertEquals(expectedSql, actualQueries.iterator().next().toString());
+
+ List[] input1 = new List[] {
+ Arrays.asList(new Object[] { "0"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "1"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "10"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "11"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "100"}), //$NON-NLS-1$
+ };
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData(expectedSql, input1);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "0x", new Long(3)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "1x", new Long(3)}), //$NON-NLS-1$
+ };
+ helpProcess(plan, dataManager, expected);
+ }
+
+
+ @Test public void testCase2634() {
+
+ String sql = "SELECT x, IntKey FROM (SELECT IntKey, 'a' AS x FROM BQT1.SmallA UNION ALL SELECT IntKey, 'b' AS x FROM BQT1.SmallB) as Z"; //$NON-NLS-1$
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
+ caps.setCapabilitySupport(Capability.QUERY_UNION, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ Set actualQueries = TestOptimizer.getAtomicQueries(plan);
+ String expectedSql = "SELECT 'a' AS c_0, BQT1.SmallA.IntKey AS c_1 FROM BQT1.SmallA UNION ALL SELECT 'b' AS c_0, BQT1.SmallB.IntKey AS c_1 FROM BQT1.SmallB"; //$NON-NLS-1$
+ assertEquals(1, actualQueries.size());
+ assertEquals(expectedSql, actualQueries.iterator().next().toString());
+
+ List[] input1 = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(1)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(0)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(1)}), //$NON-NLS-1$
+ };
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData(expectedSql, input1);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(0)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(1)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(0)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", new Integer(1)}), //$NON-NLS-1$
+ };
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testQueryWithoutFromWithOrderBy() {
+
+ String sql = "select 'three' as x ORDER BY x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "three"} ), //$NON-NLS-1$
+ };
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testQueryWithoutFromWithOrderBy2() {
+
+ String sql = "select concat('three', ' sixteen') as x ORDER BY x"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "three sixteen"} ), //$NON-NLS-1$
+ };
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testQueryWithoutFromWithOrderBy3() {
+
+ String sql = "SELECT CONCAT('yy', 'z') as c1234567890123456789012345678901234567890, " + //$NON-NLS-1$
+ "CONCAT('21', '12') AS EXPR ORDER BY c1234567890123456789012345678901234567890"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "yyz", "2112"} ), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testCase2507_3(){
+
+ String sql = "SELECT CONCAT('yy', 'z') AS c1234567890123456789012345678901234567890, " + //$NON-NLS-1$
+ "CONCAT('21', '12') AS EXPR ORDER BY c1234567890123456789012345678901234567890"; //$NON-NLS-1$
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
+ caps.setFunctionSupport("concat", true); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql,
+ metadata,
+ null, capFinder,
+ new String[0] ,
+ TestOptimizer.SHOULD_SUCCEED );
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 0, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // Join
+ 0, // MergeJoin
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+
+ // TEST PROCESSING
+
+ List[] expectedResults = new List[] {
+ Arrays.asList(new Object[] { "yyz", "2112"}), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT1(dataManager);
+
+ // Run query
+ helpProcess(plan, dataManager, expectedResults);
+
+ }
+
+ @Test public void testMultiGroupJoinCriteria() {
+
+ String sql = "SELECT X.NEWFIELD FROM " + //$NON-NLS-1$
+ "(SELECT SMALLA.STRINGNUM, " + //$NON-NLS-1$
+ "CASE WHEN SMALLA.STRINGNUM LIKE '1%' THEN SMALLA.INTKEY " + //$NON-NLS-1$
+ "WHEN SMALLA.STRINGNUM LIKE '2%' THEN SMALLB.INTNUM " + //$NON-NLS-1$
+ "WHEN SMALLA.STRINGNUM LIKE '3%' THEN MEDIUMA.INTKEY " + //$NON-NLS-1$
+ "END AS NEWFIELD " + //$NON-NLS-1$
+ "FROM BQT1.SMALLA, BQT1.SMALLB, BQT1.MEDIUMA " + //$NON-NLS-1$
+ "WHERE SMALLA.INTKEY = SMALLB.INTKEY AND SMALLA.INTKEY = MEDIUMA.INTKEY) AS X " + //$NON-NLS-1$
+ "WHERE X.NEWFIELD = -3"; //$NON-NLS-1$
+
+ String expectedAtomic1 = "SELECT BQT1.SMALLB.INTKEY, BQT1.SMALLB.INTNUM FROM BQT1.SMALLB"; //$NON-NLS-1$
+ String expectedAtomic2 = "SELECT BQT1.MEDIUMA.INTKEY FROM BQT1.MEDIUMA"; //$NON-NLS-1$
+ String expectedAtomic3 = "SELECT BQT1.SMALLA.INTKEY, BQT1.SMALLA.STRINGNUM FROM BQT1.SMALLA"; //$NON-NLS-1$
+
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql,
+ metadata,
+ null, capFinder,
+ new String[] {expectedAtomic1, expectedAtomic2, expectedAtomic3} ,
+ TestOptimizer.SHOULD_SUCCEED );
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 3, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // Join
+ 2, // MergeJoin
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+
+ // TEST PROCESSING
+
+ List[] expectedResults = new List[] {
+ Arrays.asList(new Object[] { new Integer(-3) }),
+ };
+
+ // Construct data manager with data
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ List[] input1 = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new Integer(-4)}),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(-3)}),
+ Arrays.asList(new Object[] { new Integer(3), new Integer(-2)}),
+ };
+ dataManager.addData(expectedAtomic1, input1);
+ List[] input2 = new List[] {
+ Arrays.asList(new Object[] { new Integer(1)}),
+ Arrays.asList(new Object[] { new Integer(2)}),
+ Arrays.asList(new Object[] { new Integer(3)}),
+ };
+ dataManager.addData(expectedAtomic2, input2);
+ List[] input3 = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new String("1")}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(2), new String("2")}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(3), new String("3")}), //$NON-NLS-1$
+ };
+ dataManager.addData(expectedAtomic3, input3);
+
+ // Run query
+ helpProcess(plan, dataManager, expectedResults);
+
+ }
+
+ /**
+ * Cross-source join with group by on top but no aggregate functions - running some special cases
+ * where there are no "aggregate groups" (the groups of the aggregate expressions) because there
+ * are no aggregate expressions. In this case, need to switch the aggregate groups to be all the grouping
+ * columns because they are all being "grouped on".
+ *
+ * @since 4.3
+ */
+ @Test public void testDefect18360(){
+
+ String sql = "SELECT a.intkey, a.intnum FROM bqt1.smalla a join bqt2.mediumb b on a.stringkey = b.stringkey " + //$NON-NLS-1$
+ "group by a.intkey, a.intnum"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ capFinder.addCapabilities("BQT1", new BasicSourceCapabilities()); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", new BasicSourceCapabilities()); //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.exampleBQTCached(), capFinder);
+
+ // Construct data manager with data
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ List[] data1 = new List[] {
+ Arrays.asList(new Object[] { "1", new Integer(1), new Integer(5) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "2", new Integer(2), new Integer(6) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "3", new Integer(3), new Integer(7) }), //$NON-NLS-1$
+ };
+ dataManager.addData("SELECT bqt1.smalla.stringkey, bqt1.smalla.intkey, bqt1.smalla.intnum FROM bqt1.smalla", data1); //$NON-NLS-1$
+
+ List[] data2 = new List[] {
+ Arrays.asList(new Object[] { "1" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "2" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "3" }), //$NON-NLS-1$
+ };
+ dataManager.addData("SELECT bqt2.mediumb.stringkey FROM bqt2.mediumb", data2); //$NON-NLS-1$
+
+ // Run query
+ List[] expectedResults = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new Integer(5) }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(6) }),
+ Arrays.asList(new Object[] { new Integer(3), new Integer(7) }),
+ };
+ helpProcess(plan, dataManager, expectedResults);
+
+ }
+
+ @Test public void testDefect17407(){
+ String sql = "select pm1.g1.e1 from pm1.g1, g7 MAKEDEP WHERE pm1.g1.e2=g7.e2 order by e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null}),
+ Arrays.asList(new Object[] { null}),
+ Arrays.asList(new Object[] { "a"}),//$NON-NLS-1$
+ Arrays.asList(new Object[] { "a"}),//$NON-NLS-1$
+ Arrays.asList(new Object[] { "a"}),//$NON-NLS-1$
+ Arrays.asList(new Object[] { "a"}),//$NON-NLS-1$
+ Arrays.asList(new Object[] { "a"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b"}),//$NON-NLS-1$
+ Arrays.asList(new Object[] { "c"}),//$NON-NLS-1$
+ Arrays.asList(new Object[] { "c"}),//$NON-NLS-1$
+ };
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDecodeAsCriteria() {
+ // Create query
+ String sql = "SELECT x.foo, e2 FROM (select decodestring(e1, 'a,q,b,w') as foo, e2 from vm1.g1) as x where x.foo = 'w'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "w", new Integer(2) }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testInputParamInNestedExecParam() {
+ // Create query
+ String sql = "EXEC pm1.vsp48('a')"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testVariableInExecParam() {
+ // Create query
+ String sql = "EXEC pm1.vsp49()"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b", new Integer(2) }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testVariableInNestedExecParam() {
+ // Create query
+ String sql = "EXEC pm1.vsp50()"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testVariableInNestedExecParamInLoop() {
+ // Create query
+ String sql = "EXEC pm1.vsp51()"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "bb" }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testVariableInNestedExecParamInAssignment() {
+ // Create query
+ String sql = "EXEC pm1.vsp52()"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testInputParamInNestedExecParamInLoop() {
+ // Create query
+ String sql = "EXEC pm1.vsp53('b')"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "bb" }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testInputParamInNestedExecParamInAssignment() {
+ // Create query
+ String sql = "EXEC pm1.vsp54('c')"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "c" }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testBitwiseAggregateProc() {
+ // Create query
+ String sql = "EXEC virt.agg()"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(19) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(1), "b", new Integer(4) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(2), "c", new Integer(3) }), //$NON-NLS-1$
+ };
+
+ // Plan query
+ FakeMetadataFacade metadata = FakeMetadataFactory.exampleBitwise();
+ ProcessorPlan plan = helpGetPlan(sql, metadata);
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBitwise(dataManager, metadata);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ private void sampleDataBitwise(FakeDataManager dataMgr, FakeMetadataFacade metadata) {
+ try {
+ // Group pm1.g1
+ FakeMetadataObject groupID = (FakeMetadataObject) metadata.getGroupID("phys.t"); //$NON-NLS-1$
+ List elementIDs = metadata.getElementIDsInGroupID(groupID);
+ List elementSymbols = FakeDataStore.createElements(elementIDs);
+
+ dataMgr.registerTuples(
+ groupID,
+ elementSymbols,
+
+ new List[] {
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(1) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(3) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(16) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(1), "b", new Integer(4) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(2), "c", new Integer(2) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(2), "c", new Integer(1) }), //$NON-NLS-1$
+ } );
+
+ } catch(Throwable e) {
+ e.printStackTrace();
+ fail("Exception building test data (" + e.getClass().getName() + "): " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ @Test public void testFunctionGroupByInJoinCriteria() {
+ // Create query
+ String sql = "SELECT lower(vm1.g1.e1) from vm1.g1, vm1.g2a where vm1.g1.e1 = vm1.g2a.e1 group by lower(vm1.g1.e1)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c" }) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ private FakeMetadataFacade createProjectErrorMetadata() {
+ FakeMetadataObject p1 = FakeMetadataFactory.createPhysicalModel("p1"); //$NON-NLS-1$
+ FakeMetadataObject t1 = FakeMetadataFactory.createPhysicalGroup("p1.t", p1); //$NON-NLS-1$
+ List e1 = FakeMetadataFactory.createElements(t1, new String[] {"a", "b" }, new String[] { "string", "string" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ FakeMetadataObject v1 = FakeMetadataFactory.createVirtualModel("v1"); //$NON-NLS-1$
+ QueryNode n1 = new QueryNode("v1.t1", "SELECT convert(a, integer) as c, b FROM p1.t"); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeMetadataObject vt1 = FakeMetadataFactory.createVirtualGroup("v1.t1", v1, n1); //$NON-NLS-1$
+ List vte1 = FakeMetadataFactory.createElements(vt1, new String[] {"c", "b" }, new String[] { "string", "string" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ QueryNode n2 = new QueryNode("v1.t2", "SELECT convert(a, integer) as c, b FROM p1.t"); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeMetadataObject vt2 = FakeMetadataFactory.createVirtualGroup("v1.t2", v1, n2); //$NON-NLS-1$
+ List vte2 = FakeMetadataFactory.createElements(vt2, new String[] {"c", "b" }, new String[] { "string", "string" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ QueryNode n3 = new QueryNode("v1.u1", "SELECT c, b FROM v1.t1 UNION ALL SELECT c, b FROM v1.t1"); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeMetadataObject vu1 = FakeMetadataFactory.createVirtualGroup("v1.u1", v1, n3); //$NON-NLS-1$
+ List vtu1 = FakeMetadataFactory.createElements(vu1, new String[] {"c", "b" }, new String[] { "string", "string" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ FakeMetadataStore store = new FakeMetadataStore();
+ store.addObject(p1);
+ store.addObject(t1);
+ store.addObjects(e1);
+ store.addObject(v1);
+ store.addObject(vt1);
+ store.addObjects(vte1);
+ store.addObject(vt2);
+ store.addObjects(vte2);
+ store.addObject(vu1);
+ store.addObjects(vtu1);
+ return new FakeMetadataFacade(store);
+ }
+
+ @Test public void testProjectionErrorOverUnionWithConvert() {
+ // Create query
+ FakeMetadataFacade metadata = createProjectErrorMetadata();
+ String sql = "SELECT COUNT(*) FROM v1.u1"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_UNION, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
+ capFinder.addCapabilities("p1", caps); //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(2) }),
+ };
+
+ // Construct data manager with data
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("SELECT g_0.a FROM p1.t AS g_0", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1) })});
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testUpdatesInLoop() {
+ String sql = "update vm1.g39 set e2=3"; //$NON-NLS-1$
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Construct data manager with data
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("SELECT pm1.g1.e2 FROM pm1.g1", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(3) } )});
+ dataManager.addData("UPDATE pm1.g1 SET e2 = 3 WHERE pm1.g1.e2 = 3", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1) } )});
+
+ // Create expected results
+ List[] expected = new List[] { Arrays.asList(new Object[] { new Integer(1)})};
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testRand() {
+ // Create query
+ String sql = "SELECT RAND(E2) FROM pm1.g1 where pm1.g1.e2=3"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] {new Double(0.731057369148862)}),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /*
+ * Prior to case 3994 testInsertTempTableCreation1 worked, but testInsertTempTableCreation did not.
+ * Now they should both pass
+ *
+ */
+ @Test public void testInsertTempTableCreation() {
+ FakeMetadataObject v1 = FakeMetadataFactory.createVirtualModel("v1"); //$NON-NLS-1$
+ QueryNode n1 = new QueryNode("v1.vp", "CREATE VIRTUAL PROCEDURE BEGIN insert into #temp (var1) values (1); select #temp.var1 from #temp; END"); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeMetadataObject rs = FakeMetadataFactory.createResultSet("rs", v1, new String[] { "var1" }, new String[] { DataTypeManager.DefaultDataTypes.INTEGER}); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeMetadataObject paramRS = FakeMetadataFactory.createParameter("ret", 1, ParameterInfo.RESULT_SET, DataTypeManager.DefaultDataTypes.OBJECT, rs); //$NON-NLS-1$
+ FakeMetadataObject vp = FakeMetadataFactory.createVirtualProcedure("v1.vp", v1, Arrays.asList(new Object[] {paramRS}), n1); //$NON-NLS-1$
+
+ FakeMetadataStore store = new FakeMetadataStore();
+ store.addObject(v1);
+ store.addObject(vp);
+
+ ProcessorPlan plan = helpGetPlan("exec v1.vp()", new FakeMetadataFacade(store)); //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1) })
+ };
+ helpProcess(plan, new FakeDataManager(), expected);
+ }
+
+ @Test public void testInsertTempTableCreation1() {
+ FakeMetadataObject v1 = FakeMetadataFactory.createVirtualModel("v1"); //$NON-NLS-1$
+ QueryNode n1 = new QueryNode("v1.vp", "CREATE VIRTUAL PROCEDURE BEGIN insert into #temp (var1) values (1); select 2 as var1 into #temp; select #temp.var1 from #temp; END"); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeMetadataObject rs = FakeMetadataFactory.createResultSet("rs", v1, new String[] { "var1" }, new String[] { DataTypeManager.DefaultDataTypes.INTEGER}); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeMetadataObject paramRS = FakeMetadataFactory.createParameter("ret", 1, ParameterInfo.RESULT_SET, DataTypeManager.DefaultDataTypes.OBJECT, rs); //$NON-NLS-1$
+ FakeMetadataObject vp = FakeMetadataFactory.createVirtualProcedure("v1.vp", v1, Arrays.asList(new Object[] {paramRS}), n1); //$NON-NLS-1$
+
+ FakeMetadataStore store = new FakeMetadataStore();
+ store.addObject(v1);
+ store.addObject(vp);
+
+ ProcessorPlan plan = helpGetPlan("exec v1.vp()", new FakeMetadataFacade(store)); //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(2) })
+ };
+ helpProcess(plan, new FakeDataManager(), expected);
+ }
+
+ @Test public void testCase4531() {
+ String sql = "select intkey, intnum from (select intnum as intkey, 1 as intnum from bqt1.smalla union all select intkey, intnum from bqt1.smalla union all select intkey, intnum from bqt2.smalla) x"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_UNION, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, FakeMetadataFactory.exampleBQTCached(), capFinder);
+
+ // Run query
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(1) }),
+ };
+
+ // Construct data manager with data
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("SELECT g_0.intkey, g_0.intnum FROM bqt2.smalla AS g_0", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1), new Integer(1) })});
+ dataManager.addData("SELECT g_1.intnum AS c_0, 1 AS c_1 FROM bqt1.smalla AS g_1 UNION ALL SELECT g_0.IntKey AS c_0, g_0.IntNum AS c_1 FROM bqt1.smalla AS g_0", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1), new Integer(1) }),
+ Arrays.asList(new Object[] { new Integer(1), new Integer(1) })});
+ helpProcess(plan, dataManager, expected);
+ }
+
+ private void sampleDataBQT2a(FakeDataManager dataMgr) throws Exception {
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ String[] groups = new String[] {"bqt1.smalla", "bqt2.smalla", "bqt3.smalla" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ for(int groupIndex=0; groupIndex<groups.length; groupIndex++) {
+ String groupName = groups[groupIndex];
+
+ List[] tuples = new List[3];
+ for(int row=0; row<tuples.length; row++) {
+ tuples[row] = new ArrayList(17);
+ tuples[row].add(new Integer(row)); //IntKey
+ tuples[row].add(String.valueOf(row)); //StringKey
+ tuples[row].add(new Integer(row)); //IntNum
+ tuples[row].add(String.valueOf(row)); //StringNum
+ for(int col=0; col<10; col++) { //FloatNum, LongNum, DoubleNum, ByteNum, DateValue, TimeValue, TimestampValue, BooleanValue, CharValue, ShortValue
+ tuples[row].add(null);
+ }
+ tuples[row].add(new BigInteger(String.valueOf(row))); //BigIntegerValue
+ tuples[row].add(new BigDecimal(row)); //BigDecimalValue
+ tuples[row].add(null); //ObjectValue
+ }
+ dataMgr.registerTuples(metadata, groupName, tuples);
+ }
+ }
+
+ @Test public void testDefect15355() throws Exception {
+
+ String sql = "SELECT e1, e1 FROM pm1.g1 " //$NON-NLS-1$
+ +"UNION ALL " //$NON-NLS-1$
+ +"SELECT e1, (SELECT e1 FROM pm2.g1 WHERE pm2.g1.e2 = pm1.g2.e2) FROM pm1.g2"; //$NON-NLS-1$
+
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", "a" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "c", "c" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "a", "e" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "b", null }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "d", null }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testDefect15355b() throws Exception {
+
+ String sql = "SELECT StringKey, BigIntegerValue FROM BQT1.SmallA " //$NON-NLS-1$
+ +"UNION ALL " //$NON-NLS-1$
+ +"SELECT StringKey, (SELECT BigIntegerValue FROM BQT3.SmallA WHERE BQT3.SmallA.BigIntegerValue = BQT2.SmallA.StringNum) FROM BQT2.SmallA"; //$NON-NLS-1$
+
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "0", new BigInteger("0") }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "1", new BigInteger("1") }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "2", new BigInteger("2") }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "0", new BigInteger("0") }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "1", new BigInteger("1") }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "2", new BigInteger("2") }), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testDefect15355c() throws Exception {
+
+ String sql = "SELECT StringKey, BigIntegerValue FROM VQT.Defect15355 WHERE StringKey = '0'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "0", new BigInteger("0") }), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testDefect15355d() throws Exception {
+
+ String sql = "SELECT StringKey, BigIntegerValue FROM VQT.Defect15355a WHERE StringKey = '0'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "0", new BigInteger("0") }), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testDefect15355e() throws Exception {
+
+ String sql = "SELECT BigIntegerValue, StringKey FROM VQT.Defect15355 WHERE StringKey = '0'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new BigInteger("0"), "0" }), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testDefect15355f() throws Exception {
+
+ String sql = "SELECT BigIntegerValue FROM VQT.Defect15355 WHERE StringKey = '0'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testDefect15355f2() throws Exception {
+
+ String sql = "SELECT BigIntegerValue FROM VQT.Defect15355 WHERE StringKey LIKE '%0' AND StringKey LIKE '0%'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testDefect15355g() throws Exception {
+
+ String sql = "SELECT BigIntegerValue AS a, BigIntegerValue AS b FROM VQT.Defect15355 WHERE StringKey = '0'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new BigInteger("0"), new BigInteger("0") }), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testDefect15355h() throws Exception {
+
+ String sql = "SELECT BigIntegerValue FROM VQT.Defect15355 WHERE BigIntegerValue = '0'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testDefect15355i() throws Exception {
+
+ String sql = "SELECT BigIntegerValue FROM VQT.Defect15355b WHERE BigIntegerValue = '0'"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2a(dataManager);
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
+ capFinder.addCapabilities("BQT3", caps); //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ /**
+ * The inner most A.e1 was mistakenly getting transformed into pm1.g3.e1
+ */
+ @Test public void testInnerCorrelatedReference() throws Exception {
+
+ String sql = "SELECT DISTINCT A.e1 FROM pm1.g3 AS A WHERE (A.e1 IN (SELECT A.e1 FROM pm1.g3))"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ };
+
+ // Construct data manager with data
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("SELECT DISTINCT g_0.e1 FROM pm1.g3 AS g_0 WHERE g_0.e1 IN (SELECT g_0.e1 FROM pm1.g3 AS g_1)", expected); //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ // Plan query
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
+ caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
+ @Test public void testCase5413() throws Exception {
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ // Plan query
+ String sql = "SELECT e1 FROM pm1.g2 WHERE LOOKUP('pm1.g1','e1', 'e2', 0) = e1";//$NON-NLS-1$
+ QueryMetadataInterface metadata = FakeMetadataFactory.example1Cached();
+ Command command = TestProcessor.helpParse(sql);
+ CommandContext context = createCommandContext();
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder, context);
+
+ // Run query
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a"}), //$NON-NLS-1$
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ FakeDataStore.sampleData2(dataManager);
+
+ helpProcess(plan, context, dataManager, expected);
+ }
+
+ @Test public void testRaiseNullWithSelectInto() {
+ String sql = "select pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 into pm1.g2 from pm1.g1 where (1=0)"; //$NON-NLS-1$
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder());
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 0, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 0, // MergeJoinStrategy
+ 1, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0)}),
+ };
+
+ helpProcess(plan, new FakeDataManager(), expected);
+
+ }
+
+ /*
+ * Test for Case6219
+ */
+ @Test public void testCase6219() {
+ String sql = "SELECT e1 FROM pm1.g1, (SELECT 'ACT' AS StateCode,'A' AS StateAbbrv UNION ALL SELECT 'NSW' AS StateCode, 'N' AS StateAbbrv) AS StateNames_Abbrvs WHERE (pm1.g1.e1 = StateCode) AND ((StateNames_Abbrvs.StateAbbrv || pm1.g1.e1) = 'VVIC')"; //$NON-NLS-1$
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder());
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 0, // Access
+ 1, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 1, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 3, // Project
+ 0, // Select
+ 0, // Sort
+ 1 // UnionAll
+ });
+
+ List[] expected = new List[] {
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+
+ }
+
+ @Test public void testSortWithLimit() {
+ String sql = "select e1 from (select pm1.g1.e1, pm1.g1.e2 from pm1.g1 order by pm1.g1.e1, pm1.g1.e2 limit 1) x"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { null}),
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testSortWithLimit1() {
+ String sql = "select c from (select pm1.g1.e1 a, pm1.g1.e2 b, pm1.g1.e3 c from pm1.g1 order by b limit 1) x"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { Boolean.FALSE}),
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ //note that the e1 column is not used in the source query
+ assertEquals("SELECT pm1.g1.e3, pm1.g1.e2 FROM pm1.g1", manager.getQueries().iterator().next()); //$NON-NLS-1$
+ }
+
+ @Test public void testSortWithLimit2() {
+ String sql = "select a from (select max(e2) a from pm1.g1 group by e2 order by a limit 1) x where a = 0"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) }),
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ /**
+ * A more direct test of 1, where the nested order by is unrelated
+ */
+ @Test public void testSortWithLimit3() {
+ String sql = "select c from (select pm1.g1.e3 c from pm1.g1 order by pm1.g1.e2 limit 1) x"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testSortWithLimit4() {
+ String sql = "select c from (select pm1.g1.e1 a, pm1.g1.e2 b, pm1.g1.e3 c from pm1.g1 order by b limit 1) x"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_ORDERBY_UNRELATED, false);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, new DefaultCapabilitiesFinder(caps));
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { Boolean.FALSE }),
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ assertEquals("SELECT g_0.e3 AS c_0, g_0.e2 AS c_1 FROM pm1.g1 AS g_0 ORDER BY c_1", manager.getQueries().iterator().next()); //$NON-NLS-1$
+ }
+
+ @Test public void testCountWithHaving() {
+ String sql = "select e1, count(*) from pm1.g1 group by e1 having count(*) > 1"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a" , new Integer(3)}), //$NON-NLS-1$
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testLimitZero() {
+ String sql = "select e1 from pm1.g1 limit 0"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ TestOptimizer.checkNodeTypes(plan, TestRuleRaiseNull.FULLY_NULL);
+
+ List[] expected = new List[] {
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testLimitZero1() {
+ String sql = "select distinct vm1.g1.e1, y.e1 from vm1.g1 left outer join (select 1 x, e1 from vm1.g2 limit 0) y on vm1.g1.e1 = y.e1 where vm1.g1.e1 = 'a'"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 1, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 1, // DupRemove
+ 0, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 0, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", null }), //$NON-NLS-1$
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testLimitZero2() {
+ String sql = "select vm1.g1.e1 from vm1.g1 union select e1 from pm1.g2 limit 0"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testLimitZero3() {
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.ROW_LIMIT, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ String sql = "select e1 from pm1.g2 limit 0"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, capFinder);
+
+ List[] expected = new List[] {
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testUnionWithTypeConversion() {
+ String sql = "select pm1.g1.e1, pm1.g1.e2 from pm1.g1 where e1 = 'b' union select e2, e1 from pm1.g2 where e1 = 'b' order by e1, e2"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "2", "b" }), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList(new Object[] { "b", "2" }), //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ /**
+ * Tests non-deterministic evaluation in the select clause.
+ *
+ * The evaluation of the rand function is delayed until processing time (which actually has predictable
+ * values since the test initializes the command context with the same seed)
+ *
+ * If this function were deterministic, it would be evaluated during rewrite to a single value.
+ */
+ @Test public void testNonDeterministicEvaluation() throws Exception {
+ String sql = "select e1, convert(rand()*1000, integer) as x from pm1.g1 where e1 = 'a'"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(240) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(637) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(550) }), //$NON-NLS-1$
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ /**
+ * here the rand function is deterministic and should yield a single value
+ */
+ @Test public void testDeterministicEvaluation() throws Exception {
+ String sql = "select e1, convert(rand(0)*1000, integer) as x from pm1.g1 where e1 = 'a'"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "a", new Integer(730) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(730) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "a", new Integer(730) }), //$NON-NLS-1$
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testEmptyAggregate() throws Exception {
+ String sql = "select count(e1) from pm1.g1 where 1 = 0"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0) })
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testNullAggregate() throws Exception {
+ String sql = "select count(*), count(e1), sum(convert(e1, integer)) from pm1.g1 where e1 is null"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), new Integer(0), null })
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ /**
+ * here the presence of a group by causes no rows to be returned
+ */
+ @Test public void testNullAggregate1() throws Exception {
+ String sql = "select e1 from pm1.g1 where 1 = 0 group by e1"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testReferenceReplacementWithExpression() throws Exception {
+ String sql = "select e1, e2 from (select e1, convert(e2, string) e2 from pm1.g1) x where exists (select e3 from pm1.g2 where x.e2 = e1)"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {};
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ /**
+ * Here a merge join will be used since there is at least one equi join predicate.
+ * TODO: this can be optimized further
+ */
+ @Test public void testCase6193_1() throws Exception {
+ // Create query
+ String sql = "select a.INTKEY, b.intkey from bqt1.smalla a LEFT OUTER JOIN bqt2.SMALLA b on a.intkey=b.intkey and a.intkey=5 where a.intkey <10 "; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ capFinder.addCapabilities("BQT2", caps);
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0), null }),
+ Arrays.asList(new Object[] { new Integer(1), null }),
+ Arrays.asList(new Object[] { new Integer(2), null }),
+ Arrays.asList(new Object[] { new Integer(3), null }),
+ Arrays.asList(new Object[] { new Integer(4), null }),
+ Arrays.asList(new Object[] { new Integer(5), new Integer(5) }),
+ Arrays.asList(new Object[] { new Integer(6), null }),
+ Arrays.asList(new Object[] { new Integer(7), null }),
+ Arrays.asList(new Object[] { new Integer(8), null }),
+ Arrays.asList(new Object[] { new Integer(9), null })
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleDataBQT2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(),
+ new String[] {"SELECT b.intkey FROM bqt2.SMALLA AS b", "SELECT a.intkey FROM bqt1.smalla AS a"}, new DefaultCapabilitiesFinder(), ComparisonMode.CORRECTED_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 2, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 1, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 1, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Here a merge join will be used since there is at least one equi join predicate.
+ */
+ @Test public void testCase6193_2() throws Exception {
+ // Create query
+ String sql = "select a.e2, b.e2 from pm1.g1 a LEFT OUTER JOIN pm1.g2 b on a.e4=b.e4 and (a.e2+b.e2)=4 order by a.e2"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0), null }),
+ Arrays.asList(new Object[] { new Integer(0), null }),
+ Arrays.asList(new Object[] { new Integer(1), null }),
+ Arrays.asList(new Object[] { new Integer(1), null }),
+ Arrays.asList(new Object[] { new Integer(2), new Integer(2) }),
+ Arrays.asList(new Object[] { new Integer(3), null }),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT a.e4, a.e2 FROM pm1.g1 AS a", "SELECT b.e4, b.e2 FROM pm1.g2 AS b"}, new DefaultCapabilitiesFinder(), ComparisonMode.CORRECTED_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 2, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 1, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 1, // Sort
+ 0 // UnionAll
+ });
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * Here a merge join will be used since there is at least one equi join predicate.
+ * The inner merge join is also a dependent join
+ */
+ @Test public void testCase6193_3() throws Exception {
+ // Create query
+ String sql = "select a.x, b.y from (select 4 x union select 1) a LEFT OUTER JOIN (select (a.e2 + b.e2) y from pm1.g1 a LEFT OUTER JOIN pm1.g2 b on a.e4=b.e4) b on (a.x = b.y)"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1), null }),
+ Arrays.asList(new Object[] { new Integer(4), new Integer(4) }),
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT a.e4, a.e2 FROM pm1.g1 AS a", "SELECT b.e4, b.e2 FROM pm1.g2 AS b"}, new DefaultCapabilitiesFinder(), ComparisonMode.CORRECTED_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 2, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 2, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 4, // Project
+ 0, // Select
+ 0, // Sort
+ 1 // UnionAll
+ });
+
+ TestOptimizer.checkDependentJoinCount(plan, 1);
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ /**
+ * This is a control test. It should work regardless of whether the reference is aliased
+ * since accessnodes are now fully positional
+ */
+ @Test public void testPushdownNonAliasedSelectLiteral() throws Exception {
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ List[] expected = new List[] {
+ Arrays.asList("a", "b"), //$NON-NLS-1$ //$NON-NLS-2$
+ Arrays.asList("a", "c") //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ HardcodedDataManager manager = new HardcodedDataManager();
+ manager.addData("SELECT 'a', pm1.g1.e1 FROM pm1.g1", expected); //$NON-NLS-1$
+
+ processPreparedStatement("select ?, e1 from pm1.g1", expected, manager, capFinder,
+ metadata, Arrays.asList("a"));
+ }
+
+ @Test public void testCase6486() {
+ // Create query
+ String sql = "select pm2.g1.e1 from pm1.g2, pm2.g1 where pm1.g2.e1=pm2.g1.e1 group by pm2.g1.e1"; //$NON-NLS-1$
+
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "d"}) //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ // Run query
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testNonPushedOffset() throws Exception {
+ String sql = "SELECT e1 FROM pm1.g1 LIMIT 1, 5"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.ROW_LIMIT, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b"}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "c"}), //$NON-NLS-1$
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData2(dataManager);
+
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(), null, capFinder, new String[] {"SELECT pm1.g1.e1 FROM pm1.g1 LIMIT (5 + 1)"}, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testNonCorrelatedSubQueryExecution() throws Exception {
+ String sql = "SELECT e1 FROM pm1.g1 WHERE e2 IN (SELECT e2 FROM pm2.g1)"; //$NON-NLS-1$
+
+ // Construct data manager with data
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.setBlockOnce(true);
+ dataManager.addData("SELECT pm1.g1.e2, pm1.g1.e1 FROM pm1.g1", new List[] { //$NON-NLS-1$
+ Arrays.asList(Integer.valueOf(1), "a"), //$NON-NLS-1$
+ Arrays.asList(Integer.valueOf(2), "b") //$NON-NLS-1$
+ });
+ dataManager.addData("SELECT pm2.g1.e2 FROM pm2.g1", new List[] { //$NON-NLS-1$
+ Arrays.asList(Integer.valueOf(2))
+ });
+
+ ProcessorPlan plan = helpGetPlan(sql, FakeMetadataFactory.example1Cached());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { "b" }), //$NON-NLS-1$
+ };
+
+ doProcess(plan, dataManager, expected, createCommandContext());
+
+ //we expect 2 queries, 1 for the outer and 1 for the subquery
+ assertEquals(2, dataManager.getCommandHistory().size());
+ }
+
+ /**
+ * Test a query that uses ambiguous alias names in the top level query and
+ * its sub-query and uses columns belonging to the alias as a parameter to a
+ * function.
+ * <p>
+ * For example, <code>SELECT CONVERT(A.e2, biginteger) AS e2 FROM (SELECT
+ * CONVERT(e2, long) AS e2 FROM pm1.g1 AS A) AS A</code>
+ * <p>
+ * The test is to ensure that A.e2 from the top level is not confused with
+ * e2 in the second level.
+ * <p>
+ * Related Defects: JBEDSP-1137
+ */
+ @Test public void testAliasReuseInFunctionInSubQuery() throws Exception {
+ // Create query
+ String sql = "SELECT CONVERT(A.e2, biginteger) AS e2 FROM (" + //$NON-NLS-1$
+ " SELECT CONVERT(e2, long) AS e2 FROM pm1.g1 AS A WHERE e1 = 'a'" + //$NON-NLS-1$
+ ") AS A"; //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, TestOptimizer.getGenericFinder());
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new BigInteger("3") }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new BigInteger("0") }), //$NON-NLS-1$
+ };
+
+ FakeDataManager manager = new FakeDataManager();
+ sampleData1(manager);
+ helpProcess(plan, manager, expected);
+ }
+
+ @Test public void testImplicitAggregateWithInlineView() {
+ String sql = "SELECT * FROM (SELECT b.count, enterprise_id FROM (SELECT COUNT(*), 2 AS enterprise_id FROM (SELECT 'A Name' AS Name, 1 AS enterprise_id) c ) b ) a WHERE enterprise_id = 1"; //$NON-NLS-1$
+
+ List[] expected = new List[] {};
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedNestedTable() {
+ String sql = "select y.e2, x.e1, x.e2 from (select * from pm1.g1) y, table (select * from pm1.g3 where e2 = y.e2) x"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList(0, "a", 0),
+ Arrays.asList(0, "a", 0),
+ Arrays.asList(1, null, 1),
+ Arrays.asList(1, "c", 1),
+ Arrays.asList(3, "a", 3),
+ Arrays.asList(1, null, 1),
+ Arrays.asList(1, "c", 1),
+ Arrays.asList(2, "b", 2),
+ Arrays.asList(0, "a", 0),
+ Arrays.asList(0, "a", 0),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedNestedTable1() {
+ String sql = "select y.e2, z.e2, x.e1, x.e2 from (select * from pm1.g1 order by e2 desc limit 2) y inner join pm1.g2 z on y.e1 = z.e1, table (select * from pm1.g3 where e2 = y.e2 + z.e2) x"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList(3, 0, "a", 3),
+ Arrays.asList(3, 0, "a", 3),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedNestedTable2() {
+ String sql = "select y.e1, x.e1 from (select distinct e1 from pm1.g1 where e1 is not null) y, table (call pm1.sq3b(\"in\" = e1, in3 = 'something')) x"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList("a", "a"),
+ Arrays.asList("a", "a"),
+ Arrays.asList("a", "a"),
+ Arrays.asList("b", "b"),
+ Arrays.asList("c", "c"),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedNestedTable3() {
+ String sql = "select y.e1, x.e1 from (select * from pm1.g1) y left outer join table (call pm1.sq3b(\"in\" = e2, in3 = 'something')) x on (1=1)"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList("a", null),
+ Arrays.asList(null, null),
+ Arrays.asList("a", null),
+ Arrays.asList("c", null),
+ Arrays.asList("b", null),
+ Arrays.asList("a", null),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedNestedTable4() {
+ String sql = "select y.e1, y.e2, z.e2 from (select * from pm1.g1) y inner join table (select * from pm1.g3 where e2 = y.e2) x left outer join (select null as e1, e2 from pm1.g2) z on (x.e1 = z.e1) on (x.e1 = y.e1)"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList("a", 0, null),
+ Arrays.asList("a", 0, null),
+ Arrays.asList("a", 3, null),
+ Arrays.asList("c", 1, null),
+ Arrays.asList("b", 2, null),
+ Arrays.asList("a", 0, null),
+ Arrays.asList("a", 0, null),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedNestedTable5() {
+ String sql = "select y.e1, y.e2, z.e2 from (exec pm1.sq1()) y, table (exec pm1.sq2(y.e1)) x, table (exec pm1.sq2(x.e1)) z where y.e2 = 2"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList("b", 2, 2),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testUncorrelatedScalarSubqueryPushdown() throws Exception {
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ FakeMetadataFacade metadata = example1();
+
+ BasicSourceCapabilities caps = getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, false);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ ProcessorPlan plan = helpPlan("select pm1.g1.e1 from pm1.g1 where e1 < (select max(vm1.g1.e1) from vm1.g1)", metadata, //$NON-NLS-1$
+ null, capFinder,
+ new String[] { "SELECT g_0.e1 FROM pm1.g1 AS g_0 WHERE g_0.e1 < (SELECT MAX(g_1.e1) FROM pm1.g1 AS g_1)" }, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ checkNodeTypes(plan, FULL_PUSHDOWN);
+
+ HardcodedDataManager hdm = new HardcodedDataManager();
+ hdm.addData("SELECT MAX(g_0.e1) FROM pm1.g1 AS g_0", new List[] {Arrays.asList("c")});
+ hdm.addData("SELECT g_0.e1 FROM pm1.g1 AS g_0 WHERE g_0.e1 < 'c'", new List[] {Arrays.asList("a")});
+
+ List[] expected = new List[] {
+ Arrays.asList("a"),
+ };
+
+ helpProcess(plan, hdm, expected);
+ }
+
+ private static final boolean DEBUG = false;
+}
Deleted: tags/teiid-7.1.0.Final/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/hibernate-dialect/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,18 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-hibernate-dialect</artifactId>
- <name>Hibernate Dialect</name>
- <description>Teiid Hibernate Dialect</description>
- <dependencies>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>3.5.2-Final</version>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/hibernate-dialect/pom.xml (from rev 2474, trunk/hibernate-dialect/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/hibernate-dialect/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/hibernate-dialect/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,18 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-hibernate-dialect</artifactId>
+ <name>Hibernate Dialect</name>
+ <description>Teiid Hibernate Dialect</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.5.2-Final</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/jboss-integration/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,142 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-jboss-integration</artifactId>
- <name>teiid-jboss-integration</name>
- <version>7.1.0.Final-SNAPSHOT</version>
- <description>JBoss specific integration layer for teiid</description>
-
- <dependencies>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-runtime</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-cache-jbosscache</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-reflect</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.integration</groupId>
- <artifactId>jboss-profileservice-spi</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-connector</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-aop-mc-int</artifactId>
- <version>2.0.6.GA</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- these for just running profile service remotely -->
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.naming</groupId>
- <artifactId>jnp-client</artifactId>
- <version>5.0.3.GA</version>
- <scope>test</scope>
- </dependency>
-<!--
- <dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <classifier>client</classifier>
- <version>2.1.1.GA</version>
- <scope>test</scope>
- </dependency>
--->
-
- <dependency>
- <groupId>org.jboss.remoting</groupId>
- <artifactId>jboss-remoting</artifactId>
- <version>2.5.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.aspects</groupId>
- <artifactId>jboss-security-aspects</artifactId>
- <version>1.0.0.GA</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.aspects</groupId>
- <artifactId>jboss-remoting-aspects</artifactId>
- <version>1.0.1.GA</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <version>1.3.4-jboss-update1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-server</artifactId>
- <version>5.1.0.GA</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-profileservice</artifactId>
- <version>5.1.0.GA</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
Copied: tags/teiid-7.1.0.Final/jboss-integration/pom.xml (from rev 2474, trunk/jboss-integration/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/jboss-integration/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/jboss-integration/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,142 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-jboss-integration</artifactId>
+ <name>teiid-jboss-integration</name>
+ <version>7.1.0.Final</version>
+ <description>JBoss specific integration layer for teiid</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-runtime</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-cache-jbosscache</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-profileservice-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-connector</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ <version>2.0.6.GA</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- these for just running profile service remotely -->
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.naming</groupId>
+ <artifactId>jnp-client</artifactId>
+ <version>5.0.3.GA</version>
+ <scope>test</scope>
+ </dependency>
+<!--
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <classifier>client</classifier>
+ <version>2.1.1.GA</version>
+ <scope>test</scope>
+ </dependency>
+-->
+
+ <dependency>
+ <groupId>org.jboss.remoting</groupId>
+ <artifactId>jboss-remoting</artifactId>
+ <version>2.5.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.aspects</groupId>
+ <artifactId>jboss-security-aspects</artifactId>
+ <version>1.0.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.aspects</groupId>
+ <artifactId>jboss-remoting-aspects</artifactId>
+ <version>1.0.1.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4-jboss-update1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <version>5.1.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-profileservice</artifactId>
+ <version>5.1.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
Deleted: tags/teiid-7.1.0.Final/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/metadata/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-metadata</artifactId>
- <name>Metadata</name>
- <description>Provides vdb metadata from index files.</description>
-
- <dependencies>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- <type>test-jar</type>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/metadata/pom.xml (from rev 2474, trunk/metadata/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/metadata/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/metadata/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-metadata</artifactId>
+ <name>Metadata</name>
+ <description>Provides vdb metadata from index files.</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ </dependency>
+
+ </dependencies>
+
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/pom.xml
===================================================================
--- trunk/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,520 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid</artifactId>
- <packaging>pom</packaging>
- <name>Teiid</name>
- <version>7.1.0.Final-SNAPSHOT</version>
- <description>Federated SQL and XML query engine.</description>
- <properties>
- <ant.version>1.7.0</ant.version>
- <site.url>http://www.jboss.org/teiid</site.url>
- </properties>
- <scm>
- <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/trunk</developerConnection>
- </scm>
- <licenses>
- <license>
- <name>GNU Lesser General Public License</name>
- <url>http://www.gnu.org/licenses/lgpl.html</url>
- <distribution>repo</distribution>
- <comments>A business-friendly OSS license</comments>
- </license>
- </licenses>
- <url>${site.url}</url>
- <developers>
- <developer>
- <name>Steve Hawkins</name>
- <id>steve</id>
- <email>shawkins(a)redhat.com</email>
- <organization>Red Hat</organization>
- <roles>
- <role>Project Lead</role>
- </roles>
- <timezone>-6</timezone>
- </developer>
- <developer>
- <name>Ramesh Reddy</name>
- <id>ramesh</id>
- <email>rareddy(a)redhat.com</email>
- <organization>Red Hat</organization>
- <roles>
- <role>Project Lead</role>
- </roles>
- <timezone>-6</timezone>
- </developer>
- <developer>
- <name>Van Halbert</name>
- <id>van</id>
- <email>vhalbert(a)redhat.com</email>
- <organization>Red Hat</organization>
- <roles>
- <role>Developer</role>
- </roles>
- <timezone>-6</timezone>
- </developer>
- <developer>
- <name>Ted Jones</name>
- <id>ted</id>
- <email>tejones(a)redhat.com</email>
- <organization>Red Hat</organization>
- <roles>
- <role>Developer</role>
- </roles>
- <timezone>-6</timezone>
- </developer>
- </developers>
- <profiles>
- <profile>
- <!--
- This profile is activated manually, as in "mvn ... -P release ..."
- -->
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-5</version>
- <configuration>
- <descriptors>
- <descriptor>build/assembly/src.xml</descriptor>
- <descriptor>build/assembly/docs.xml</descriptor>
- <descriptor>build/assembly/client-jar.xml</descriptor>
- <descriptor>build/assembly/jboss-container/dist.xml</descriptor>
- <descriptor>build/assembly/adminshell/adminshell-dist.xml</descriptor>
- </descriptors>
- <outputDirectory>target/distribution</outputDirectory>
- <workDirectory>target/assembly/work</workDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <modules>
- <module>build</module>
- <module>documentation</module>
- </modules>
- </profile>
- <profile>
- <!--
- This is to enable faster build for development time.
- -->
- <id>dev</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-5</version>
- <configuration>
- <descriptors>
- <descriptor>build/assembly/client-jar.xml</descriptor>
- <descriptor>build/assembly/jboss-container/dist.xml</descriptor>
- <descriptor>build/assembly/adminshell/adminshell-dist.xml</descriptor>
- </descriptors>
- <outputDirectory>target/distribution</outputDirectory>
- <workDirectory>target/assembly/work</workDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <modules>
- <module>build</module>
- </modules>
- </profile>
- </profiles>
- <build>
- <!-- This section defines the default plugin settings inherited by child projects. -->
- <pluginManagement>
- <plugins>
- <!-- Fixes how test resources of a project can be used in projects dependent on it -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <!-- Specify the compiler options and settings -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <showDeprecation>false</showDeprecation>
- <showWarnings>false</showWarnings>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/*TestCase.java</include>
- <include>**/*Test.java</include>
- <include>**/Test*.java</include>
- </includes>
- <excludes>
- <exclude>**/Abstract*TestCase.java</exclude>
- <!-- hack to prevent anonymous inner classes in Tests from being run as tests -->
- <include>**/Test*$*.java</include>
- </excludes>
- <systemProperties>
- <property>
- <name>user.dir</name>
- <value>${basedir}/target</value>
- </property>
- <property>
- <name>java.io.tmpdir</name>
- <value>${basedir}/target</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- <!--
- Build a test-jar for each project, so that src/test/* resources and classes can be used
- in other projects. Also customize how the jar files are assembled.
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <archive>
- <manifest>
- <addDefaultSpecificationEntries> true</addDefaultSpecificationEntries>
- <addDefaultImplementationEntries> true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <Implementation-URL>${pom.url}</Implementation-URL>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.5</version>
- </plugin>
- </plugins>
- </build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <aggregate>true</aggregate>
- <maxmemory>512m</maxmemory>
- <excludePackageNames>*.internal</excludePackageNames>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
- <repositories>
- <repository>
- <id>jboss-public-repository</id>
- <name>JBoss Public Maven Repository Group</name>
- <url>http://repository.jboss.org/nexus/content/groups/public/</url>
- </repository>
- </repositories>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <dependencyManagement>
- <dependencies>
- <!--
- Declare all dependency versions and default scopes here, but not optional.
- Each module should declare it's direct dependency and possibily overwrite scope/optional.
- -->
-
- <!-- Internal dependencies -->
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <type>test-jar</type>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-console</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-console</artifactId>
- <type>test-jar</type>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <type>test-jar</type>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- <type>test-jar</type>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-metadata</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-metadata</artifactId>
- <type>test-jar</type>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-txn-jbossts</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-cache-jbosscache</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-jboss-integration</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-runtime</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- External dependencies -->
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <version>1.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>logkit</groupId>
- <artifactId>logkit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>jgroups</groupId>
- <artifactId>jgroups</artifactId>
- <version>2.6.10.GA</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <version>3.1.0.GA</version>
- <exclusions>
- <exclusion>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- <version>2.1.0.SP1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-metatype</artifactId>
- <version>2.1.0.SP1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.integration</groupId>
- <artifactId>jboss-profileservice-spi</artifactId>
- <version>5.1.0.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>2.1.2.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-connector</artifactId>
- <version>5.1.0.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-reflect</artifactId>
- <version>2.0.2.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.remoting</groupId>
- <artifactId>jboss-remoting</artifactId>
- <version>2.5.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.saxon</groupId>
- <artifactId>saxon</artifactId>
- <version>9.1.0.8</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.saxon</groupId>
- <artifactId>saxon</artifactId>
- <classifier>dom</classifier>
- <version>9.1.0.8</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.netty</groupId>
- <artifactId>netty</artifactId>
- <version>3.2.0.Final</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- <version>${ant.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <modules>
- <module>common-core</module>
- <module>api</module>
- <module>client</module>
- <module>engine</module>
- <module>connectors</module>
- <module>console</module>
- <module>metadata</module>
- <module>runtime</module>
- <module>adminshell</module>
- <module>cache-jbosscache</module>
- <module>hibernate-dialect</module>
- <module>jboss-integration</module>
- <module>test-integration</module>
- </modules>
- <distributionManagement>
- <repository>
- <id>jboss-releases-repository</id>
- <name>JBoss Releases Repository</name>
- <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
- </repository>
- <snapshotRepository>
- <id>jboss-snapshots-repository</id>
- <name>JBoss Snapshots Repository</name>
- <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
- </snapshotRepository>
- </distributionManagement>
-</project>
Copied: tags/teiid-7.1.0.Final/pom.xml (from rev 2474, trunk/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,520 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid</artifactId>
+ <packaging>pom</packaging>
+ <name>Teiid</name>
+ <version>7.1.0.Final</version>
+ <description>Federated SQL and XML query engine.</description>
+ <properties>
+ <ant.version>1.7.0</ant.version>
+ <site.url>http://www.jboss.org/teiid</site.url>
+ </properties>
+ <scm>
+ <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/tags/teiid-7.1.0.Final</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-7.1.0.Final</developerConnection>
+ </scm>
+ <licenses>
+ <license>
+ <name>GNU Lesser General Public License</name>
+ <url>http://www.gnu.org/licenses/lgpl.html</url>
+ <distribution>repo</distribution>
+ <comments>A business-friendly OSS license</comments>
+ </license>
+ </licenses>
+ <url>${site.url}</url>
+ <developers>
+ <developer>
+ <name>Steve Hawkins</name>
+ <id>steve</id>
+ <email>shawkins(a)redhat.com</email>
+ <organization>Red Hat</organization>
+ <roles>
+ <role>Project Lead</role>
+ </roles>
+ <timezone>-6</timezone>
+ </developer>
+ <developer>
+ <name>Ramesh Reddy</name>
+ <id>ramesh</id>
+ <email>rareddy(a)redhat.com</email>
+ <organization>Red Hat</organization>
+ <roles>
+ <role>Project Lead</role>
+ </roles>
+ <timezone>-6</timezone>
+ </developer>
+ <developer>
+ <name>Van Halbert</name>
+ <id>van</id>
+ <email>vhalbert(a)redhat.com</email>
+ <organization>Red Hat</organization>
+ <roles>
+ <role>Developer</role>
+ </roles>
+ <timezone>-6</timezone>
+ </developer>
+ <developer>
+ <name>Ted Jones</name>
+ <id>ted</id>
+ <email>tejones(a)redhat.com</email>
+ <organization>Red Hat</organization>
+ <roles>
+ <role>Developer</role>
+ </roles>
+ <timezone>-6</timezone>
+ </developer>
+ </developers>
+ <profiles>
+ <profile>
+ <!--
+ This profile is activated manually, as in "mvn ... -P release ..."
+ -->
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-5</version>
+ <configuration>
+ <descriptors>
+ <descriptor>build/assembly/src.xml</descriptor>
+ <descriptor>build/assembly/docs.xml</descriptor>
+ <descriptor>build/assembly/client-jar.xml</descriptor>
+ <descriptor>build/assembly/jboss-container/dist.xml</descriptor>
+ <descriptor>build/assembly/adminshell/adminshell-dist.xml</descriptor>
+ </descriptors>
+ <outputDirectory>target/distribution</outputDirectory>
+ <workDirectory>target/assembly/work</workDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <modules>
+ <module>build</module>
+ <module>documentation</module>
+ </modules>
+ </profile>
+ <profile>
+ <!--
+ This is to enable faster build for development time.
+ -->
+ <id>dev</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-5</version>
+ <configuration>
+ <descriptors>
+ <descriptor>build/assembly/client-jar.xml</descriptor>
+ <descriptor>build/assembly/jboss-container/dist.xml</descriptor>
+ <descriptor>build/assembly/adminshell/adminshell-dist.xml</descriptor>
+ </descriptors>
+ <outputDirectory>target/distribution</outputDirectory>
+ <workDirectory>target/assembly/work</workDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <modules>
+ <module>build</module>
+ </modules>
+ </profile>
+ </profiles>
+ <build>
+ <!-- This section defines the default plugin settings inherited by child projects. -->
+ <pluginManagement>
+ <plugins>
+ <!-- Fixes how test resources of a project can be used in projects dependent on it -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <!-- Specify the compiler options and settings -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <showDeprecation>false</showDeprecation>
+ <showWarnings>false</showWarnings>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ <include>**/*Test.java</include>
+ <include>**/Test*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Abstract*TestCase.java</exclude>
+ <!-- hack to prevent anonymous inner classes in Tests from being run as tests -->
+ <include>**/Test*$*.java</include>
+ </excludes>
+ <systemProperties>
+ <property>
+ <name>user.dir</name>
+ <value>${basedir}/target</value>
+ </property>
+ <property>
+ <name>java.io.tmpdir</name>
+ <value>${basedir}/target</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <!--
+ Build a test-jar for each project, so that src/test/* resources and classes can be used
+ in other projects. Also customize how the jar files are assembled.
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultSpecificationEntries> true</addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries> true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Implementation-URL>${pom.url}</Implementation-URL>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ <maxmemory>512m</maxmemory>
+ <excludePackageNames>*.internal</excludePackageNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ <repositories>
+ <repository>
+ <id>jboss-public-repository</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>http://repository.jboss.org/nexus/content/groups/public/</url>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <dependencyManagement>
+ <dependencies>
+ <!--
+ Declare all dependency versions and default scopes here, but not optional.
+ Each module should declare it's direct dependency and possibily overwrite scope/optional.
+ -->
+
+ <!-- Internal dependencies -->
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <type>test-jar</type>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-console</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-console</artifactId>
+ <type>test-jar</type>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <type>test-jar</type>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ <type>test-jar</type>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-metadata</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-metadata</artifactId>
+ <type>test-jar</type>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-txn-jbossts</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-cache-jbosscache</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-jboss-integration</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-runtime</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- External dependencies -->
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <version>1.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>avalon-framework</groupId>
+ <artifactId>avalon-framework</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ <version>2.6.10.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>3.1.0.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <version>2.1.0.SP1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-metatype</artifactId>
+ <version>2.1.0.SP1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-profileservice-spi</artifactId>
+ <version>5.1.0.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <version>2.1.2.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ <version>2.0.7.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <version>2.0.7.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-connector</artifactId>
+ <version>5.1.0.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.remoting</groupId>
+ <artifactId>jboss-remoting</artifactId>
+ <version>2.5.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <version>9.1.0.8</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <classifier>dom</classifier>
+ <version>9.1.0.8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ <version>3.2.0.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>${ant.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <modules>
+ <module>common-core</module>
+ <module>api</module>
+ <module>client</module>
+ <module>engine</module>
+ <module>connectors</module>
+ <module>console</module>
+ <module>metadata</module>
+ <module>runtime</module>
+ <module>adminshell</module>
+ <module>cache-jbosscache</module>
+ <module>hibernate-dialect</module>
+ <module>jboss-integration</module>
+ <module>test-integration</module>
+ </modules>
+ <distributionManagement>
+ <repository>
+ <id>jboss-releases-repository</id>
+ <name>JBoss Releases Repository</name>
+ <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
+ </repository>
+ <snapshotRepository>
+ <id>jboss-snapshots-repository</id>
+ <name>JBoss Snapshots Repository</name>
+ <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
+ </snapshotRepository>
+ </distributionManagement>
+</project>
Deleted: tags/teiid-7.1.0.Final/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/runtime/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-runtime</artifactId>
- <name>Runtime Engine</name>
- <description>Teiid Runtime Engine</description>
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-metadata</artifactId>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.netty</groupId>
- <artifactId>netty</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.integration</groupId>
- <artifactId>jboss-profileservice-spi</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/runtime/pom.xml (from rev 2474, trunk/runtime/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/runtime/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/runtime/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-runtime</artifactId>
+ <name>Runtime Engine</name>
+ <description>Teiid Runtime Engine</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-metadata</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-profileservice-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/test-integration/common/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid-test-integration</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>test-integration-common</artifactId>
- <name>Common Integration Tests</name>
- <description>Common Integration tests that do not require external dependencies</description>
-
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/test-integration/common/pom.xml (from rev 2474, trunk/test-integration/common/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/test-integration/common/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/test-integration/common/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid-test-integration</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>test-integration-common</artifactId>
+ <name>Common Integration Tests</name>
+ <description>Common Integration tests that do not require external dependencies</description>
+
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/test-integration/db/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,542 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-<!--
- The database dependent tests are meant to be run on their own, not as part of the continous or nightly
- build for Teiid.
--->
-
- <parent>
- <artifactId>teiid-test-integration</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>test-integration-db</artifactId>
-
- <name>DB Dependent Integration Tests</name>
- <groupId>org.jboss.teiid.teiid-test-integration</groupId>
- <description>Integration tests that require external database dependencies </description>
-
- <version>7.1.0.Final-SNAPSHOT</version>
-
- <dependencies>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- </dependency>
-
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <type>test-jar</type>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- <scope>compile</scope>
- </dependency>
-
-
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- <type>test-jar</type>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>test-integration-common</artifactId>
- <type>test-jar</type>
- <scope>compile</scope>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- <version>1.7.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-launcher</artifactId>
- <version>1.7.0</version>
- </dependency>
- <dependency>
- <groupId>ant-contrib</groupId>
- <artifactId>ant-contrib</artifactId>
- <version>1.0b3</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
-
- </dependency>
-
- <dependency>
- <groupId>ant-contrib</groupId>
- <artifactId>cpptasks</artifactId>
- <version>1.0b3</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
-
- <!-- DBUnit dependencies -->
-
- <dependency>
- <groupId>org.dbunit</groupId>
- <artifactId>dbunit</artifactId>
- <version>2.2</version>
- </dependency>
-
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.5.6</version>
- </dependency>
-
-
- <dependency>
- <groupId>org.apache.poi</groupId>
- <artifactId>poi</artifactId>
- <version>3.2-FINAL</version>
- </dependency>
-
- <dependency>
- <groupId>jdom</groupId>
- <artifactId>jdom</artifactId>
- <version>1.0</version>
- </dependency>
-
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>${postgresql.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>${derby.version}</version>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>${mysql.connector.version}</version>
- </dependency>
-
- </dependencies>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
-
- <build>
- <plugins>
- <!-- Specify the compiler options and settings -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <showDeprecation>false</showDeprecation>
- <showWarnings>false</showWarnings>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-2</version>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/binaries.xml</descriptor>
- </descriptors>
- <outputDirectory>target/distribution</outputDirectory>
- <workDirectory>target/assembly/work</workDirectory>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
-
- <profile>
- <id>runalltests</id>
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <additionalClasspathElements>
- <additionalClasspathElement>${basedir}/lib/ojdbc6.jar</additionalClasspathElement>
- <additionalClasspathElement>${basedir}/lib/sqljdbc4.jar</additionalClasspathElement>
- <additionalClasspathElement>${basedir}/lib/db2jcc4.jar</additionalClasspathElement>
-
- </additionalClasspathElements>
- <systemProperties>
- <property>
- <name>usedatasources</name>
- <value>${usedatasources}</value>
- </property>
- <property>
- <name>datasourceloc</name>
- <value>${datasourceloc}</value>
- </property>
- </systemProperties>
-
-<!--
-<forkMode>always</forkMode>
- <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
- -->
- <includes>
- <!-- <include>**/*TestCase.java</include> -->
- <include>**/*Test.java</include>
- <include>**/*Tests.java</include>
- <include>**/Test*.java</include>
- </includes>
- <excludes>
- <exclude>**/*Abstract*TestCase.java</exclude>
- <exclude>**/*Abstract*Test.java</exclude>
- <!-- hack to prevent anonymous inner classes in Tests from being run as tests -->
- <exclude>**/Test*$*.java</exclude>
- </excludes>
-
- </configuration>
- </plugin>
-
- </plugins>
-
- </build>
-
-<!-- <version>2.4.2</version> -->
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
-
- <configuration>
- <outputDirectory>${basedir}/target/newsite</outputDirectory>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
- </profile>
-
- <profile>
- <id>runsingletest</id>
- <activation>
- <property>
- <name>classname</name>
- </property>
- </activation>
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <additionalClasspathElements>
- <additionalClasspathElement>${basedir}/lib/ojdbc6.jar</additionalClasspathElement>
- <additionalClasspathElement>${basedir}/lib/sqljdbc4.jar</additionalClasspathElement>
- <additionalClasspathElement>${basedir}/lib/db2jcc4.jar</additionalClasspathElement>
- </additionalClasspathElements>
- <systemProperties>
- <property>
- <name>usedatasources</name>
- <value>${usedatasources}</value>
- </property>
- <property>
- <name>datasourceloc</name>
- <value>${datasourceloc}</value>
- </property>
- </systemProperties>
-
-<!--
- <forkMode>always</forkMode>
-
- <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
- -->
- <includes>
- <include>**/${classname}.java</include>
- </includes>
-
- </configuration>
- </plugin>
-
- </plugins>
- </build>
- </profile>
-
-
- <profile>
- <id>setupdatasources</id>
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- <version>${apache.ant.version}</version>
- </dependency>
- </dependencies>
- <configuration>
- </configuration>
- <executions>
- <execution>
- <id>setupalldatasources</id>
- <phase>pre-integration-test</phase>
- <configuration>
- <tasks>
- <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
- <property name="relative.resources.dir" value="src/main/resources" />
- <property name="datasourceloc" value="${datasourceloc}" />
- <ant antfile="src/main/resources/ddl/manage_schemas.xml" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
-
- </plugins>
- </build>
- </profile>
- <profile>
- <id>singledatasource</id>
- <activation>
- <property>
- <name>datasource</name>
- </property>
- </activation>
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- <version>${apache.ant.version}</version>
- </dependency>
- </dependencies>
- <configuration>
-
- </configuration>
- <executions>
- <execution>
- <id>setupsingledatasource</id>
- <phase>pre-integration-test</phase>
- <configuration>
- <tasks>
-
- <property name="single" value="${datasource}" />
- <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
- <property name="datasourceloc" value="${datasourceloc}" />
-
- <property name="relative.resources.dir" value="src/main/resources" />
- <ant antfile="src/main/resources/ddl/manage_schemas.xml" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
-
- </plugins>
- </build>
- </profile>
-
-
- <profile>
- <id>runclienttests</id>
- <activation>
- <property>
- <name>scenario.dir</name>
- </property>
- </activation>
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- <version>${apache.ant.version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>run-client-test</id>
- <phase>integration-test</phase>
- <configuration>
- <tasks>
-
- <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
- <property name="scenario.dir" value="${scenario.dir}" />
- <property name="queryset.artifacts.dir" value="${queryset.artifacts.dir}" />
- <property name="vdb.artifacts.dir" value="${vdb.artifacts.dir}" />
- <!-- optional properties -->
- <property name="config.file" value="${config.file}" />
- <property name="query.scenario.classname" value="${query.scenario.classname}" />
- <property name="proj.dir" value="${project.basedir}/target/" />
- <property name="usedatasources" value="${usedatasources}" />
- <property name="datasourceloc" value="${datasourceloc}" />
-
- <ant antfile="src/main/resources/ctc_tests/ctc.xml" />
-
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
- </plugins>
- </build>
-
- </profile>
-
- <profile>
- <id>assemble</id>
-<!-- assemble will compile, but not run the tests prior to assemblying the kit -->
-
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-2</version>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/binaries.xml</descriptor>
- </descriptors>
- <outputDirectory>target/distribution</outputDirectory>
- <workDirectory>target/work/assembly</workDirectory>
-
- </configuration>
- <executions>
-
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
-
- </profiles>
-
-
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/test-integration/db/pom.xml (from rev 2474, trunk/test-integration/db/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/test-integration/db/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/test-integration/db/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,542 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!--
+ The database dependent tests are meant to be run on their own, not as part of the continous or nightly
+ build for Teiid.
+-->
+
+ <parent>
+ <artifactId>teiid-test-integration</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>test-integration-db</artifactId>
+
+ <name>DB Dependent Integration Tests</name>
+ <groupId>org.jboss.teiid.teiid-test-integration</groupId>
+ <description>Integration tests that require external database dependencies </description>
+
+ <version>7.1.0.Final</version>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <type>test-jar</type>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ <scope>compile</scope>
+ </dependency>
+
+
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ <type>test-jar</type>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>test-integration-common</artifactId>
+ <type>test-jar</type>
+ <scope>compile</scope>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>1.7.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-launcher</artifactId>
+ <version>1.7.0</version>
+ </dependency>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>ant-contrib</artifactId>
+ <version>1.0b3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+
+ </dependency>
+
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>cpptasks</artifactId>
+ <version>1.0b3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+
+ <!-- DBUnit dependencies -->
+
+ <dependency>
+ <groupId>org.dbunit</groupId>
+ <artifactId>dbunit</artifactId>
+ <version>2.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.6</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.apache.poi</groupId>
+ <artifactId>poi</artifactId>
+ <version>3.2-FINAL</version>
+ </dependency>
+
+ <dependency>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>${postgresql.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derby.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql.connector.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+
+ <build>
+ <plugins>
+ <!-- Specify the compiler options and settings -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <showDeprecation>false</showDeprecation>
+ <showWarnings>false</showWarnings>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/binaries.xml</descriptor>
+ </descriptors>
+ <outputDirectory>target/distribution</outputDirectory>
+ <workDirectory>target/assembly/work</workDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+
+ <profile>
+ <id>runalltests</id>
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <additionalClasspathElements>
+ <additionalClasspathElement>${basedir}/lib/ojdbc6.jar</additionalClasspathElement>
+ <additionalClasspathElement>${basedir}/lib/sqljdbc4.jar</additionalClasspathElement>
+ <additionalClasspathElement>${basedir}/lib/db2jcc4.jar</additionalClasspathElement>
+
+ </additionalClasspathElements>
+ <systemProperties>
+ <property>
+ <name>usedatasources</name>
+ <value>${usedatasources}</value>
+ </property>
+ <property>
+ <name>datasourceloc</name>
+ <value>${datasourceloc}</value>
+ </property>
+ </systemProperties>
+
+<!--
+<forkMode>always</forkMode>
+ <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
+ -->
+ <includes>
+ <!-- <include>**/*TestCase.java</include> -->
+ <include>**/*Test.java</include>
+ <include>**/*Tests.java</include>
+ <include>**/Test*.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Abstract*TestCase.java</exclude>
+ <exclude>**/*Abstract*Test.java</exclude>
+ <!-- hack to prevent anonymous inner classes in Tests from being run as tests -->
+ <exclude>**/Test*$*.java</exclude>
+ </excludes>
+
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
+
+<!-- <version>2.4.2</version> -->
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+
+ <configuration>
+ <outputDirectory>${basedir}/target/newsite</outputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+
+ <profile>
+ <id>runsingletest</id>
+ <activation>
+ <property>
+ <name>classname</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <additionalClasspathElements>
+ <additionalClasspathElement>${basedir}/lib/ojdbc6.jar</additionalClasspathElement>
+ <additionalClasspathElement>${basedir}/lib/sqljdbc4.jar</additionalClasspathElement>
+ <additionalClasspathElement>${basedir}/lib/db2jcc4.jar</additionalClasspathElement>
+ </additionalClasspathElements>
+ <systemProperties>
+ <property>
+ <name>usedatasources</name>
+ <value>${usedatasources}</value>
+ </property>
+ <property>
+ <name>datasourceloc</name>
+ <value>${datasourceloc}</value>
+ </property>
+ </systemProperties>
+
+<!--
+ <forkMode>always</forkMode>
+
+ <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
+ -->
+ <includes>
+ <include>**/${classname}.java</include>
+ </includes>
+
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+
+ <profile>
+ <id>setupdatasources</id>
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>${apache.ant.version}</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ </configuration>
+ <executions>
+ <execution>
+ <id>setupalldatasources</id>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <tasks>
+ <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
+ <property name="relative.resources.dir" value="src/main/resources" />
+ <property name="datasourceloc" value="${datasourceloc}" />
+ <ant antfile="src/main/resources/ddl/manage_schemas.xml" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>singledatasource</id>
+ <activation>
+ <property>
+ <name>datasource</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>${apache.ant.version}</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+
+ </configuration>
+ <executions>
+ <execution>
+ <id>setupsingledatasource</id>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <tasks>
+
+ <property name="single" value="${datasource}" />
+ <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
+ <property name="datasourceloc" value="${datasourceloc}" />
+
+ <property name="relative.resources.dir" value="src/main/resources" />
+ <ant antfile="src/main/resources/ddl/manage_schemas.xml" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+
+ </plugins>
+ </build>
+ </profile>
+
+
+ <profile>
+ <id>runclienttests</id>
+ <activation>
+ <property>
+ <name>scenario.dir</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>${apache.ant.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>run-client-test</id>
+ <phase>integration-test</phase>
+ <configuration>
+ <tasks>
+
+ <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
+ <property name="scenario.dir" value="${scenario.dir}" />
+ <property name="queryset.artifacts.dir" value="${queryset.artifacts.dir}" />
+ <property name="vdb.artifacts.dir" value="${vdb.artifacts.dir}" />
+ <!-- optional properties -->
+ <property name="config.file" value="${config.file}" />
+ <property name="query.scenario.classname" value="${query.scenario.classname}" />
+ <property name="proj.dir" value="${project.basedir}/target/" />
+ <property name="usedatasources" value="${usedatasources}" />
+ <property name="datasourceloc" value="${datasourceloc}" />
+
+ <ant antfile="src/main/resources/ctc_tests/ctc.xml" />
+
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ </profile>
+
+ <profile>
+ <id>assemble</id>
+<!-- assemble will compile, but not run the tests prior to assemblying the kit -->
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/binaries.xml</descriptor>
+ </descriptors>
+ <outputDirectory>target/distribution</outputDirectory>
+ <workDirectory>target/work/assembly</workDirectory>
+
+ </configuration>
+ <executions>
+
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
+
+</project>
\ No newline at end of file
Deleted: tags/teiid-7.1.0.Final/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2010-08-17 16:26:28 UTC (rev 2470)
+++ tags/teiid-7.1.0.Final/test-integration/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>teiid</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-test-integration</artifactId>
- <packaging>pom</packaging>
- <name>Integration Tests</name>
- <description>Integration tests spanning server/embedded/connectors.</description>
-
- <properties>
- <derby.version>10.2.1.6</derby.version>
- <mysql.connector.version>5.1.5</mysql.connector.version>
- <postgresql.version>8.3-603.jdbc3</postgresql.version>
-
- <apache.ant.version>1.7.0</apache.ant.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-metadata</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-metadata</artifactId>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid.connectors</groupId>
- <artifactId>translator-jdbc</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-engine</artifactId>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-adminshell</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-runtime</artifactId>
- </dependency>
-
- <!-- external dependencies -->
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>${derby.version}</version>
-
- </dependency>
-
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <modules>
- <module>common</module>
- <module>db</module>
- </modules>
-</project>
\ No newline at end of file
Copied: tags/teiid-7.1.0.Final/test-integration/pom.xml (from rev 2474, trunk/test-integration/pom.xml)
===================================================================
--- tags/teiid-7.1.0.Final/test-integration/pom.xml (rev 0)
+++ tags/teiid-7.1.0.Final/test-integration/pom.xml 2010-08-17 18:13:00 UTC (rev 2475)
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.0.Final</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-test-integration</artifactId>
+ <packaging>pom</packaging>
+ <name>Integration Tests</name>
+ <description>Integration tests spanning server/embedded/connectors.</description>
+
+ <properties>
+ <derby.version>10.2.1.6</derby.version>
+ <mysql.connector.version>5.1.5</mysql.connector.version>
+ <postgresql.version>8.3-603.jdbc3</postgresql.version>
+
+ <apache.ant.version>1.7.0</apache.ant.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-metadata</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-metadata</artifactId>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>translator-jdbc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client</artifactId>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-engine</artifactId>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-adminshell</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-runtime</artifactId>
+ </dependency>
+
+ <!-- external dependencies -->
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derby.version}</version>
+
+ </dependency>
+
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <modules>
+ <module>common</module>
+ <module>db</module>
+ </modules>
+</project>
\ No newline at end of file
14 years, 4 months
teiid SVN: r2474 - in trunk: adminshell and 35 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-17 14:11:01 -0400 (Tue, 17 Aug 2010)
New Revision: 2474
Modified:
trunk/adminshell/pom.xml
trunk/api/pom.xml
trunk/build/pom.xml
trunk/cache-jbosscache/pom.xml
trunk/client/pom.xml
trunk/common-core/pom.xml
trunk/connectors/connector-file/pom.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-ws/pom.xml
trunk/connectors/pom.xml
trunk/connectors/salesforce-api/pom.xml
trunk/connectors/sandbox/pom.xml
trunk/connectors/sandbox/translator-yahoo/pom.xml
trunk/connectors/translator-file/pom.xml
trunk/connectors/translator-jdbc/pom.xml
trunk/connectors/translator-ldap/pom.xml
trunk/connectors/translator-loopback/pom.xml
trunk/connectors/translator-salesforce/pom.xml
trunk/connectors/translator-ws/pom.xml
trunk/console/pom.xml
trunk/documentation/admin-guide/pom.xml
trunk/documentation/caching-guide/pom.xml
trunk/documentation/client-developers-guide/pom.xml
trunk/documentation/developer-guide/pom.xml
trunk/documentation/pom.xml
trunk/documentation/quick-start-example/pom.xml
trunk/documentation/reference/pom.xml
trunk/engine/pom.xml
trunk/hibernate-dialect/pom.xml
trunk/jboss-integration/pom.xml
trunk/metadata/pom.xml
trunk/pom.xml
trunk/runtime/pom.xml
trunk/test-integration/common/pom.xml
trunk/test-integration/db/pom.xml
trunk/test-integration/pom.xml
Log:
[maven-release-plugin] prepare release teiid-7.1.0.Final
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/adminshell/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/api/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/build/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>build</artifactId>
Modified: trunk/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/cache-jbosscache/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-cache-jbosscache</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/client/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/common-core/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-core</artifactId>
Modified: trunk/connectors/connector-file/pom.xml
===================================================================
--- trunk/connectors/connector-file/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/connector-file/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-file</artifactId>
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/connector-ldap/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/connector-salesforce/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: trunk/connectors/connector-ws/pom.xml
===================================================================
--- trunk/connectors/connector-ws/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/connector-ws/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/connectors/salesforce-api/pom.xml
===================================================================
--- trunk/connectors/salesforce-api/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/salesforce-api/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: trunk/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/sandbox/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.connectors</groupId>
Modified: trunk/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-yahoo</artifactId>
Modified: trunk/connectors/translator-file/pom.xml
===================================================================
--- trunk/connectors/translator-file/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/translator-file/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Modified: trunk/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/translator-jdbc/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jdbc</artifactId>
Modified: trunk/connectors/translator-ldap/pom.xml
===================================================================
--- trunk/connectors/translator-ldap/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/translator-ldap/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ldap</artifactId>
Modified: trunk/connectors/translator-loopback/pom.xml
===================================================================
--- trunk/connectors/translator-loopback/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/translator-loopback/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Modified: trunk/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/translator-salesforce/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-salesforce</artifactId>
Modified: trunk/connectors/translator-ws/pom.xml
===================================================================
--- trunk/connectors/translator-ws/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/connectors/translator-ws/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/console/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/documentation/admin-guide/pom.xml
===================================================================
--- trunk/documentation/admin-guide/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/documentation/admin-guide/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>admin-guide</artifactId>
Modified: trunk/documentation/caching-guide/pom.xml
===================================================================
--- trunk/documentation/caching-guide/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/documentation/caching-guide/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -1,9 +1,8 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>caching-guide</artifactId>
Modified: trunk/documentation/client-developers-guide/pom.xml
===================================================================
--- trunk/documentation/client-developers-guide/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/documentation/client-developers-guide/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>client-developers-guide</artifactId>
Modified: trunk/documentation/developer-guide/pom.xml
===================================================================
--- trunk/documentation/developer-guide/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/documentation/developer-guide/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>developer-guide</artifactId>
Modified: trunk/documentation/pom.xml
===================================================================
--- trunk/documentation/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/documentation/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/documentation/quick-start-example/pom.xml
===================================================================
--- trunk/documentation/quick-start-example/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/documentation/quick-start-example/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-example</artifactId>
Modified: trunk/documentation/reference/pom.xml
===================================================================
--- trunk/documentation/reference/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/documentation/reference/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>reference</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/engine/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/hibernate-dialect/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/jboss-integration/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -2,13 +2,13 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-jboss-integration</artifactId>
<name>teiid-jboss-integration</name>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
<description>JBoss specific integration layer for teiid</description>
<dependencies>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/metadata/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -5,15 +5,15 @@
<artifactId>teiid</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
<site.url>http://www.jboss.org/teiid</site.url>
</properties>
<scm>
- <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/trunk</developerConnection>
+ <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/tags/teiid-7.1.0.Final</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-7.1.0.Final</developerConnection>
</scm>
<licenses>
<license>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/runtime/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/test-integration/common/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-integration-common</artifactId>
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/test-integration/db/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -19,7 +19,7 @@
<groupId>org.jboss.teiid.teiid-test-integration</groupId>
<description>Integration tests that require external database dependencies </description>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
<dependencies>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2010-08-17 17:57:14 UTC (rev 2473)
+++ trunk/test-integration/pom.xml 2010-08-17 18:11:01 UTC (rev 2474)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.1.0.Final-SNAPSHOT</version>
+ <version>7.1.0.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
14 years, 4 months
teiid SVN: r2473 - trunk/build/kits/jboss-container.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-17 13:57:14 -0400 (Tue, 17 Aug 2010)
New Revision: 2473
Modified:
trunk/build/kits/jboss-container/teiid-releasenotes.html
Log:
final(er) update of release notes
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2010-08-17 17:52:41 UTC (rev 2472)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2010-08-17 17:57:14 UTC (rev 2473)
@@ -216,6 +216,8 @@
</li>
<li>[<a href='https://jira.jboss.org/browse/TEIID-1208'>TEIID-1208</a>] - VDB "getStatus" through Admin API always returning "INACTIVE"
</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1216'>TEIID-1216</a>] - Cannot pass xml result from one select as critera to another select
+</li>
</ul>
<h2> Feature Request
14 years, 4 months
teiid SVN: r2472 - in trunk/engine/src: test/java/org/teiid/query/processor and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-17 13:52:41 -0400 (Tue, 17 Aug 2010)
New Revision: 2472
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
Log:
TEIID-1216 fix for nested table correlated references not getting picked up with a nested join
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-08-17 17:12:03 UTC (rev 2471)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-08-17 17:52:41 UTC (rev 2472)
@@ -706,7 +706,7 @@
private SymbolMap getCorrelatedReferences(PlanNode parent, PlanNode node,
LanguageObject lo) {
PlanNode rootJoin = parent;
- while (rootJoin.getParent() != null && rootJoin.getParent().getType() == NodeConstants.Types.JOIN) {
+ while (rootJoin.getParent() != null && rootJoin.getParent().getType() == NodeConstants.Types.JOIN && !rootJoin.getParent().getGroups().isEmpty()) {
rootJoin = rootJoin.getParent();
}
List<Reference> correlatedReferences = new ArrayList<Reference>();
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2010-08-17 17:12:03 UTC (rev 2471)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2010-08-17 17:52:41 UTC (rev 2472)
@@ -7485,6 +7485,21 @@
helpProcess(plan, dataManager, expected);
}
+ @Test public void testCorrelatedNestedTable5() {
+ String sql = "select y.e1, y.e2, z.e2 from (exec pm1.sq1()) y, table (exec pm1.sq2(y.e1)) x, table (exec pm1.sq2(x.e1)) z where y.e2 = 2"; //$NON-NLS-1$
+
+ List[] expected = new List[] {
+ Arrays.asList("b", 2, 2),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), FakeMetadataFactory.example1Cached());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
@Test public void testUncorrelatedScalarSubqueryPushdown() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
FakeMetadataFacade metadata = example1();
14 years, 4 months
teiid SVN: r2471 - trunk/build/kits/jboss-container.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-17 13:12:03 -0400 (Tue, 17 Aug 2010)
New Revision: 2471
Modified:
trunk/build/kits/jboss-container/teiid-releasenotes.html
Log:
final update of release notes
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2010-08-17 16:26:28 UTC (rev 2470)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2010-08-17 17:12:03 UTC (rev 2471)
@@ -30,7 +30,7 @@
to use Teiid's ODBC access.
<LI><B>Native Materialized Tables</B> - views marked as materialized without a target table will be materialized internally by Teiid. Materialized view tables will
be indexed by the primary key of the view if present and can be controlled through the expanded cache hint.
- There are also new system procedures refreshMatView and refreshMatViewRow to refresh materialized view contents.
+ There are also new system procedures refreshMatView and refreshMatViewRow to refresh internal materialized view contents.
<LI><B>Expanded Cache Hint</B> - The cache hint can now specify pref_mem to indicate that data should prefer to be held in memory, ttl to indicate the time-to-live,
and updatable to indicate that a materialized view with a primary key can be updated by row with the refreshMatViewRow system procedure.
<LI><B>SQL Support</B>
@@ -154,8 +154,173 @@
</ul>
<h2><a name="Details">Detailed Release Notes</a></h2>
- Detailed Release Notes - Teiid - Version 7.1
+ Detailed Release Notes - Teiid - Version ${project.version}
+<h2> Bug
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-76'>TEIID-76</a>] - Attempting to execute a procedure from MM to MM returns error "<procedure>() does not exist"
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-108'>TEIID-108</a>] - xsd type conversion should be consistent
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1107'>TEIID-1107</a>] - Add support for raising criteria if it has been pushed too far
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1140'>TEIID-1140</a>] - Unnecessary jars in the Teiid deployment
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1141'>TEIID-1141</a>] - getCatalogs call on DatabaseMetadata is returning no rows
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1144'>TEIID-1144</a>] - PostgreSQL (simple capabilities) returning an unexpected number of rows
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1145'>TEIID-1145</a>] - Unable to deploy VDB with virtual BQT2 model
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1147'>TEIID-1147</a>] - Sybase concat function handling
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1149'>TEIID-1149</a>] - Importing tables from a deployed VDB does not import columns
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1152'>TEIID-1152</a>] - Jopr Plugin Needs to Handle Secure ProfileService Connection
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1153'>TEIID-1153</a>] - Turned of ProfileService authenticatiion and it caused an NPE in the Teiid RHQ Plugin
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1157'>TEIID-1157</a>] - NPE with texttable planning
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1166'>TEIID-1166</a>] - Receiving ASSERTION FAILED: expected reference to be not null from SQL query with sub-select
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1169'>TEIID-1169</a>] - VDBs are not being displayed in Jopr
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1172'>TEIID-1172</a>] - Loopback translator fails to be invoked when a property is set
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1178'>TEIID-1178</a>] - Jopr VDB loading error when Data Source is not available
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1180'>TEIID-1180</a>] - the deprecated input group qualifier should be replaced with inputs
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1181'>TEIID-1181</a>] - Teiid Pushdown queries producing unexpected results (Sybase 12.5)
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1182'>TEIID-1182</a>] - UDF model is not being loaded if the file is not placed in the root location of VDB
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1183'>TEIID-1183</a>] - Cannot create a SalesForce datasource throught the admin API.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1185'>TEIID-1185</a>] - Shutting down JBoss AS server causes NPE in ClusterableCacheFactory
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1186'>TEIID-1186</a>] - broken internal link in Teiid Reference Documentation
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1188'>TEIID-1188</a>] - Error while reading the template properties for LDAP
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1192'>TEIID-1192</a>] - JDBC driver doesn't accept underscores _ in server names
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1200'>TEIID-1200</a>] - Non-parsable SQL in transformation provides no help to user - NPE in stack trace
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1201'>TEIID-1201</a>] - Property 'Url' with value 'vfsfile:/home/pnittel/Teiid71/jboss-5.1.0.GA/server/default/deploy/EyeTuneZ-vdb.xml' is not a valid URL
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1203'>TEIID-1203</a>] - "connector-ws" is not visible as one of the avaialble connectors
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1206'>TEIID-1206</a>] - NPE during the JDBC Metadata read when "resultSetCacheMode=true" turned on
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1208'>TEIID-1208</a>] - VDB "getStatus" through Admin API always returning "INACTIVE"
+</li>
+</ul>
+
+<h2> Feature Request
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-168'>TEIID-168</a>] - Refine caching behavior
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-250'>TEIID-250</a>] - Enable Axis data compression in SFDC Connector, per SFDC API guidelines
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-715'>TEIID-715</a>] - Add support for nulls first/last
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-829'>TEIID-829</a>] - revamp code table caching
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-860'>TEIID-860</a>] - Add odbc support
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-886'>TEIID-886</a>] - Request for more statistical functions in Teiid
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-892'>TEIID-892</a>] - Add a capability to control bulk insert batch size
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-908'>TEIID-908</a>] - Enable access to the query plan without reference to Teiid classes.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-968'>TEIID-968</a>] - Timestamp literals with fractional seconds result in source query execution performance when being compared to less percise time types
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1006'>TEIID-1006</a>] - Dynamic vdb metadata load enhancements
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1028'>TEIID-1028</a>] - Make Materialized Views first class objects in the system
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1048'>TEIID-1048</a>] - Embedded Connection should support the pass though authentication
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1151'>TEIID-1151</a>] - Re-enable multi-threaded source query execution
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1155'>TEIID-1155</a>] - Allow boolean value expressions to be used as criteria or expressions
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1167'>TEIID-1167</a>] - Add support for primary key handling in temp tables
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1177'>TEIID-1177</a>] - Allow for implicit temp table definition with just a query, omitting the columns
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1179'>TEIID-1179</a>] - Add a CommandContext interface to the teiid api
+</li>
+</ul>
+<h2> Patch
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1184'>TEIID-1184</a>] - Patch to refactor numbered <sect> tags in documentation to <section>
+</li>
+</ul>
+
+<h2> Quality Risk
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-954'>TEIID-954</a>] - Need method to control max amount of buffer disk space
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1150'>TEIID-1150</a>] - Introduce alternative named parameter syntax
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1154'>TEIID-1154</a>] - Remove JDOM
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1187'>TEIID-1187</a>] - Refine vdb version logic
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1190'>TEIID-1190</a>] - Procedure logic clean up
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1199'>TEIID-1199</a>] - Use consistent names for security concepts
+</li>
+</ul>
+
+<h2> Task
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-749'>TEIID-749</a>] - Replace the TestNoArgConnector Test with an integration test.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-882'>TEIID-882</a>] - Look into using javax.xml.xpath in the XML-Relational connectors.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-996'>TEIID-996</a>] - Administration of the granular entitlements to data elements should be supported using the management console.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1055'>TEIID-1055</a>] - Secure profile service access
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1142'>TEIID-1142</a>] - Teiid should work with EAP 5.1
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1143'>TEIID-1143</a>] - Remove the version number from the RAR files, to promote easy migration between the versions
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1160'>TEIID-1160</a>] - Add Support for Discovery of Dynamic VDBs in Teiid Jopr Plugin
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1165'>TEIID-1165</a>] - Upgrade to Netty 3.2.0 final
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1173'>TEIID-1173</a>] - Provide a facility to create "empty" VDBs for preview purpose
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1174'>TEIID-1174</a>] - Allow '-' character in VDB names.
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1194'>TEIID-1194</a>] - Document the recommended approach to using Teiid entitlements
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1207'>TEIID-1207</a>] - Fix Yahoo Translator to work with "Dynamic Portfoilo" example
+</li>
+</ul>
+
+<h2> Sub-task
+</h2>
+<ul>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-958'>TEIID-958</a>] - Provide ability to monitor buffer manager disk space usage and free space
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1189'>TEIID-1189</a>] - JOPR support for multiple versions
+</li>
+<li>[<a href='https://jira.jboss.org/browse/TEIID-1198'>TEIID-1198</a>] - Allow specifying the VDB version as part of the VDB name in the JDBC URL connection string.
+</li>
+</ul>
+
<h2><a name="Documentation">Documentation and Help</a></h2>
The <a href="http://www.jboss.org/teiid/">Teiid community project</a> is hosted on jboss.org.
14 years, 4 months
teiid SVN: r2470 - in trunk: documentation/client-developers-guide/src/main/docbook/en-US/content and 3 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-17 12:26:28 -0400 (Tue, 17 Aug 2010)
New Revision: 2470
Modified:
trunk/documentation/caching-guide/src/main/docbook/en-US/content/cachehint.xml
trunk/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml
trunk/documentation/caching-guide/src/main/docbook/en-US/content/overview.xml
trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
trunk/documentation/reference/src/main/docbook/en-US/content/system_schema.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
trunk/engine/src/test/java/org/teiid/common/queue/TestThreadReuseExecutor.java
Log:
TEIID-168 completed the matview doc.
Modified: trunk/documentation/caching-guide/src/main/docbook/en-US/content/cachehint.xml
===================================================================
--- trunk/documentation/caching-guide/src/main/docbook/en-US/content/cachehint.xml 2010-08-17 16:09:54 UTC (rev 2469)
+++ trunk/documentation/caching-guide/src/main/docbook/en-US/content/cachehint.xml 2010-08-17 16:26:28 UTC (rev 2470)
@@ -54,7 +54,16 @@
<para>When the ttl is specified in the cache hint, a full refresh of the materialized view will be triggered automatically after the specified time interval.
The refresh is equivalent to <code>CALL SYS.refreshMatView('view name', false)</code>, but performed asynchronously so that user queries do not block on the load.
</para>
- <para>The automatic loading is not intended for complex loading scenarios, as nested materialized views will be used by the refresh query.</para>
+ <section>
+ <title>Limitations</title>
+ <itemizedlist>
+ <listitem><para>The automatic ttl refresh is not intended for complex loading scenarios, as nested materialized views will be used by the refresh query.
+ </para></listitem>
+ <listitem><para>The automatic ttl refresh is performed lazily, that is it is only trigger by using the table after the ttl has expired.
+ For infrequently used tables with long load times, this means that data may be used well past the intended ttl.
+ </para></listitem>
+ </itemizedlist>
+ </section>
</section>
<section>
<title>Updatable</title>
Modified: trunk/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml
===================================================================
--- trunk/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml 2010-08-17 16:09:54 UTC (rev 2469)
+++ trunk/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml 2010-08-17 16:26:28 UTC (rev 2470)
@@ -51,8 +51,8 @@
<programlisting>SELECT * from vg1, vg2, vg3 WHERE … OPTION NOCACHE vg1, vg3</programlisting>
<para>Only the vg1 and vg3 caches will be skipped vg2 or any materialized views nested under vg1 and vg3 will be used.</para>
</example>
- <para>The materialization override option may be specified in virtual
- group transformation definitions. In that way, transformations can
+ <para>Option NOCACHE may be specified in virtual
+ group transformation queries. In that way, transformations can
specify to always use real-time data obtained directly from a source.
The use of caching and non-caching can be mixed in transformation
definitions, just as with user queries.</para>
@@ -67,9 +67,9 @@
<note><para>It is important to ensure that all key/index information is present as these will be used by the materialization process to enhance the performance of the materialized table.</para></note>
<para>The target materialized table may also be set in the properties. If the value is left blank, the default, then internal materialization will be used.
Otherwise for external materialization, the value should reference the fully qualified name of a table (or possibly view) with the same columns as the materialized view.
- The choice between internal and external materialization should be made based upon:
+ For most basic scenarios the simplicity of internal materialization makes it the more appealing option. Other considerations for chosing between internal and external materialization are:
<itemizedlist>
- <listitem><para>Does the cached data need to be fully persistent? If yes, then external materialization should be used.
+ <listitem><para>Does the cached data need to be fully durable? If yes, then external materialization should be used.
Internal materialization should not survive a cluster restart.</para>
</listitem>
<listitem><para>Is full control needed of loading and refresh? If yes, then external materialzation should be used.
@@ -77,7 +77,6 @@
</listitem>
</itemizedlist>
</para>
-
</section>
<section>
<title>External Materialization</title>
@@ -88,6 +87,74 @@
policy for clearing and managing the cache. These policies will be
defined and enforced by administrators of the Teiid system.
</para>
- <para></para>
+ <orderedlist>
+ <title>Typical Usage Steps</title>
+ <listitem>
+ <para>Create materialized views and corresponding physical materialized target tables in Designer. This can be done through setting the materialized and target table manually,
+ or by selecting the desired views, right clicking, then selecting Modeling->"Create Materialized Views"</para>
+ </listitem>
+ <listitem>
+ <para>Generate the DDL for your physical model materialization target tables. This can be done by selecting the model, right clicking, then choosing Export->"Metadata Modeling"->"Data Definition Language (DDL) File".
+ This script can be used to create the desired schema for your materialization target on whatever source you choose.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Determine a load and refresh strategy. With the schema created the most simplistic approach is to just load the data.
+ The load can even be done through Teiid with <code>insert into target_table select * from matview option nocache</code>.
+ That however may be too simplistic because you index creation may be more performant if deferred until after the table has been created.
+ Also full snapshot refreshes are best done to a staging table then swapping it for the existing physical table to ensure that the refresh
+ does not impact user queries and to ensure that the table is valid prior to use.</para>
+ </listitem>
+ </orderedlist>
</section>
+ <section>
+ <title>Internal Materialization</title>
+ <para>Internal materialization creates Teiid temporary tables to hold the materialized table. While these tables are not fully durable, they perform
+ well in most circumstances and the data is present at each Teiid instance which removes the single point of failure and network overhead of an external database.
+ Internal materialization also provides more built-in facilities for refreshing and monitoring.</para>
+ <section>
+ <title>Loading And Refreshing</title>
+ <para>An internal materialized view table is initially in an invalid state (there is no data). The first user query will trigger an implicit loading of the data.
+ All other queries against the materialized view will block until the load completes.
+ In some situations administrators may wish to better control when the cache is loaded with a call to <code>SYS.refreshMatView</code>. The initial load may itself trigger the initial load
+ of dependent materialized views. After the initial load user queries against the materialized view table will only block if it is in an invalid state.
+ The valid state may also be controled through the <code>SYS.refreshMatView</code> procedure.
+ <example>
+ <title>Invalidating Refresh</title>
+ <programlisting>CALL SYS.refreshMatView(viewname=>'schema.matview', invalidate=>true)</programlisting>
+ <para>matview will be refreshed and user queries will block until the refresh is complete (or fails).</para>
+ </example>
+ While the initial load may trigger a transitive loading of dependent materialized views,
+ subsequent refreshes performed with <code>refreshMatView</code> will use dependent materialized view tables if they exist. Only one load may occur at a time. If a load is already in progress when
+ the <code>SYS.refreshMatView</code> procedure is called, it will return -1 immediately rather than preempting the current load.
+ </para>
+ <para>The <link linkend="cache-hint">cache hint</link> may be used to automatically trigger a full snapshot refresh after a specified time to live.
+ <example>
+ <title>Auto-refresh Transformation Query</title>
+ <programlisting>/*+ cache(ttl:3600000) */ select t.col, t1.col from t, t1 where t.id = t1.id</programlisting>
+ </example>
+ </para>
+ <para>In advanced use-cases the <link linkend="cache-hint">cache hint</link> may also be used to mark an internal materialized view as updatable.
+ An updatable internal materialized view may use the <code>SYS.refreshMatViewRow</code> procedure to update a single row in the materialized table.
+ To be updatable the materialized view must have a single column primary key. Composite keys are not yet supported by <code>SYS.refreshMatViewRow</code>.
+ <example>
+ <title>Updatable Scenario</title>
+ <para>Transofrmation Query: <programlisting>/*+ cache(updatable) */ select t.col, t1.col from t, t1 where t.id = t1.id</programlisting></para>
+ <para>Update: <programlisting>CALL SYS.updateMatViewRow(viewname=>'schema.matview', key=>5)</programlisting></para>
+ <para>Given that the schema.matview defines interger column col as it's primary key, the update will check the live source(s) for the row values.
+ If it exists, the materialized view table row will be updated. If it does not exist the correpsonding row will be deleted.</para>
+ </example>
+ The update query will not use dependent materialized view tables, so care should be taken to ensure that getting a single
+ row from this transformation query performs well. This may require the use of depedent join hints.
+ When the updatable option is not specified, accessing the materialized view table is more efficient because modifications do not need to be considered.
+ Therefore, only specify the updatable option if row based incremental updates are needed. Even when performing row updates, full snapshot refreshes may be needed to ensure consistency.
+ </para>
+ </section>
+ <section>
+ <title>Limitations</title>
+ <itemizedlist>
+ <listitem><para>Secondary index information is currently not used. An index is only created for the primary key.</para></listitem>
+ </itemizedlist>
+ </section>
+ </section>
</chapter>
\ No newline at end of file
Modified: trunk/documentation/caching-guide/src/main/docbook/en-US/content/overview.xml
===================================================================
--- trunk/documentation/caching-guide/src/main/docbook/en-US/content/overview.xml 2010-08-17 16:09:54 UTC (rev 2469)
+++ trunk/documentation/caching-guide/src/main/docbook/en-US/content/overview.xml 2010-08-17 16:26:28 UTC (rev 2470)
@@ -9,5 +9,6 @@
These techniques can be used to significantly improve performance in many
situations.</para>
<para>With the exception of external materialized views, the cached data is accessed through the BufferManager.
- For better performance, the BufferManager setting should be adjusted to the memory constraints of your installation.</para>
+ For better performance the BufferManager setting should be adjusted to the memory constraints of your installation.
+ See the Admin Guide for more on parameter tuning.</para>
</chapter>
Modified: trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
===================================================================
--- trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2010-08-17 16:09:54 UTC (rev 2469)
+++ trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2010-08-17 16:26:28 UTC (rev 2470)
@@ -486,27 +486,29 @@
</section>
- <!-- <section id="multiple_hosts">
+ <section id="multiple_hosts">
<title>Using Multiple Hosts</title>
- <para>When Teiid Server is deployed on multiple servers for scalbility, then your application that using
- Teiid JDBC API can automatically use all Teiid Servers in that group. To enable this feature the client needs
- to specify multiple host name and port number combinations on the URL connection string. The client will randomly pick any one the Teiid server from the list and will have session
- established with that server. If the "autoFailover" connection property is set to "true", a failure with the connected server will cause the client to automatically failover
+ <para>A group of Teiid Servers in the same AS cluster may be connected using connection time failover and load-balancing.
+ To enable this feature the client needs to specify multiple host name and port number combinations on the URL connection string.
+ The client will randomly pick any one the Teiid server from the list and will have session established with that server.
+ If that server cannot be contacted, then a connection will be attempted to each of the remaining servers in random order.</para>
+
+ <!-- If the "autoFailover" connection property is set to "true", a failure with the connected server will cause the client to automatically failover
to other available servers. Even if autoFailover is not set, when using a managed DataSource based connection, the connection will randomly select a new server instance when it is returned to the pool.</para>
-
+ -->
<example><title>Example URL connection string</title><programlisting><![CDATA[jdbc:teiid:<vdb-name>@mm://host1:31000, host1:31001, host2:31000;version=2]]></programlisting></example>
- <para>Currently when the fail over happens, the user is re-authenticated with the new server. The clustering
+ <!-- <para>Currently when the fail over happens, the user is re-authenticated with the new server. The clustering
feature coming up in the Teiid 7.1 release will define how the transparent session fail over will occur with out the
re-authentication.</para>
<para>You can also use this feature to distribute the query load among various avaialble Teiid Servers available.
Load balancing happens automatically, when you are using a data source along with connection pooling. Each time a connection is
grabbed from the pool, it will randomly select a Teiid Server to distribute the load. Note, that load balacing feature
- is not avaialble if you are using Teiid Driver to make your connection.</para>
+ is not avaialble if you are using Teiid Driver to make your connection.</para>-->
<para>If you are using DataSource to connect to Teiid Server, use "AlternateServers" property/method to define the failover servers.
Check out the Javadoc on the format of the string.</para>
- </section> -->
+ </section>
</chapter>
\ No newline at end of file
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/system_schema.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/system_schema.xml 2010-08-17 16:09:54 UTC (rev 2469)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/system_schema.xml 2010-08-17 16:26:28 UTC (rev 2470)
@@ -1776,7 +1776,7 @@
<para>(string ViewName, boolean Invalidate)</para>
</entry>
<entry>
- <para>An return return value, RowsUpdated. See the Caching Guide for more.</para>
+ <para>An return return value, RowsUpdated. -1 indicates a load is in progress, otherwise the cardinality of the table is returned. See the Caching Guide for more.</para>
</entry>
</row>
<row>
@@ -1787,7 +1787,7 @@
<para>(string ViewName, object Key)</para>
</entry>
<entry>
- <para>An return return value, RowsUpdated. See the Caching Guide for more.</para>
+ <para>An return return value, RowsUpdated. -1 indicates the materialized table is currently invalid. 0 indicates that the specified row did not exist in the live data query or in the materialized table. See the Caching Guide for more.</para>
</entry>
</row>
</tbody>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2010-08-17 16:09:54 UTC (rev 2469)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2010-08-17 16:26:28 UTC (rev 2470)
@@ -287,7 +287,9 @@
this.lastBatch = true;
break;
}
-
+ if (row.size() != this.schema.length) {
+ throw new AssertionError("Inproper results returned. Expected " + this.schema.length + " columns, but was " + row.size()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
this.rowCount += 1;
batchSize++;
if (this.procedureBatchHandler != null) {
@@ -358,6 +360,7 @@
}
if (value == result && !DataTypeManager.DefaultDataClasses.OBJECT.equals(this.schema[index])) {
convertToRuntimeType.remove(i);
+ continue;
}
row.set(index, result);
}
@@ -375,6 +378,7 @@
}
if (value == result) {
convertToDesiredRuntimeType[i] = false;
+ continue;
}
row.set(i, result);
}
Modified: trunk/engine/src/test/java/org/teiid/common/queue/TestThreadReuseExecutor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/common/queue/TestThreadReuseExecutor.java 2010-08-17 16:09:54 UTC (rev 2469)
+++ trunk/engine/src/test/java/org/teiid/common/queue/TestThreadReuseExecutor.java 2010-08-17 16:26:28 UTC (rev 2470)
@@ -73,7 +73,7 @@
pool.execute(new FakeWorkItem(SINGLE_WAIT));
try {
- Thread.sleep(SINGLE_WAIT*2);
+ Thread.sleep(SINGLE_WAIT*3);
} catch(InterruptedException e) {
}
}
14 years, 4 months
teiid SVN: r2469 - trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-08-17 12:09:54 -0400 (Tue, 17 Aug 2010)
New Revision: 2469
Modified:
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
Log:
preventing a cross join int he example
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt 2010-08-17 15:50:45 UTC (rev 2468)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt 2010-08-17 16:09:54 UTC (rev 2469)
@@ -17,7 +17,7 @@
Use the simple client example run script, or another client, to execute a query, e.g.
-$./run.sh localhost 31000 dynamicportfolio "select * from product, (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) stock where product.symbol=stock.symbol"
+$./run.sh localhost 31000 dynamicportfolio "select stock.* from product, (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) stock where product.symbol=stock.symbol"
This example will execute the query against both Derby and the text files. The
files returned from the getTextFiles procedure are passed to the TEXTTABLE table
14 years, 4 months