teiid SVN: r3354 - in trunk: adminshell and 37 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-07-30 14:54:08 -0400 (Sat, 30 Jul 2011)
New Revision: 3354
Modified:
trunk/adminshell/pom.xml
trunk/api/pom.xml
trunk/build/pom.xml
trunk/cache-jbosscache/pom.xml
trunk/client-jdk15/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-olap/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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/adminshell/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/api/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/build/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid</artifactId>
Modified: trunk/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/cache-jbosscache/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-cache-jbosscache</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/client/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: trunk/client-jdk15/pom.xml
===================================================================
--- trunk/client-jdk15/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/client-jdk15/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client-jdk15</artifactId>
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/common-core/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/connector-file/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/connector-ldap/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/connector-salesforce/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/connector-ws/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/salesforce-api/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: trunk/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/sandbox/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/translator-file/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/translator-jdbc/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/translator-ldap/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/translator-loopback/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Modified: trunk/connectors/translator-olap/pom.xml
===================================================================
--- trunk/connectors/translator-olap/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/translator-olap/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-olap</artifactId>
Modified: trunk/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/translator-salesforce/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/connectors/translator-ws/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/console/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/documentation/admin-guide/pom.xml
===================================================================
--- trunk/documentation/admin-guide/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/documentation/admin-guide/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/documentation/caching-guide/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/documentation/client-developers-guide/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/documentation/developer-guide/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>developer-guide</artifactId>
Modified: trunk/documentation/pom.xml
===================================================================
--- trunk/documentation/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/documentation/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/documentation/quick-start-example/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-example</artifactId>
Modified: trunk/documentation/reference/pom.xml
===================================================================
--- trunk/documentation/reference/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/documentation/reference/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>reference</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/engine/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/hibernate-dialect/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/jboss-integration/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/metadata/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -5,15 +5,15 @@
<artifactId>teiid-parent</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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-parent-7.5.0.Beta2</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-parent-7.5.0.Beta2</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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/runtime/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/test-integration/common/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-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 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/test-integration/db/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2011-07-30 18:53:32 UTC (rev 3353)
+++ trunk/test-integration/pom.xml 2011-07-30 18:54:08 UTC (rev 3354)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2</version>
+ <version>7.5.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
13 years, 4 months
teiid SVN: r3353 - tags.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-07-30 14:53:32 -0400 (Sat, 30 Jul 2011)
New Revision: 3353
Added:
tags/teiid-parent-7.5.0.Beta2/
Log:
[maven-release-plugin] copy for tag teiid-parent-7.5.0.Beta2
13 years, 4 months
teiid SVN: r3352 - in trunk: adminshell and 37 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-07-30 14:53:15 -0400 (Sat, 30 Jul 2011)
New Revision: 3352
Modified:
trunk/adminshell/pom.xml
trunk/api/pom.xml
trunk/build/pom.xml
trunk/cache-jbosscache/pom.xml
trunk/client-jdk15/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-olap/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-parent-7.5.0.Beta2
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/adminshell/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/api/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/build/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid</artifactId>
Modified: trunk/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/cache-jbosscache/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-cache-jbosscache</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/client/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: trunk/client-jdk15/pom.xml
===================================================================
--- trunk/client-jdk15/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/client-jdk15/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client-jdk15</artifactId>
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/common-core/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</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 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/connector-file/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-file</artifactId>
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/connector-ldap/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/connector-salesforce/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: trunk/connectors/connector-ws/pom.xml
===================================================================
--- trunk/connectors/connector-ws/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/connector-ws/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</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 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/salesforce-api/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: trunk/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/sandbox/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</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 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-yahoo</artifactId>
Modified: trunk/connectors/translator-file/pom.xml
===================================================================
--- trunk/connectors/translator-file/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/translator-file/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Modified: trunk/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/translator-jdbc/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jdbc</artifactId>
Modified: trunk/connectors/translator-ldap/pom.xml
===================================================================
--- trunk/connectors/translator-ldap/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/translator-ldap/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ldap</artifactId>
Modified: trunk/connectors/translator-loopback/pom.xml
===================================================================
--- trunk/connectors/translator-loopback/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/translator-loopback/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Modified: trunk/connectors/translator-olap/pom.xml
===================================================================
--- trunk/connectors/translator-olap/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/translator-olap/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-olap</artifactId>
Modified: trunk/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/translator-salesforce/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-salesforce</artifactId>
Modified: trunk/connectors/translator-ws/pom.xml
===================================================================
--- trunk/connectors/translator-ws/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/connectors/translator-ws/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/console/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/documentation/admin-guide/pom.xml
===================================================================
--- trunk/documentation/admin-guide/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/documentation/admin-guide/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>admin-guide</artifactId>
Modified: trunk/documentation/caching-guide/pom.xml
===================================================================
--- trunk/documentation/caching-guide/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/documentation/caching-guide/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</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 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/documentation/client-developers-guide/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</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 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/documentation/developer-guide/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>developer-guide</artifactId>
Modified: trunk/documentation/pom.xml
===================================================================
--- trunk/documentation/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/documentation/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</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 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/documentation/quick-start-example/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-example</artifactId>
Modified: trunk/documentation/reference/pom.xml
===================================================================
--- trunk/documentation/reference/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/documentation/reference/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>reference</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/engine/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/hibernate-dialect/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/jboss-integration/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/metadata/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -5,15 +5,15 @@
<artifactId>teiid-parent</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</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-parent-7.5.0.Beta2</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-parent-7.5.0.Beta2</developerConnection>
</scm>
<licenses>
<license>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/runtime/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</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 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/test-integration/common/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</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 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/test-integration/db/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2011-07-30 12:41:32 UTC (rev 3351)
+++ trunk/test-integration/pom.xml 2011-07-30 18:53:15 UTC (rev 3352)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.Beta2-SNAPSHOT</version>
+ <version>7.5.0.Beta2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
13 years, 4 months
teiid SVN: r3351 - in trunk: build/kits/jboss-container and 20 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-07-30 08:41:32 -0400 (Sat, 30 Jul 2011)
New Revision: 3351
Added:
trunk/engine/src/test/resources/TestXMLPlanningEnhancements-testThreeWayOrWithNestedSiblings.xml
Modified:
trunk/api/src/main/java/org/teiid/events/EventDistributor.java
trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml
trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/TupleBatchCacheLoader.java
trunk/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml
trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
trunk/engine/src/main/java/org/teiid/query/mapping/xml/ResultSetInfo.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/SourceNodePlannerVisitor.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLStagaingQueryPlanner.java
trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecSqlInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/PlanExecutor.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
trunk/engine/src/test/java/org/teiid/query/processor/xml/FakePlanExecutor.java
trunk/engine/src/test/java/org/teiid/query/processor/xml/TestProcessorEnvironment.java
trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java
trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLProcessor.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java
Log:
forward merge from 7.4.1
Modified: trunk/api/src/main/java/org/teiid/events/EventDistributor.java
===================================================================
--- trunk/api/src/main/java/org/teiid/events/EventDistributor.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/api/src/main/java/org/teiid/events/EventDistributor.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -121,4 +121,11 @@
*/
void setViewDefinition(String vdbName, int vdbVersion, String schema, String viewName, String definition);
+ /**
+ *
+ * @param vdbName
+ * @param vdbVersion
+ * @param viewName
+ */
+ void refreshMatView(String vdbName, int vdbVersion, String tableName);
}
Property changes on: trunk/api/src/main/java/org/teiid/events/EventDistributor.java
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/7.4.x/api/src/main/java/org/teiid/events/EventDistributor.java:3340-3349
Modified: trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml 2011-07-30 12:41:32 UTC (rev 3351)
@@ -145,7 +145,7 @@
</property>
<property name="clusterName">${jboss.partition.name:DefaultPartition}-teiid-events</property>
<property name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
- <property name="localEventDistributorName">teiid/runtime-engine</property>
+ <property name="localEventDistributorName">teiid/engine-deployer</property>
</bean>
</deployment>
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-07-30 12:41:32 UTC (rev 3351)
@@ -102,6 +102,7 @@
<property name="resultsetCacheConfig"><inject bean="ResultsetCacheConfig"/></property>
<property name="preparedPlanCacheConfig"><inject bean="PreparedPlanCacheConfig"/></property>
<property name="authorizationValidator"><inject bean="AuthorizationValidator"/></property>
+ <property name="containerLifeCycleListener"><inject bean="JBossLifeCycleListener"/></property>
<!-- Process pool maximum thread count. (default 64) -->
<property name="maxThreads">64</property>
<!-- Max active plans (default 20). Increase this value on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts. -->
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-07-30 12:41:32 UTC (rev 3351)
@@ -36,6 +36,12 @@
<LI><B>Logging Procedures</B> - added SYSADMIN.isLoggable and SYSADMIN.logMsg to aid in debugging procedure logic.
<LI><B>ANSI OFFSET/FETCH FIRST</B> - instead of the limit clause, a standard OFFSET and/or FETCH FIRST/NEXT clause can be used to limit results.
<LI><B>ODBC Cursors</B> - Capability to use "UseDeclareFetch" with ODBC is added. This enables user to read the results in batches, especially useful when dealing with large row count of results.
+ <LI><B>Internal Materialized Views</B>
+ <UL>
+ <LI><B>Distributed Refresh</B> - When a internal materialized view is refreshed at one node, an event is issued to all other nodes in the cluster to asynchronously fetch the new contents.
+ <LI><B>Sync at Start</B> - When a node is restarted in a cluster, at end of start cycle Teiid will asynchronously fetch the cached internal materialized view contents from other nodes.
+ </UL>
+ </LI>
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
Modified: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -59,7 +59,9 @@
if (!this.cacheStore.getCacheStatus().allowInvocations()) {
this.cacheStore.start();
- this.cacheStore.getRegion(this.cacheStore.getRoot().getFqn(), true).activate();
+ if (this.cacheStore.getRegion(this.cacheStore.getRoot().getFqn(), false) != null) {
+ this.cacheStore.getRegion(this.cacheStore.getRoot().getFqn(), true).activate();
+ }
}
Node cacheRoot = this.cacheStore.getRoot().addChild(Fqn.fromString("Teiid")); //$NON-NLS-1$
Modified: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/TupleBatchCacheLoader.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/TupleBatchCacheLoader.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/TupleBatchCacheLoader.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -62,9 +62,8 @@
map.put(id, b);
return map;
}
- return super.get(fqn);
}
- return null;
+ return super.get(fqn);
}
@Override
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 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml 2011-07-30 12:41:32 UTC (rev 3351)
@@ -120,6 +120,22 @@
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>SYSADMIN.refreshMatView</code> procedure is called, it will return -1 immediately rather than preempting the current load.
</para>
+ <para>
+ When Teiid is running clustered mode, after of loading of internal materialized view contents, an event will be sent to all
+ the other participating nodes in the cluster to refresh the contents from the original node in asynchronus fashion.
+ During this remote node loading process, if the node that is reading the contents gets a request from user to serve the
+ results of that view, then the current results in cache will be served. If no results were available at that node, then
+ request will be blocked until load process is finished.
+ </para>
+ <para>
+ When a Teiid node joins the cluster, at the end of start-up cycle, an asynchronus job
+ will be started to fetch all the previously cached internal materialized views at other nodes
+ for the deployed VDBs. The query request behaviour during this load process is same as above.
+ </para>
+ <note><para>In the clustered mode, the "invalidate=true" flag in the "SYSADMIN.refreshMatView" procedure
+ will only apply to the node that is refreshing the contents from source. All other nodes, will still serve the
+ old contents during the refresh process.</para>
+ </note>
<section>
<title>TTL Snapshot Refresh</title>
<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 (ttl).
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -99,8 +99,12 @@
this.uuid = java.util.UUID.randomUUID().toString();
}
return this.uuid;
- }
+ }
+ public void setId(String uuid) {
+ this.uuid = uuid;
+ }
+
public boolean isLobs() {
return lobIndexes != null;
}
Property changes on: trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java:3149-3217,3220-3275
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java:3149-3217,3220-3275,3340-3349
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -139,6 +139,7 @@
}
buffer = bufferManager.createTupleBuffer(schema, "cached", TupleSourceType.FINAL); //$NON-NLS-1$
buffer.setBatchSize(this.batchSize);
+ buffer.setId(this.uuid);
if (this.hint != null) {
buffer.setPrefersMemory(this.hint.getPrefersMemory());
}
@@ -151,6 +152,7 @@
return false;
}
buffer.addTupleBatch(batch, true);
+ cache.remove(uuid+","+row); //$NON-NLS-1$
}
this.results = buffer;
bufferManager.addTupleBuffer(this.results);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -28,6 +28,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.FutureTask;
@@ -42,10 +43,11 @@
import org.teiid.adminapi.Request.ThreadState;
import org.teiid.adminapi.impl.CacheStatisticsMetadata;
import org.teiid.adminapi.impl.RequestMetadata;
+import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
import org.teiid.cache.CacheConfiguration;
+import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.cache.CacheFactory;
-import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.client.DQP;
import org.teiid.client.RequestMessage;
import org.teiid.client.ResultsMessage;
@@ -57,24 +59,29 @@
import org.teiid.client.xa.XidImpl;
import org.teiid.common.buffer.BufferManager;
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.Streamable;
+import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
import org.teiid.dqp.internal.process.ThreadReuseExecutor.PrioritizedRunnable;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.RequestID;
import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.TransactionContext;
+import org.teiid.dqp.service.TransactionContext.Scope;
import org.teiid.dqp.service.TransactionService;
-import org.teiid.dqp.service.TransactionContext.Scope;
import org.teiid.events.EventDistributor;
import org.teiid.logging.CommandLogMessage;
+import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.metadata.MetadataRepository;
import org.teiid.query.QueryPlugin;
+import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.metadata.TempMetadataAdapter;
+import org.teiid.query.optimizer.relational.RelationalPlanner;
import org.teiid.query.tempdata.TempTableDataManager;
import org.teiid.query.tempdata.TempTableStore;
@@ -173,9 +180,12 @@
requests.remove(requestID);
}
}
-
}
+ public static interface ContextProvider {
+ DQPWorkContext getContext(String vdbName, int vdbVersion);
+ }
+
private ThreadReuseExecutor processWorkerPool;
// Resources
@@ -730,10 +740,92 @@
processorDataManager.setMetadataRepository(metadataRepository);
dataTierMgr = new TempTableDataManager(processorDataManager, this.bufferManager, this.processWorkerPool, this.rsCache, this.matTables, this.cacheFactory);
dataTierMgr.setEventDistributor(eventDistributor);
-
+
LogManager.logDetail(LogConstants.CTX_DQP, "DQPCore started maxThreads", this.config.getMaxThreads(), "maxActivePlans", this.maxActivePlans, "source concurrency", this.userRequestSourceConcurrency); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+ public void synchronizeInternalMaterializedViews(final ContextProvider contextProvider) {
+ if (!cacheFactory.isReplicated() || matTables == null) {
+ return;
+ }
+ Set<CacheID> keys = this.matTables.replicatableKeys();
+ for (final CacheID key:keys) {
+ refreshMatView(contextProvider, key.getVDBKey().getName(), key.getVDBKey().getVersion(), key.getSql());
+ }
+ }
+
+ public void refreshMatView(final ContextProvider contextProvider, final String vdbName, final int vdbVersion, final String viewName) {
+ if (!cacheFactory.isReplicated() || matTables == null) {
+ return;
+ }
+
+ final DQPWorkContext context = contextProvider.getContext(vdbName, vdbVersion);
+
+ final VDBMetaData vdb = context.getVDB();
+ if (vdb == null) {
+ return;
+ }
+
+ final TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
+ if (globalStore == null) {
+ return;
+ }
+ DQPWorkContext.setWorkContext(context);
+
+ Runnable work = new Runnable() {
+ @Override
+ public void run() {
+ QueryMetadataInterface metadata = vdb.getAttachment(QueryMetadataInterface.class);
+ TempTableStore tempStore = new TempTableStore("internal"); //$NON-NLS-1$
+ TempMetadataAdapter tma = new TempMetadataAdapter(metadata, tempStore.getMetadataStore());
+ try {
+ dataTierMgr.refreshMatView(vdb.getName(), vdb.getVersion(), viewName, tma, globalStore);
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("error_refresh", viewName )); //$NON-NLS-1$
+ }
+ }
+ };
+ addWork(work);
+ }
+
+ public void updateMatViewRow(final ContextProvider contextProvider, final String vdbName, final int vdbVersion, final String schema,
+ final String viewName, final List<?> tuple, final boolean delete) {
+
+ if (!cacheFactory.isReplicated() || matTables == null) {
+ return;
+ }
+
+ final DQPWorkContext context = contextProvider.getContext(vdbName, vdbVersion);
+
+ final VDBMetaData vdb = context.getVDB();
+ if (vdb == null) {
+ return;
+ }
+
+ final TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
+ if (globalStore == null) {
+ return;
+ }
+
+ Runnable work = new Runnable() {
+ @Override
+ public void run() {
+ context.runInContext(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ dataTierMgr.updateMatViewRow(globalStore, RelationalPlanner.MAT_PREFIX + (schema + '.' + viewName).toUpperCase(), tuple, delete);
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
+ }
+ }
+ });
+ }
+ };
+ addWork(work);
+
+ }
+
public void setBufferService(BufferService service) {
this.bufferService = service;
}
@@ -925,5 +1017,4 @@
SessionAwareCache<PreparedPlan> getPrepPlanCache() {
return prepPlanCache;
}
-
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -24,6 +24,7 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
@@ -291,6 +292,10 @@
void setUserName(String name) {
this.userName = name;
}
+
+ public VDBKey getVDBKey() {
+ return vdbInfo;
+ }
public boolean equals(Object obj){
if(obj == this) {
@@ -328,4 +333,11 @@
public void setModTime(long modTime) {
this.modTime = modTime;
}
+
+ public Set<CacheID> replicatableKeys() {
+ if (this.distributedCache == this.localCache) {
+ return Collections.EMPTY_SET;
+ }
+ return this.distributedCache.keys();
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/mapping/xml/ResultSetInfo.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/mapping/xml/ResultSetInfo.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/mapping/xml/ResultSetInfo.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -66,6 +66,8 @@
//joined source node state
private int mappingClassNumber = 0;
private ElementSymbol mappingClassSymbol;
+ private boolean inputSet;
+ private boolean isCritNullDependent;
public ResultSetInfo(String resultName) {
this(resultName, false);
@@ -176,4 +178,20 @@
public boolean isStagedResult() {
return this.stagedResult;
}
+
+ public boolean hasInputSet() {
+ return inputSet;
+ }
+
+ public void setInputSet(boolean inputSet) {
+ this.inputSet = inputSet;
+ }
+
+ public void setCritNullDependent(boolean isCritNullDependent) {
+ this.isCritNullDependent = isCritNullDependent;
+ }
+
+ public boolean isCritNullDependent(){
+ return this.isCritNullDependent;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -37,6 +37,7 @@
import org.teiid.query.mapping.xml.MappingSourceNode;
import org.teiid.query.mapping.xml.ResultSetInfo;
import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.optimizer.relational.rules.JoinUtil;
import org.teiid.query.sql.lang.CompareCriteria;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.symbol.Constant;
@@ -44,6 +45,7 @@
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
+import org.teiid.query.sql.visitor.GroupsUsedByElementsVisitor;
public class CriteriaPlanner {
@@ -106,9 +108,15 @@
//TODO: this can be replaced with method on the source node?
MappingSourceNode criteriaRs = findRootResultSetNode(context, sourceNodes, criteria);
+ Collection<GroupSymbol> groups = GroupsUsedByElementsVisitor.getGroups(conjunct);
+ boolean userCritNullDependent = JoinUtil.isNullDependent(planEnv.getGlobalMetadata(), groups, conjunct);
+ ResultSetInfo rs = criteriaRs.getResultSetInfo();
+ if(userCritNullDependent){
+ rs.setCritNullDependent(true);
+ }
+
Criteria convertedCrit = XMLNodeMappingVisitor.convertCriteria(conjunct, planEnv.mappingDoc, planEnv.getGlobalMetadata());
- ResultSetInfo rs = criteriaRs.getResultSetInfo();
rs.setCriteria(Criteria.combineCriteria(rs.getCriteria(), convertedCrit));
rs.addToCriteriaResultSets(sourceNodes);
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/SourceNodePlannerVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/SourceNodePlannerVisitor.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/SourceNodePlannerVisitor.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -122,11 +122,12 @@
MappingSourceNode parent = sourceNode.getParentSourceNode();
Collection<ElementSymbol> bindings = QueryUtil.getBindingElements(modifiedNode);
+ rsInfo.setInputSet(!bindings.isEmpty());
// root source nodes do not have any inputset criteria on them; so there is no use in
// going through the raising the criteria.
// if the original query is not a select.. we are out of luck. we can expand on this later
// versions. make sure bindings are only to parent.
- if (parent == null || !canRaiseInputset(command, bindings) || !areBindingsOnlyToNode(modifiedNode, parent)) {
+ if (!rsInfo.hasInputSet() || !canRaiseInputset(command, bindings) || !areBindingsOnlyToNode(modifiedNode, parent)) {
return;
}
@@ -152,6 +153,10 @@
}
}
+ if (inputSetCriteria == null) {
+ return;
+ }
+
// Keep the criteria which is not reference based.
transformationQuery.setCriteria(nonInputsetCriteria);
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -300,9 +300,7 @@
Query currentQuery = contextQuery;
- for (Iterator i = resultSets.iterator(); i.hasNext();) {
- MappingSourceNode rsNode = (MappingSourceNode)i.next();
-
+ for (MappingSourceNode rsNode : resultSets) {
ResultSetInfo childRsInfo = rsNode.getResultSetInfo();
QueryNode planNode = QueryUtil.getQueryNode(childRsInfo.getResultSetName(), planEnv.getGlobalMetadata());
@@ -313,35 +311,19 @@
updateSymbolMap(symbolMap, childRsInfo.getResultSetName(), inlineViewName, planEnv.getGlobalMetadata());
// check if the criteria has been raised, if it is then we can update this as a join.
- if (childRsInfo.isCriteriaRaised()) {
+ if (!rsInfo.isCritNullDependent() && childRsInfo.hasInputSet() && childRsInfo.isCriteriaRaised()) {
Query transformationQuery = (Query) command;
SubqueryFromClause sfc = (SubqueryFromClause)transformationQuery.getFrom().getClauses().get(0);
Criteria joinCriteria = ((Query)childRsInfo.getCommand()).getCriteria();
- if (joinCriteria == null) {
- joinCriteria = QueryRewriter.TRUE_CRITERIA;
- }
-
joinCriteria = (Criteria)joinCriteria.clone();
//update the from clause
FromClause clause = currentQuery.getFrom().getClauses().remove(0);
- JoinPredicate join = null;
+ JoinPredicate join = new JoinPredicate(clause, sfc, JoinType.JOIN_LEFT_OUTER, Criteria.separateCriteriaByAnd(joinCriteria));
- if (clause instanceof JoinPredicate) {
- join = (JoinPredicate)clause;
-
- FromClause right = join.getRightClause();
-
- JoinPredicate newRight = new JoinPredicate(right, sfc, JoinType.JOIN_LEFT_OUTER, Criteria.separateCriteriaByAnd(joinCriteria));
-
- join.setRightClause(newRight);
- } else {
- join = new JoinPredicate(clause, sfc, JoinType.JOIN_LEFT_OUTER, Criteria.separateCriteriaByAnd(joinCriteria));
- }
-
currentQuery.getFrom().addClause(join);
currentQuery.getSelect().setDistinct(true);
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLStagaingQueryPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLStagaingQueryPlanner.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLStagaingQueryPlanner.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -104,7 +104,7 @@
ResultSetInfo rsInfo = sourceNode.getResultSetInfo();
// If this node has been eligible for raising, it will be eligible for staging.
- if (!rsInfo.isCriteriaRaised()) {
+ if (rsInfo.hasInputSet() && !rsInfo.isCriteriaRaised()) {
return false;
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -169,7 +169,7 @@
return result;
}
- private void init() throws TeiidComponentException, TeiidProcessingException {
+ public void init() throws TeiidComponentException, TeiidProcessingException {
// initialize if necessary
if(!initialized) {
reserved = this.bufferMgr.reserveBuffers(this.bufferMgr.getSchemaSize(this.getOutputElements()), BufferReserveMode.FORCE);
@@ -184,7 +184,6 @@
}
}
-
/**
* Close processing and clean everything up. Should only be called by the same thread that called process.
*/
Property changes on: trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java:3220-3275
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java:3220-3275,3340-3349
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecSqlInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecSqlInstruction.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecSqlInstruction.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -49,14 +49,10 @@
throws BlockedException, TeiidComponentException, TeiidProcessingException{
LogManager.logTrace(org.teiid.logging.LogConstants.CTX_XML_PLAN, new Object[]{"SQL: Result set DOESN'T exist:",resultSetName}); //$NON-NLS-1$
- PlanExecutor executor = context.getResultExecutor(resultSetName);
- if (executor == null) {
- executor = env.createResultExecutor(resultSetName, info);
- context.setResultExecutor(resultSetName, executor);
- }
+ PlanExecutor executor = getPlanExecutor(env, context);
// this execute can throw the blocked exception
- executor.execute(context.getReferenceValues());
+ executor.execute(context.getReferenceValues(), false);
// now that we done executing the plan; remove the plan from context
context.removeResultExecutor(resultSetName);
@@ -68,6 +64,16 @@
env.incrementCurrentProgramCounter();
return context;
}
+
+ public PlanExecutor getPlanExecutor(XMLProcessorEnvironment env,
+ XMLContext context) throws TeiidComponentException {
+ PlanExecutor executor = context.getResultExecutor(resultSetName);
+ if (executor == null) {
+ executor = env.createResultExecutor(resultSetName, info);
+ context.setResultExecutor(resultSetName, executor);
+ }
+ return executor;
+ }
public String toString() {
return "SQL " + resultSetName; //$NON-NLS-1$
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -73,7 +73,7 @@
// bound references; they are not part of the document; so they do not know about document
// details.
Map referenceValues = null;
- executor.execute(referenceValues);
+ executor.execute(referenceValues, false);
env.markStagingTableAsLoaded(this.resultSetName);
// now that we done executing the plan; remove the plan from context
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/PlanExecutor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/PlanExecutor.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/PlanExecutor.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -39,8 +39,9 @@
/**
* Execute the plan
* @param referenceValues - values for any external references
+ * @param openOnly
*/
- public void execute(Map referenceValues) throws TeiidComponentException, BlockedException, TeiidProcessingException;
+ public void execute(Map referenceValues, boolean openOnly) throws TeiidComponentException, BlockedException, TeiidProcessingException;
/**
* Get the ElementSymbol list which represents the schema of the result set
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -87,15 +87,20 @@
/**
* @throws TeiidProcessingException
- * @see org.teiid.query.processor.xml.PlanExecutor#execute(java.util.Map)
+ * @see org.teiid.query.processor.xml.PlanExecutor#execute(java.util.Map, boolean)
*/
- public void execute(Map referenceValues) throws TeiidComponentException, BlockedException, TeiidProcessingException {
+ public void execute(Map referenceValues, boolean openOnly) throws TeiidComponentException, BlockedException, TeiidProcessingException {
if (this.tupleSource == null) {
setReferenceValues(referenceValues);
this.tupleSource = new BatchIterator(internalProcessor);
+ if (openOnly) {
+ internalProcessor.init();
+ }
}
- //force execution
- this.tupleSource.hasNext();
+ if (!openOnly) {
+ //force execution
+ this.tupleSource.hasNext();
+ }
}
void setReferenceValues(Map<ElementSymbol, Object> referencesValues) {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -155,7 +155,7 @@
while(true){
// do the xml processing.
- ProcessorInstruction inst = env.getCurrentInstruction();
+ ProcessorInstruction inst = env.getCurrentInstruction(this.context);
while (inst != null){
LogManager.logTrace(LogConstants.CTX_XML_PLAN, "Executing instruction", inst); //$NON-NLS-1$
this.context = inst.process(this.env, this.context);
@@ -186,7 +186,7 @@
TupleBatch batch = new TupleBatch(nextBatchCount++, Arrays.asList(Arrays.asList(xml)));
return batch;
}
- inst = env.getCurrentInstruction();
+ inst = env.getCurrentInstruction(this.context);
}
TupleBatch batch = new TupleBatch(nextBatchCount++, Collections.EMPTY_LIST);
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -26,10 +26,12 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.List;
import java.util.Set;
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidProcessingException;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
import org.teiid.query.mapping.xml.ResultSetInfo;
@@ -84,6 +86,7 @@
private static class ProgramState {
private Program program;
private int programCounter = 0;
+ private int lookaheadCounter;
private int recursionCount = NOT_RECURSIVE;
private static final int NOT_RECURSIVE = 0;
@@ -156,7 +159,7 @@
this.programStack.addFirst(programState);
}
- public ProcessorInstruction getCurrentInstruction() {
+ public ProcessorInstruction getCurrentInstruction(XMLContext context) throws TeiidComponentException, TeiidProcessingException {
ProgramState programState = this.programStack.getFirst();
//Case 5266: account for an empty program on to the stack;
@@ -171,6 +174,23 @@
return null;
}
+ //start all siblings
+ List<ProcessorInstruction> instrs = programState.program.getProcessorInstructions();
+ if (programState.programCounter >= programState.lookaheadCounter && instrs.size() > programState.programCounter + 1) {
+ for (programState.lookaheadCounter = programState.programCounter; programState.lookaheadCounter < instrs.size(); programState.lookaheadCounter++) {
+ ProcessorInstruction pi = instrs.get(programState.lookaheadCounter);
+ if (pi instanceof ExecStagingTableInstruction) {
+ //need to load staging tables prior to source queries
+ break;
+ }
+ if (pi instanceof ExecSqlInstruction) {
+ ExecSqlInstruction esi = (ExecSqlInstruction)pi;
+ PlanExecutor pe = esi.getPlanExecutor(this, context);
+ pe.execute(context.getReferenceValues(), true);
+ }
+ }
+ }
+
return programState.program.getInstructionAt(programState.programCounter);
}
@@ -251,8 +271,6 @@
ProgramState initialProgramState = this.programStack.getLast();
ProgramState newState = new ProgramState();
newState.program = initialProgramState.program;
- newState.programCounter = 0;
- newState.recursionCount = ProgramState.NOT_RECURSIVE;
clone.programStack.addFirst(newState);
// XML results form and format
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -309,15 +309,27 @@
QueryMetadataInterface metadata = context.getMetadata();
TempTableStore globalStore = context.getGlobalTableStore();
if (StringUtil.endsWithIgnoreCase(proc.getProcedureCallableName(), REFRESHMATVIEW)) {
- Object groupID = validateMatView(metadata, proc);
+ Object groupID = validateMatView(metadata, (String)((Constant)proc.getParameter(1).getExpression()).getValue());
Object matTableId = context.getGlobalTableStore().getGlobalTempTableMetadataId(groupID, metadata);
String matViewName = metadata.getFullName(groupID);
String matTableName = metadata.getFullName(matTableId);
LogManager.logDetail(LogConstants.CTX_MATVIEWS, "processing refreshmatview for", matViewName); //$NON-NLS-1$
MatTableInfo info = globalStore.getMatTableInfo(matTableName);
+ Long loadTime = null;
+ boolean useCache = false;
+ if (this.distributedCache != null) {
+ MatTableKey key = new MatTableKey();
+ key.name = matTableName;
+ key.vdb = new VDBKey(context.getVdbName(),context.getVdbVersion());
+ MatTableEntry entry = this.tables.get(key);
+ useCache = (entry != null && entry.valid && entry.lastUpdate > info.getUpdateTime());
+ if (useCache) {
+ loadTime = entry.lastUpdate;
+ }
+ }
boolean invalidate = Boolean.TRUE.equals(((Constant)proc.getParameter(2).getExpression()).getValue());
if (invalidate) {
- touchTable(context, matTableName, false);
+ touchTable(context, matTableName, false, System.currentTimeMillis());
}
MatState oldState = info.setState(MatState.NEEDS_LOADING, invalidate?Boolean.FALSE:null, null);
if (oldState == MatState.LOADING) {
@@ -325,10 +337,10 @@
}
GroupSymbol matTable = new GroupSymbol(matTableName);
matTable.setMetadataID(matTableId);
- int rowCount = loadGlobalTable(context, matTable, matTableName, globalStore, info, null, false);
+ int rowCount = loadGlobalTable(context, matTable, matTableName, matViewName, globalStore, info, invalidate?null:loadTime, !invalidate && useCache);
return CollectionTupleSource.createUpdateCountTupleSource(rowCount);
} else if (StringUtil.endsWithIgnoreCase(proc.getProcedureCallableName(), REFRESHMATVIEWROW)) {
- Object groupID = validateMatView(metadata, proc);
+ Object groupID = validateMatView(metadata, (String)((Constant)proc.getParameter(1).getExpression()).getValue());
Object pk = metadata.getPrimaryKey(groupID);
String matViewName = metadata.getFullName(groupID);
if (pk == null) {
@@ -377,15 +389,36 @@
TempTable tempTable = globalStore.getOrCreateTempTable(matTableName, new Query(), bufferManager, false);
return tempTable.updateTuple(tuple, delete);
}
+
+ public void refreshMatView(String vdbName, int vdbVersion, String viewName,
+ QueryMetadataInterface metadata, TempTableStore globalStore)
+ throws QueryProcessingException, TeiidComponentException, TeiidProcessingException {
+
+ Object groupID = validateMatView(metadata, viewName);
+ Object matTableId = globalStore.getGlobalTempTableMetadataId(groupID, metadata);
+ String matViewName = metadata.getFullName(groupID);
+ String matTableName = metadata.getFullName(matTableId);
+ LogManager.logDetail(LogConstants.CTX_MATVIEWS, "processing refreshmatview for", matViewName); //$NON-NLS-1$
+ MatTableInfo info = globalStore.getMatTableInfo(matTableName);
- private Object validateMatView(QueryMetadataInterface metadata,
- StoredProcedure proc) throws TeiidComponentException,
+ MatState oldState = info.setState(MatState.NEEDS_LOADING, Boolean.FALSE, null);
+ if (oldState == MatState.LOADING) {
+ return;
+ }
+ GroupSymbol matTable = new GroupSymbol(matTableName);
+ matTable.setMetadataID(matTableId);
+ CommandContext context = new CommandContext(new Object(), "internal", "internal", vdbName, vdbVersion); //$NON-NLS-1$ //$NON-NLS-2$
+ context.setMetadata(metadata);
+ context.setGlobalTableStore(globalStore);
+ loadGlobalTable(context, matTable, matTableName, matViewName, globalStore, info, null, true);
+ }
+
+ private Object validateMatView(QueryMetadataInterface metadata, String viewName) throws TeiidComponentException,
TeiidProcessingException {
- String name = (String)((Constant)proc.getParameter(1).getExpression()).getValue();
try {
- Object groupID = metadata.getGroupID(name);
+ Object groupID = metadata.getGroupID(viewName);
if (!metadata.hasMaterialization(groupID) || metadata.getMaterialization(groupID) != null) {
- throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableDataManager.not_implicit_matview", name)); //$NON-NLS-1$
+ throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableDataManager.not_implicit_matview", viewName)); //$NON-NLS-1$
}
return groupID;
} catch (QueryMetadataException e) {
@@ -402,8 +435,13 @@
if (!group.isTempGroupSymbol()) {
return null;
}
+ String viewName = null;
final String tableName = group.getNonCorrelationName().toUpperCase();
boolean remapColumns = !tableName.equalsIgnoreCase(group.getName());
+ TempMetadataID groupID = (TempMetadataID)group.getMetadataID();
+ if (groupID.getOriginalMetadataID() != null) {
+ viewName = context.getMetadata().getFullName(groupID.getOriginalMetadataID());
+ }
TempTable table = null;
if (group.isGlobalTable()) {
final TempTableStore globalStore = context.getGlobalTableStore();
@@ -429,9 +467,9 @@
if (load) {
if (!info.isValid()) {
//blocking load
- loadGlobalTable(context, group, tableName, globalStore, info, loadTime, true);
+ loadGlobalTable(context, group, tableName, viewName, globalStore, info, loadTime, true);
} else {
- loadAsynch(context, group, tableName, globalStore, info, loadTime);
+ loadAsynch(context, group, tableName, viewName, globalStore, info, loadTime);
}
}
table = globalStore.getOrCreateTempTable(tableName, query, bufferManager, false);
@@ -464,13 +502,13 @@
}
private void loadAsynch(final CommandContext context,
- final GroupSymbol group, final String tableName,
+ final GroupSymbol group, final String tableName, final String viewName,
final TempTableStore globalStore, final MatTableInfo info,
final Long loadTime) {
Callable<Integer> toCall = new Callable<Integer>() {
@Override
public Integer call() throws Exception {
- return loadGlobalTable(context, group, tableName, globalStore, info, loadTime, true);
+ return loadGlobalTable(context, group, tableName, viewName, globalStore, info, loadTime, true);
}
};
FutureTask<Integer> task = new FutureTask<Integer>(toCall);
@@ -478,7 +516,7 @@
}
private int loadGlobalTable(CommandContext context,
- GroupSymbol group, final String tableName,
+ GroupSymbol group, final String tableName, final String viewName,
TempTableStore globalStore, MatTableInfo info, Long loadTime, boolean useCache)
throws TeiidComponentException, TeiidProcessingException {
LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.getString("TempTableDataManager.loading", tableName)); //$NON-NLS-1$
@@ -506,17 +544,19 @@
}
}
int rowCount = -1;
+ boolean viewFetched = false;
try {
String fullName = metadata.getFullName(group.getMetadataID());
TupleSource ts = null;
CacheID cid = null;
if (distributedCache != null) {
- cid = new CacheID(new ParseInfo(), fullName, context.getVdbName(),
+ cid = new CacheID(new ParseInfo(), viewName, context.getVdbName(),
context.getVdbVersion(), context.getConnectionID(), context.getUserName());
if (useCache) {
CachedResults cr = this.distributedCache.get(cid);
if (cr != null) {
ts = cr.getResults().createIndexedTupleSource();
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.getString("TempTableDataManager.cache_load", tableName)); //$NON-NLS-1$
}
}
}
@@ -536,9 +576,10 @@
BatchCollector bc = qp.createBatchCollector();
TupleBuffer tb = bc.collectTuples();
cr.setResults(tb, qp.getProcessorPlan());
- touchTable(context, fullName, true);
+ touchTable(context, fullName, true, info.getUpdateTime());
this.distributedCache.put(cid, Determinism.VDB_DETERMINISTIC, cr, info.getTtl());
ts = tb.createIndexedTupleSource();
+ viewFetched = true;
} else {
ts = new BatchCollector.BatchProducerTupleSource(qp);
}
@@ -570,18 +611,22 @@
} else {
globalStore.swapTempTable(tableName, table);
info.setState(MatState.LOADED, true, loadTime);
+ if (viewFetched & viewName != null && this.eventDistributor != null) {
+ this.eventDistributor.refreshMatView(context.getVdbName(), context.getVdbVersion(), viewName);
+ }
LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.getString("TempTableDataManager.loaded", tableName, rowCount)); //$NON-NLS-1$
}
}
return rowCount;
}
- private void touchTable(CommandContext context, String fullName, boolean valid) {
+ private void touchTable(CommandContext context, String fullName, boolean valid, long loadtime) {
MatTableKey key = new MatTableKey();
key.name = fullName;
key.vdb = new VDBKey(context.getVdbName(), context.getVdbVersion());
MatTableEntry matTableEntry = new MatTableEntry();
matTableEntry.valid = valid;
+ matTableEntry.lastUpdate = loadtime;
tables.put(key, matTableEntry, null);
}
@@ -644,5 +689,4 @@
public MetadataRepository getMetadataRepository() {
return this.processorDataManager.getMetadataRepository();
}
-
}
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -264,6 +264,7 @@
id = tempMetadataStore.addTempGroup(matTableName, ResolverUtil.resolveElementsInGroup(group, metadata), false, true);
id.setQueryNode(metadata.getVirtualPlan(viewId));
id.setCardinality(metadata.getCardinality(viewId));
+ id.setOriginalMetadataID(viewId);
Object pk = metadata.getPrimaryKey(viewId);
if (pk != null) {
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -1232,6 +1232,9 @@
if (windowFunction.getFunction().getOrderBy() != null || windowFunction.getFunction().isDistinct()) {
handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0042", new Object[] {windowFunction.getFunction(), windowFunction}), windowFunction); //$NON-NLS-1$
}
+ if (windowFunction.getWindowSpecification().getPartition() != null) {
+ validateSortable(windowFunction.getWindowSpecification().getPartition());
+ }
}
@Override
Modified: trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -242,8 +242,11 @@
public SaxonXQueryExpression clone() {
SaxonXQueryExpression clone = new SaxonXQueryExpression();
clone.xQuery = xQuery;
+ clone.xQueryString = xQueryString;
clone.config = config;
clone.contextRoot = contextRoot;
+ clone.namespaceMap = namespaceMap;
+ clone.streamingPathFilter = streamingPathFilter;
return clone;
}
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-07-30 12:41:32 UTC (rev 3351)
@@ -817,6 +817,7 @@
TempTableDataManager.failed_load=Failed to load materialized view table {0}.
TempTableDataManager.loaded=Loaded materialized view table {0} with row count {1}.
TempTableDataManager.loading=Loading materialized view table {0}
+TempTableDataManager.cache_load=Loaded materialized view table {0} from cached contents from another clustered node.
TempTableDataManager.not_implicit_matview={0} does not target an internal materialized view.
TempTableDataManager.row_refresh_pk=Materialized view {0} cannot have a row refreshed since there is no primary key.
TempTableDataManager.row_refresh_composite=Materialized view {0} cannot have a row refreshed because it uses a composite key.
@@ -926,4 +927,5 @@
ValidationVisitor.not_a_procedure={0} is not a valid virtual procedure.
DdlPlan.event_not_exists={0} does not have an INSTEAD OF trigger defined for {1}.
-DdlPlan.event_already_exists={0} already has an INSTEAD OF trigger defined for {1}.
\ No newline at end of file
+DdlPlan.event_already_exists={0} already has an INSTEAD OF trigger defined for {1}.
+error_refresh=error occurred during refreshing the materialized view entries for view {0}
\ No newline at end of file
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -38,10 +38,16 @@
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.core.types.BlobImpl;
import org.teiid.core.types.BlobType;
+import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.InputStreamFactory;
import org.teiid.core.util.ObjectConverterUtil;
import org.teiid.core.util.TimestampWithTimezone;
import org.teiid.core.util.UnitTestUtil;
+import org.teiid.metadata.MetadataStore;
+import org.teiid.metadata.Schema;
+import org.teiid.metadata.Table;
+import org.teiid.query.mapping.relational.QueryNode;
+import org.teiid.query.metadata.TransformationMetadata;
import org.teiid.query.optimizer.capabilities.DefaultCapabilitiesFinder;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.query.unittest.TimestampUtil;
@@ -187,6 +193,32 @@
process(sql, expected);
}
+ @Test public void testXmlTableInView() throws Exception {
+ String sql = "select * from g1"; //$NON-NLS-1$
+
+ List<?>[] expected = new List<?>[] {
+ Arrays.asList(null, "first"),
+ Arrays.asList("attr", "second"),
+ };
+
+ MetadataStore metadataStore = new MetadataStore();
+ // Create models
+ Schema vm1 = RealMetadataFactory.createVirtualModel("vm1", metadataStore); //$NON-NLS-1$
+
+ QueryNode vm1g1n1 = new QueryNode("select * from xmltable('/a/b' passing convert('<a><b>first</b><b x=\"attr\">second</b></a>', xml) columns x string path '@x', val string path '/.') as x"); //$NON-NLS-1$ //$NON-NLS-2$
+ Table vm1g1 = RealMetadataFactory.createVirtualGroup("g1", vm1, vm1g1n1); //$NON-NLS-1$
+
+ RealMetadataFactory.createElements(vm1g1,
+ new String[] { "x", "val" }, //$NON-NLS-1$
+ new String[] { DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING });
+ // Create the facade from the store
+ TransformationMetadata metadata = RealMetadataFactory.createTransformationMetadata(metadataStore, "example");
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, new DefaultCapabilitiesFinder(), createCommandContext());
+
+ helpProcess(plan, createCommandContext(), dataManager, expected);
+ }
+
@Test public void testXmlTableDefaultAndParent() throws Exception {
String sql = "select * from xmltable('/a/b' passing convert('<a y=\"rev\"><b>first</b><b x=\"1\">second</b></a>', xml) columns x integer default -1 path '@x' , val string path '../@y') as x"; //$NON-NLS-1$
Property changes on: trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java:3149-3217,3220-3275,3281-3325
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java:3149-3217,3220-3275,3281-3325,3340-3349
Modified: trunk/engine/src/test/java/org/teiid/query/processor/xml/FakePlanExecutor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/xml/FakePlanExecutor.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/test/java/org/teiid/query/processor/xml/FakePlanExecutor.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -56,7 +56,7 @@
return this.currentRow;
}
- public void execute(Map values) throws TeiidComponentException, BlockedException {
+ public void execute(Map values, boolean openOnly) throws TeiidComponentException, BlockedException {
tupleSource.openSource();
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/xml/TestProcessorEnvironment.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/xml/TestProcessorEnvironment.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/test/java/org/teiid/query/processor/xml/TestProcessorEnvironment.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -119,31 +119,31 @@
env.pushProgram(p1, true); //simulate recursion
assertEquals(p1, env.getCurrentProgram());
- assertEquals(i1, env.getCurrentInstruction());
+ assertEquals(i1, env.getCurrentInstruction(null));
assertEquals(p1, env.getCurrentProgram());
i1.process(env, context);
assertEquals(p1, env.getCurrentProgram());
- assertEquals(i2, env.getCurrentInstruction());
+ assertEquals(i2, env.getCurrentInstruction(null));
assertEquals(p1, env.getCurrentProgram());
i2.process(env, context);
assertEquals(p2, env.getCurrentProgram());
- assertEquals(i3, env.getCurrentInstruction());
+ assertEquals(i3, env.getCurrentInstruction(null));
assertEquals(p2, env.getCurrentProgram());
i3.process(env, context);
assertEquals(p2, env.getCurrentProgram());
- assertEquals(i4, env.getCurrentInstruction());
+ assertEquals(i4, env.getCurrentInstruction(null));
assertEquals(p2, env.getCurrentProgram());
i4.process(env, context);
assertEquals(p1, env.getCurrentProgram());
- assertEquals(i1, env.getCurrentInstruction());
+ assertEquals(i1, env.getCurrentInstruction(null));
assertEquals(p1, env.getCurrentProgram());
i1.process(env, context);
assertEquals(p1, env.getCurrentProgram());
- assertEquals(i2, env.getCurrentInstruction());
+ assertEquals(i2, env.getCurrentInstruction(null));
assertEquals(p1, env.getCurrentProgram());
i2.process(env, context);
assertEquals(p1, env.getCurrentProgram());
- assertEquals(null, env.getCurrentInstruction());
+ assertEquals(null, env.getCurrentInstruction(null));
assertEquals(p1, env.getCurrentProgram());
}
@@ -173,31 +173,31 @@
env.pushProgram(p2);
assertEquals(p2, env.getCurrentProgram());
- assertEquals(i3, env.getCurrentInstruction());
+ assertEquals(i3, env.getCurrentInstruction(null));
assertEquals(p2, env.getCurrentProgram());
i3.process(env, context);
assertEquals(p2, env.getCurrentProgram());
- assertEquals(i4, env.getCurrentInstruction());
+ assertEquals(i4, env.getCurrentInstruction(null));
assertEquals(p2, env.getCurrentProgram());
i4.process(env, context);
assertEquals(p1, env.getCurrentProgram());
- assertEquals(i1, env.getCurrentInstruction());
+ assertEquals(i1, env.getCurrentInstruction(null));
assertEquals(p1, env.getCurrentProgram());
i1.process(env, context);
assertEquals(p1, env.getCurrentProgram());
- assertEquals(i2, env.getCurrentInstruction());
+ assertEquals(i2, env.getCurrentInstruction(null));
assertEquals(p1, env.getCurrentProgram());
i2.process(env, context);
assertEquals(p1, env.getCurrentProgram());
- assertEquals(i1, env.getCurrentInstruction());
+ assertEquals(i1, env.getCurrentInstruction(null));
assertEquals(p1, env.getCurrentProgram());
i1.process(env, context);
assertEquals(p1, env.getCurrentProgram());
- assertEquals(i2, env.getCurrentInstruction());
+ assertEquals(i2, env.getCurrentInstruction(null));
assertEquals(p1, env.getCurrentProgram());
i2.process(env, context);
assertEquals(p1, env.getCurrentProgram());
- assertEquals(null, env.getCurrentInstruction());
+ assertEquals(null, env.getCurrentInstruction(null));
assertEquals(p1, env.getCurrentProgram());
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -154,6 +154,15 @@
return doc;
}
+ @Test public void testThreeWayOrWithNestedSiblings() throws Exception {
+ QueryMetadataInterface metadata = TestXMLProcessor.exampleMetadataNestedWithSibling();
+ FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNestedWithSibling(metadata);
+ String resultFile = "TestXMLPlanningEnhancements-testThreeWayOrWithNestedSiblings.xml"; //$NON-NLS-1$
+ String expectedDoc = TestXMLProcessor.readFile(resultFile);
+
+ TestXMLProcessor.helpTestProcess("select * from xmltest.doc9c where itemid='003' or supplierid = '600' or orderid = '1'", expectedDoc, metadata, dataMgr); //$NON-NLS-1$
+ }
+
@Test public void testBaseballPlayersDocDefect19541() throws Exception {
QueryMetadataInterface metadata = RealMetadataFactory.exampleCase3225();
Modified: trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLProcessor.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLProcessor.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -606,7 +606,7 @@
return RealMetadataFactory.createTransformationMetadata(metadataStore, "example1");
}
- public QueryMetadataInterface exampleMetadataNestedWithSibling() {
+ public static QueryMetadataInterface exampleMetadataNestedWithSibling() {
MetadataStore metadataStore = new MetadataStore();
// Create models
@@ -1231,7 +1231,7 @@
}
/** nested with sibling*/
- private MappingDocument createXMLPlanNested2c() {
+ private static MappingDocument createXMLPlanNested2c() {
MappingDocument doc = new MappingDocument(true);
MappingElement root = doc.addChildElement(new MappingElement("Catalogs")); //$NON-NLS-1$
@@ -2256,7 +2256,7 @@
return dataMgr;
}
- private FakeDataManager exampleDataManagerNestedWithSibling(QueryMetadataInterface metadata) {
+ static FakeDataManager exampleDataManagerNestedWithSibling(QueryMetadataInterface metadata) {
FakeDataManager dataMgr = new FakeDataManager();
try {
Copied: trunk/engine/src/test/resources/TestXMLPlanningEnhancements-testThreeWayOrWithNestedSiblings.xml (from rev 3349, branches/7.4.x/engine/src/test/resources/TestXMLPlanningEnhancements-testThreeWayOrWithNestedSiblings.xml)
===================================================================
--- trunk/engine/src/test/resources/TestXMLPlanningEnhancements-testThreeWayOrWithNestedSiblings.xml (rev 0)
+++ trunk/engine/src/test/resources/TestXMLPlanningEnhancements-testThreeWayOrWithNestedSiblings.xml 2011-07-30 12:41:32 UTC (rev 3351)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Catalogs>
+ <Catalog>
+ <Items>
+ <Item ItemID="001">
+ <Name>Lamp</Name>
+ <Quantity>5</Quantity>
+ <Suppliers>
+ <Supplier SupplierID="51">
+ <Name>Chucky</Name>
+ <Zip>11111</Zip>
+ </Supplier>
+ <Supplier SupplierID="52">
+ <Name>Biff's Stuff</Name>
+ <Zip>22222</Zip>
+ </Supplier>
+ <Supplier SupplierID="53">
+ <Name>AAAA</Name>
+ <Zip>33333</Zip>
+ </Supplier>
+ <Supplier SupplierID="56">
+ <Name>Microsoft</Name>
+ <Zip>66666</Zip>
+ </Supplier>
+ </Suppliers>
+ <Orders>
+ <Order OrderID="1">
+ <Name>KMart</Name>
+ <Zip>12345</Zip>
+ </Order>
+ <Order OrderID="2">
+ <Name>Sun</Name>
+ <Zip>94040</Zip>
+ </Order>
+ <Order OrderID="3">
+ <Name>Cisco</Name>
+ <Zip>94041</Zip>
+ </Order>
+ <Order OrderID="4">
+ <Name>Doc</Name>
+ <Zip>94042</Zip>
+ </Order>
+ </Orders>
+ </Item>
+ <Item ItemID="003">
+ <Name>Goat</Name>
+ <Quantity>4</Quantity>
+ <Suppliers>
+ <Supplier SupplierID="56">
+ <Name>Microsoft</Name>
+ <Zip>66666</Zip>
+ </Supplier>
+ </Suppliers>
+ <Orders>
+ <Order OrderID="7">
+ <Name>Inktomi</Name>
+ <Zip>94044</Zip>
+ </Order>
+ </Orders>
+ </Item>
+ </Items>
+ </Catalog>
+</Catalogs>
\ No newline at end of file
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -21,6 +21,10 @@
*/
package org.teiid.jboss;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
import javax.management.InstanceNotFoundException;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
@@ -39,6 +43,7 @@
public final String STOP_NOTIFICATION_TYPE = "org.jboss.system.server.stopped"; //$NON-NLS-1$
private boolean shutdownInProgress = false;
+ private List<ContainerLifeCycleListener.LifeCycleEventListener> listeners = Collections.synchronizedList(new ArrayList<ContainerLifeCycleListener.LifeCycleEventListener>());
public JBossLifeCycleListener() {
try {
@@ -56,10 +61,16 @@
public void handleNotification(Notification msg, Object handback) {
String type = msg.getType();
if (type.equals(START_NOTIFICATION_TYPE)) {
+ for (ContainerLifeCycleListener.LifeCycleEventListener l:listeners) {
+ l.onStartupFinish();
+ }
}
if (type.equals(STOP_NOTIFICATION_TYPE)) {
shutdownInProgress = true;
+ for (ContainerLifeCycleListener.LifeCycleEventListener l:listeners) {
+ l.onShutdownStart();
+ }
}
}
@@ -67,4 +78,9 @@
public boolean isShutdownInProgress() {
return shutdownInProgress;
}
+
+ @Override
+ public void addListener(LifeCycleEventListener listener) {
+ listeners.add(listener);
+ }
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -60,10 +60,10 @@
import org.jboss.profileservice.spi.ProfileService;
import org.jboss.util.naming.Util;
import org.teiid.adminapi.Admin;
+import org.teiid.adminapi.Admin.Cache;
import org.teiid.adminapi.AdminComponentException;
import org.teiid.adminapi.AdminException;
import org.teiid.adminapi.AdminProcessingException;
-import org.teiid.adminapi.Admin.Cache;
import org.teiid.adminapi.impl.CacheStatisticsMetadata;
import org.teiid.adminapi.impl.DQPManagement;
import org.teiid.adminapi.impl.RequestMetadata;
@@ -81,14 +81,15 @@
import org.teiid.client.util.ResultsFuture;
import org.teiid.core.ComponentNotFoundException;
import org.teiid.core.TeiidComponentException;
-import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.LRUCache;
+import org.teiid.deployers.ContainerLifeCycleListener;
import org.teiid.deployers.VDBLifeCycleListener;
import org.teiid.deployers.VDBRepository;
import org.teiid.deployers.VDBStatusChecker;
import org.teiid.dqp.internal.process.DQPConfiguration;
import org.teiid.dqp.internal.process.DQPCore;
+import org.teiid.dqp.internal.process.DQPCore.ContextProvider;
import org.teiid.dqp.internal.process.DQPWorkContext;
import org.teiid.dqp.internal.process.DataTierManagerImpl;
import org.teiid.dqp.internal.process.TransactionServerImpl;
@@ -109,14 +110,11 @@
import org.teiid.metadata.Procedure;
import org.teiid.metadata.Schema;
import org.teiid.metadata.Table;
+import org.teiid.metadata.Table.TriggerEvent;
import org.teiid.metadata.TableStats;
-import org.teiid.metadata.Table.TriggerEvent;
import org.teiid.net.TeiidURL;
-import org.teiid.query.QueryPlugin;
import org.teiid.query.metadata.TransformationMetadata;
-import org.teiid.query.optimizer.relational.RelationalPlanner;
import org.teiid.query.processor.DdlPlan;
-import org.teiid.query.tempdata.TempTableStore;
import org.teiid.security.SecurityHelper;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.ClientServiceRegistryImpl;
@@ -153,6 +151,7 @@
private String eventDistributorName;
private transient EventDistributor eventDistributor;
private transient EventDistributor eventDistributorProxy;
+ private transient ContainerLifeCycleListener lifecycleListener;
public RuntimeEngineDeployer() {
// TODO: this does not belong here
@@ -294,7 +293,9 @@
dqpCore.clearCache(Cache.PREPARED_PLAN_CACHE.toString(), name, version);
dqpCore.clearCache(Cache.QUERY_SERVICE_RESULT_SET_CACHE.toString(), name, version);
}
- });
+ });
+
+ synchronizeMaterializeViews();
}
public void stop() {
@@ -548,21 +549,11 @@
@Override
@ManagementOperation(description="Execute a sql query", params={@ManagementParameter(name="vdbName"),@ManagementParameter(name="vdbVersion"), @ManagementParameter(name="command"), @ManagementParameter(name="timoutInMilli")})
public List<List> executeQuery(final String vdbName, final int version, final String command, final long timoutInMilli) throws AdminException {
- Properties properties = new Properties();
- properties.setProperty(TeiidURL.JDBC.VDB_NAME, vdbName);
- properties.setProperty(TeiidURL.JDBC.VDB_VERSION, String.valueOf(version));
String user = "JOPR ADMIN"; //$NON-NLS-1$
LogManager.logDetail(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("admin_executing", user, command)); //$NON-NLS-1$
- SessionMetadata session = null;
- try {
- session = this.sessionService.createSession(user, null, "JOPR", properties, false, false); //$NON-NLS-1$
- } catch (SessionServiceException e1) {
- throw new AdminProcessingException(e1);
- } catch (LoginException e1) {
- throw new AdminProcessingException(e1);
- }
+ SessionMetadata session = createTemporarySession(vdbName, version, user);
final long requestID = 0L;
@@ -580,8 +571,12 @@
request.setExecutionId(0L);
request.setRowLimit(getMaxRowsFetchSize()); // this would limit the number of rows that are returned.
Future<ResultsMessage> message = dqpCore.executeRequest(requestID, request);
- ResultsMessage rm = message.get(timoutInMilli, TimeUnit.MILLISECONDS);
-
+ ResultsMessage rm = null;
+ if (timoutInMilli < 0) {
+ rm = message.get();
+ } else {
+ rm = message.get(timoutInMilli, TimeUnit.MILLISECONDS);
+ }
if (rm.getException() != null) {
throw new AdminProcessingException(rm.getException());
}
@@ -616,6 +611,23 @@
} catch (InvalidSessionException e) { //ignore
}
}
+ }
+
+ private SessionMetadata createTemporarySession(final String vdbName, final int version, final String user)
+ throws AdminProcessingException {
+ Properties properties = new Properties();
+ properties.setProperty(TeiidURL.JDBC.VDB_NAME, vdbName);
+ properties.setProperty(TeiidURL.JDBC.VDB_VERSION, String.valueOf(version));
+
+ SessionMetadata session = null;
+ try {
+ session = this.sessionService.createSession(user, null, "JOPR", properties, false, false); //$NON-NLS-1$
+ } catch (SessionServiceException e1) {
+ throw new AdminProcessingException(e1);
+ } catch (LoginException e1) {
+ throw new AdminProcessingException(e1);
+ }
+ return session;
}
/**
@@ -669,22 +681,15 @@
@Override
public void updateMatViewRow(String vdbName, int vdbVersion, String schema,
String viewName, List<?> tuple, boolean delete) {
- VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
- if (vdb == null) {
- return;
- }
- TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
- if (globalStore == null) {
- return;
- }
- try {
- this.dqpCore.getDataTierManager().updateMatViewRow(globalStore, RelationalPlanner.MAT_PREFIX + (schema + '.' + viewName).toUpperCase(), tuple, delete);
- } catch (TeiidException e) {
- LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
- }
+ this.dqpCore.updateMatViewRow(getcontextProvider(), vdbName, vdbVersion, schema, viewName, tuple, delete);
}
@Override
+ public void refreshMatView(final String vdbName, final int vdbVersion, final String viewName) {
+ this.dqpCore.refreshMatView(getcontextProvider(), vdbName, vdbVersion, viewName);
+ }
+
+ @Override
public void dataModification(String vdbName, int vdbVersion, String schema,
String... tableNames) {
updateModified(true, vdbName, vdbVersion, schema, tableNames);
@@ -816,4 +821,38 @@
return this.eventDistributorProxy;
}
+ private void synchronizeMaterializeViews() {
+ this.lifecycleListener.addListener(new ContainerLifeCycleListener.LifeCycleEventListener() {
+ @Override
+ public void onStartupFinish() {
+ dqpCore.synchronizeInternalMaterializedViews(getcontextProvider());
+ }
+ @Override
+ public void onShutdownStart() {
+ }
+ });
+ }
+
+ private ContextProvider getcontextProvider() {
+ return new DQPCore.ContextProvider() {
+ @Override
+ public DQPWorkContext getContext(final String vdbName, final int vdbVersion) {
+ return new DQPWorkContext() {
+ public VDBMetaData getVDB() {
+ return vdbRepository.getVDB(vdbName, vdbVersion);
+ }
+ public String getVdbName() {
+ return vdbName;
+ }
+ public int getVdbVersion() {
+ return vdbVersion;
+ }
+ };
+ }
+ };
+ }
+
+ public void setContainerLifeCycleListener(ContainerLifeCycleListener listener) {
+ this.lifecycleListener = listener;
+ }
}
Modified: trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-07-30 12:41:32 UTC (rev 3351)
@@ -47,4 +47,4 @@
template_not_found=Template not found for {0}
admin_executing=JOPR admin {0} is executing command {1}
-DQPCore.unable_to_process_event=Unable to process event.
+DQPCore.unable_to_process_event=Unable to process event.
Modified: trunk/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java 2011-07-30 12:31:35 UTC (rev 3350)
+++ trunk/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java 2011-07-30 12:41:32 UTC (rev 3351)
@@ -23,4 +23,10 @@
public interface ContainerLifeCycleListener {
boolean isShutdownInProgress();
+ void addListener(LifeCycleEventListener listener);
+
+ public static interface LifeCycleEventListener{
+ void onStartupFinish();
+ void onShutdownStart();
+ }
}
13 years, 4 months
teiid SVN: r3350 - in branches/7.4.x/engine/src: test/java/org/teiid/query/processor and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-07-30 08:31:35 -0400 (Sat, 30 Jul 2011)
New Revision: 3350
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
Log:
TEIID-1690 fix for npe in xquery processing
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java 2011-07-28 21:06:28 UTC (rev 3349)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java 2011-07-30 12:31:35 UTC (rev 3350)
@@ -242,8 +242,11 @@
public SaxonXQueryExpression clone() {
SaxonXQueryExpression clone = new SaxonXQueryExpression();
clone.xQuery = xQuery;
+ clone.xQueryString = xQueryString;
clone.config = config;
clone.contextRoot = contextRoot;
+ clone.namespaceMap = namespaceMap;
+ clone.streamingPathFilter = streamingPathFilter;
return clone;
}
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2011-07-28 21:06:28 UTC (rev 3349)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2011-07-30 12:31:35 UTC (rev 3350)
@@ -38,10 +38,16 @@
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.core.types.BlobImpl;
import org.teiid.core.types.BlobType;
+import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.InputStreamFactory;
import org.teiid.core.util.ObjectConverterUtil;
import org.teiid.core.util.TimestampWithTimezone;
import org.teiid.core.util.UnitTestUtil;
+import org.teiid.metadata.MetadataStore;
+import org.teiid.metadata.Schema;
+import org.teiid.metadata.Table;
+import org.teiid.query.mapping.relational.QueryNode;
+import org.teiid.query.metadata.TransformationMetadata;
import org.teiid.query.optimizer.capabilities.DefaultCapabilitiesFinder;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.query.unittest.TimestampUtil;
@@ -187,6 +193,32 @@
process(sql, expected);
}
+ @Test public void testXmlTableInView() throws Exception {
+ String sql = "select * from g1"; //$NON-NLS-1$
+
+ List<?>[] expected = new List<?>[] {
+ Arrays.asList(null, "first"),
+ Arrays.asList("attr", "second"),
+ };
+
+ MetadataStore metadataStore = new MetadataStore();
+ // Create models
+ Schema vm1 = RealMetadataFactory.createVirtualModel("vm1", metadataStore); //$NON-NLS-1$
+
+ QueryNode vm1g1n1 = new QueryNode("select * from xmltable('/a/b' passing convert('<a><b>first</b><b x=\"attr\">second</b></a>', xml) columns x string path '@x', val string path '/.') as x"); //$NON-NLS-1$ //$NON-NLS-2$
+ Table vm1g1 = RealMetadataFactory.createVirtualGroup("g1", vm1, vm1g1n1); //$NON-NLS-1$
+
+ RealMetadataFactory.createElements(vm1g1,
+ new String[] { "x", "val" }, //$NON-NLS-1$
+ new String[] { DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING });
+ // Create the facade from the store
+ TransformationMetadata metadata = RealMetadataFactory.createTransformationMetadata(metadataStore, "example");
+
+ ProcessorPlan plan = helpGetPlan(helpParse(sql), metadata, new DefaultCapabilitiesFinder(), createCommandContext());
+
+ helpProcess(plan, createCommandContext(), dataManager, expected);
+ }
+
@Test public void testXmlTableDefaultAndParent() throws Exception {
String sql = "select * from xmltable('/a/b' passing convert('<a y=\"rev\"><b>first</b><b x=\"1\">second</b></a>', xml) columns x integer default -1 path '@x' , val string path '../@y') as x"; //$NON-NLS-1$
13 years, 4 months
teiid SVN: r3349 - in branches/7.4.x: build/kits/jboss-container/deploy/teiid and 8 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-07-28 17:06:28 -0400 (Thu, 28 Jul 2011)
New Revision: 3349
Modified:
branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
branches/7.4.x/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties
branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java
branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
branches/7.4.x/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
branches/7.4.x/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java
Log:
TEIID-1689: implemented the IMV sync-up with other nodes at the start up in clustered mode. Based on the replicated CacheID keys found Jboss cache, the node issues the "refreshMatView" calls asynchronously for each view.
Modified: branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-07-28 21:06:28 UTC (rev 3349)
@@ -102,6 +102,7 @@
<property name="resultsetCacheConfig"><inject bean="ResultsetCacheConfig"/></property>
<property name="preparedPlanCacheConfig"><inject bean="PreparedPlanCacheConfig"/></property>
<property name="authorizationValidator"><inject bean="AuthorizationValidator"/></property>
+ <property name="containerLifeCycleListener"><inject bean="JBossLifeCycleListener"/></property>
<!-- Process pool maximum thread count. (default 64) -->
<property name="maxThreads">64</property>
<!-- Max active plans (default 20). Increase this value on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts. -->
Modified: branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2011-07-28 21:06:28 UTC (rev 3349)
@@ -63,6 +63,12 @@
<LI><B>Streaming XQuery</B> - in situations where document projection applies if the XMLQUERY/XMLTABLE path expressions meet certain conditions, then the incoming document will not only be projected, but the independent subtrees will be processed without loading the entire document. This allows for nearly arbitrarily large XML documents to be processed. See the Reference for more.
<LI><B>Logging Procedures</B> - added SYSADMIN.isLoggable and SYSADMIN.logMsg to aid in debugging procedure logic.
<LI><B>ODBC Cursors</B> - Capability to use "UseDeclareFetch" with ODBC is added. This enables user to read the results in batches, especially useful when dealing with large row count of results.
+ <LI><B>Internal Materialized Views</B>
+ <UL>
+ <LI><B>Distributed Refresh</B> - When a internal materialized view is refreshed at one node, an event is issued to all other nodes in the cluster to asynchronously fetch the new contents.
+ <LI><B>Sync at Start</B> - When a node is restarted in a cluster, at end of start cycle Teiid will asynchronously fetch the cached internal materialized view contents from other nodes.
+ </UL>
+ </LI>
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
Modified: branches/7.4.x/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml
===================================================================
--- branches/7.4.x/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/documentation/caching-guide/src/main/docbook/en-US/content/matviews.xml 2011-07-28 21:06:28 UTC (rev 3349)
@@ -120,6 +120,22 @@
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>SYSADMIN.refreshMatView</code> procedure is called, it will return -1 immediately rather than preempting the current load.
</para>
+ <para>
+ When Teiid is running clustered mode, after of loading of internal materialized view contents, an event will be sent to all
+ the other participating nodes in the cluster to refresh the contents from the original node in asynchronus fashion.
+ During this remote node loading process, if the node that is reading the contents gets a request from user to serve the
+ results of that view, then the current results in cache will be served. If no results were available at that node, then
+ request will be blocked until load process is finished.
+ </para>
+ <para>
+ When a Teiid node joins the cluster, at the end of start-up cycle, an asynchronus job
+ will be started to fetch all the previously cached internal materialized views at other nodes
+ for the deployed VDBs. The query request behaviour during this load process is same as above.
+ </para>
+ <note><para>In the clustered mode, the "invalidate=true" flag in the "SYSADMIN.refreshMatView" procedure
+ will only apply to the node that is refreshing the contents from source. All other nodes, will still serve the
+ old contents during the refresh process.</para>
+ </note>
<section>
<title>TTL Snapshot Refresh</title>
<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 (ttl).
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-07-28 21:06:28 UTC (rev 3349)
@@ -28,6 +28,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.FutureTask;
@@ -42,10 +43,11 @@
import org.teiid.adminapi.Request.ThreadState;
import org.teiid.adminapi.impl.CacheStatisticsMetadata;
import org.teiid.adminapi.impl.RequestMetadata;
+import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
import org.teiid.cache.CacheConfiguration;
+import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.cache.CacheFactory;
-import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.client.DQP;
import org.teiid.client.RequestMessage;
import org.teiid.client.ResultsMessage;
@@ -57,24 +59,29 @@
import org.teiid.client.xa.XidImpl;
import org.teiid.common.buffer.BufferManager;
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.Streamable;
+import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
import org.teiid.dqp.internal.process.ThreadReuseExecutor.PrioritizedRunnable;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.RequestID;
import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.TransactionContext;
+import org.teiid.dqp.service.TransactionContext.Scope;
import org.teiid.dqp.service.TransactionService;
-import org.teiid.dqp.service.TransactionContext.Scope;
import org.teiid.events.EventDistributor;
import org.teiid.logging.CommandLogMessage;
+import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.metadata.MetadataRepository;
import org.teiid.query.QueryPlugin;
+import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.metadata.TempMetadataAdapter;
+import org.teiid.query.optimizer.relational.RelationalPlanner;
import org.teiid.query.tempdata.TempTableDataManager;
import org.teiid.query.tempdata.TempTableStore;
@@ -173,9 +180,12 @@
requests.remove(requestID);
}
}
-
}
+ public static interface ContextProvider {
+ DQPWorkContext getContext(String vdbName, int vdbVersion);
+ }
+
private ThreadReuseExecutor processWorkerPool;
// Resources
@@ -405,7 +415,7 @@
}
}
- public void addWork(Runnable work) {
+ void addWork(Runnable work) {
this.processWorkerPool.execute(work);
}
@@ -730,10 +740,92 @@
processorDataManager.setMetadataRepository(metadataRepository);
dataTierMgr = new TempTableDataManager(processorDataManager, this.bufferManager, this.processWorkerPool, this.rsCache, this.matTables, this.cacheFactory);
dataTierMgr.setEventDistributor(eventDistributor);
-
+
LogManager.logDetail(LogConstants.CTX_DQP, "DQPCore started maxThreads", this.config.getMaxThreads(), "maxActivePlans", this.maxActivePlans, "source concurrency", this.userRequestSourceConcurrency); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+ public void synchronizeInternalMaterializedViews(final ContextProvider contextProvider) {
+ if (!cacheFactory.isReplicated() || matTables == null) {
+ return;
+ }
+ Set<CacheID> keys = this.matTables.replicatableKeys();
+ for (final CacheID key:keys) {
+ refreshMatView(contextProvider, key.getVDBKey().getName(), key.getVDBKey().getVersion(), key.getSql());
+ }
+ }
+
+ public void refreshMatView(final ContextProvider contextProvider, final String vdbName, final int vdbVersion, final String viewName) {
+ if (!cacheFactory.isReplicated() || matTables == null) {
+ return;
+ }
+
+ final DQPWorkContext context = contextProvider.getContext(vdbName, vdbVersion);
+
+ final VDBMetaData vdb = context.getVDB();
+ if (vdb == null) {
+ return;
+ }
+
+ final TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
+ if (globalStore == null) {
+ return;
+ }
+ DQPWorkContext.setWorkContext(context);
+
+ Runnable work = new Runnable() {
+ @Override
+ public void run() {
+ QueryMetadataInterface metadata = vdb.getAttachment(QueryMetadataInterface.class);
+ TempTableStore tempStore = new TempTableStore("internal"); //$NON-NLS-1$
+ TempMetadataAdapter tma = new TempMetadataAdapter(metadata, tempStore.getMetadataStore());
+ try {
+ dataTierMgr.refreshMatView(vdb.getName(), vdb.getVersion(), viewName, tma, globalStore);
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("error_refresh", viewName )); //$NON-NLS-1$
+ }
+ }
+ };
+ addWork(work);
+ }
+
+ public void updateMatViewRow(final ContextProvider contextProvider, final String vdbName, final int vdbVersion, final String schema,
+ final String viewName, final List<?> tuple, final boolean delete) {
+
+ if (!cacheFactory.isReplicated() || matTables == null) {
+ return;
+ }
+
+ final DQPWorkContext context = contextProvider.getContext(vdbName, vdbVersion);
+
+ final VDBMetaData vdb = context.getVDB();
+ if (vdb == null) {
+ return;
+ }
+
+ final TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
+ if (globalStore == null) {
+ return;
+ }
+
+ Runnable work = new Runnable() {
+ @Override
+ public void run() {
+ context.runInContext(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ dataTierMgr.updateMatViewRow(globalStore, RelationalPlanner.MAT_PREFIX + (schema + '.' + viewName).toUpperCase(), tuple, delete);
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
+ }
+ }
+ });
+ }
+ };
+ addWork(work);
+
+ }
+
public void setBufferService(BufferService service) {
this.bufferService = service;
}
@@ -925,5 +1017,4 @@
SessionAwareCache<PreparedPlan> getPrepPlanCache() {
return prepPlanCache;
}
-
}
\ No newline at end of file
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-07-28 21:06:28 UTC (rev 3349)
@@ -24,6 +24,7 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
@@ -291,6 +292,10 @@
void setUserName(String name) {
this.userName = name;
}
+
+ public VDBKey getVDBKey() {
+ return vdbInfo;
+ }
public boolean equals(Object obj){
if(obj == this) {
@@ -328,4 +333,11 @@
public void setModTime(long modTime) {
this.modTime = modTime;
}
+
+ public Set<CacheID> replicatableKeys() {
+ if (this.distributedCache == this.localCache) {
+ return Collections.EMPTY_SET;
+ }
+ return this.distributedCache.keys();
+ }
}
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-07-28 21:06:28 UTC (rev 3349)
@@ -550,7 +550,7 @@
TupleSource ts = null;
CacheID cid = null;
if (distributedCache != null) {
- cid = new CacheID(new ParseInfo(), fullName, context.getVdbName(),
+ cid = new CacheID(new ParseInfo(), viewName, context.getVdbName(),
context.getVdbVersion(), context.getConnectionID(), context.getUserName());
if (useCache) {
CachedResults cr = this.distributedCache.get(cid);
Modified: branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties 2011-07-28 21:06:28 UTC (rev 3349)
@@ -923,4 +923,5 @@
ValidationVisitor.not_a_procedure={0} is not a valid virtual procedure.
DdlPlan.event_not_exists={0} does not have an INSTEAD OF trigger defined for {1}.
-DdlPlan.event_already_exists={0} already has an INSTEAD OF trigger defined for {1}.
\ No newline at end of file
+DdlPlan.event_already_exists={0} already has an INSTEAD OF trigger defined for {1}.
+error_refresh=error occurred during refreshing the materialized view entries for view {0}
\ No newline at end of file
Modified: branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java
===================================================================
--- branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/JBossLifeCycleListener.java 2011-07-28 21:06:28 UTC (rev 3349)
@@ -21,6 +21,10 @@
*/
package org.teiid.jboss;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
import javax.management.InstanceNotFoundException;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
@@ -39,6 +43,7 @@
public final String STOP_NOTIFICATION_TYPE = "org.jboss.system.server.stopped"; //$NON-NLS-1$
private boolean shutdownInProgress = false;
+ private List<ContainerLifeCycleListener.LifeCycleEventListener> listeners = Collections.synchronizedList(new ArrayList<ContainerLifeCycleListener.LifeCycleEventListener>());
public JBossLifeCycleListener() {
try {
@@ -56,10 +61,16 @@
public void handleNotification(Notification msg, Object handback) {
String type = msg.getType();
if (type.equals(START_NOTIFICATION_TYPE)) {
+ for (ContainerLifeCycleListener.LifeCycleEventListener l:listeners) {
+ l.onStartupFinish();
+ }
}
if (type.equals(STOP_NOTIFICATION_TYPE)) {
shutdownInProgress = true;
+ for (ContainerLifeCycleListener.LifeCycleEventListener l:listeners) {
+ l.onShutdownStart();
+ }
}
}
@@ -67,4 +78,9 @@
public boolean isShutdownInProgress() {
return shutdownInProgress;
}
+
+ @Override
+ public void addListener(LifeCycleEventListener listener) {
+ listeners.add(listener);
+ }
}
Modified: branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-07-28 21:06:28 UTC (rev 3349)
@@ -60,10 +60,10 @@
import org.jboss.profileservice.spi.ProfileService;
import org.jboss.util.naming.Util;
import org.teiid.adminapi.Admin;
+import org.teiid.adminapi.Admin.Cache;
import org.teiid.adminapi.AdminComponentException;
import org.teiid.adminapi.AdminException;
import org.teiid.adminapi.AdminProcessingException;
-import org.teiid.adminapi.Admin.Cache;
import org.teiid.adminapi.impl.CacheStatisticsMetadata;
import org.teiid.adminapi.impl.DQPManagement;
import org.teiid.adminapi.impl.RequestMetadata;
@@ -81,14 +81,15 @@
import org.teiid.client.util.ResultsFuture;
import org.teiid.core.ComponentNotFoundException;
import org.teiid.core.TeiidComponentException;
-import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.LRUCache;
+import org.teiid.deployers.ContainerLifeCycleListener;
import org.teiid.deployers.VDBLifeCycleListener;
import org.teiid.deployers.VDBRepository;
import org.teiid.deployers.VDBStatusChecker;
import org.teiid.dqp.internal.process.DQPConfiguration;
import org.teiid.dqp.internal.process.DQPCore;
+import org.teiid.dqp.internal.process.DQPCore.ContextProvider;
import org.teiid.dqp.internal.process.DQPWorkContext;
import org.teiid.dqp.internal.process.DataTierManagerImpl;
import org.teiid.dqp.internal.process.TransactionServerImpl;
@@ -109,16 +110,11 @@
import org.teiid.metadata.Procedure;
import org.teiid.metadata.Schema;
import org.teiid.metadata.Table;
-import org.teiid.metadata.TableStats;
import org.teiid.metadata.Table.TriggerEvent;
+import org.teiid.metadata.TableStats;
import org.teiid.net.TeiidURL;
-import org.teiid.query.QueryPlugin;
-import org.teiid.query.metadata.QueryMetadataInterface;
-import org.teiid.query.metadata.TempMetadataAdapter;
import org.teiid.query.metadata.TransformationMetadata;
-import org.teiid.query.optimizer.relational.RelationalPlanner;
import org.teiid.query.processor.DdlPlan;
-import org.teiid.query.tempdata.TempTableStore;
import org.teiid.security.SecurityHelper;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.ClientServiceRegistryImpl;
@@ -155,6 +151,7 @@
private String eventDistributorName;
private transient EventDistributor eventDistributor;
private transient EventDistributor eventDistributorProxy;
+ private transient ContainerLifeCycleListener lifecycleListener;
public RuntimeEngineDeployer() {
// TODO: this does not belong here
@@ -296,7 +293,9 @@
dqpCore.clearCache(Cache.PREPARED_PLAN_CACHE.toString(), name, version);
dqpCore.clearCache(Cache.QUERY_SERVICE_RESULT_SET_CACHE.toString(), name, version);
}
- });
+ });
+
+ synchronizeMaterializeViews();
}
public void stop() {
@@ -682,67 +681,12 @@
@Override
public void updateMatViewRow(String vdbName, int vdbVersion, String schema,
String viewName, List<?> tuple, boolean delete) {
- VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
- if (vdb == null) {
- return;
- }
- TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
- if (globalStore == null) {
- return;
- }
- try {
- this.dqpCore.getDataTierManager().updateMatViewRow(globalStore, RelationalPlanner.MAT_PREFIX + (schema + '.' + viewName).toUpperCase(), tuple, delete);
- } catch (TeiidException e) {
- LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
- }
+ this.dqpCore.updateMatViewRow(getcontextProvider(), vdbName, vdbVersion, schema, viewName, tuple, delete);
}
@Override
public void refreshMatView(final String vdbName, final int vdbVersion, final String viewName) {
- final VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
- if (vdb == null) {
- return;
- }
- final TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
- if (globalStore == null) {
- return;
- }
-
- Runnable refreshWork = new Runnable() {
- @Override
- public void run() {
- SessionMetadata session = null;
- try {
- session = createTemporarySession(vdbName, vdbVersion, "internal"); //$NON-NLS-1$
-
- DQPWorkContext context = new DQPWorkContext();
- context.setSession(session);
- Runnable work = new Runnable() {
- @Override
- public void run() {
- QueryMetadataInterface metadata = vdb.getAttachment(QueryMetadataInterface.class);
- TempTableStore tempStore = new TempTableStore("internal"); //$NON-NLS-1$
- TempMetadataAdapter tma = new TempMetadataAdapter(metadata, tempStore.getMetadataStore());
- try {
- dqpCore.getDataTierManager().refreshMatView(vdbName, vdbVersion, viewName, tma, globalStore);
- } catch (TeiidException e) {
- LogManager.logError(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.getString("error_refresh", viewName )); //$NON-NLS-1$
- }
- }
- };
- context.runInContext(work);
- } catch (AdminProcessingException e) {
- LogManager.logError(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.getString("error_refresh", viewName )); //$NON-NLS-1$
- } finally {
- try {
- sessionService.closeSession(session.getSessionId());
- } catch (InvalidSessionException e) {
- // ignore
- }
- }
- }
- };
- this.dqpCore.addWork(refreshWork);
+ this.dqpCore.refreshMatView(getcontextProvider(), vdbName, vdbVersion, viewName);
}
@Override
@@ -877,4 +821,38 @@
return this.eventDistributorProxy;
}
+ private void synchronizeMaterializeViews() {
+ this.lifecycleListener.addListener(new ContainerLifeCycleListener.LifeCycleEventListener() {
+ @Override
+ public void onStartupFinish() {
+ dqpCore.synchronizeInternalMaterializedViews(getcontextProvider());
+ }
+ @Override
+ public void onShutdownStart() {
+ }
+ });
+ }
+
+ private ContextProvider getcontextProvider() {
+ return new DQPCore.ContextProvider() {
+ @Override
+ public DQPWorkContext getContext(final String vdbName, final int vdbVersion) {
+ return new DQPWorkContext() {
+ public VDBMetaData getVDB() {
+ return vdbRepository.getVDB(vdbName, vdbVersion);
+ }
+ public String getVdbName() {
+ return vdbName;
+ }
+ public int getVdbVersion() {
+ return vdbVersion;
+ }
+ };
+ }
+ };
+ }
+
+ public void setContainerLifeCycleListener(ContainerLifeCycleListener listener) {
+ this.lifecycleListener = listener;
+ }
}
Modified: branches/7.4.x/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- branches/7.4.x/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-07-28 21:06:28 UTC (rev 3349)
@@ -47,5 +47,4 @@
template_not_found=Template not found for {0}
admin_executing=JOPR admin {0} is executing command {1}
-DQPCore.unable_to_process_event=Unable to process event.
-error_refresh=error occurred during refreshing the materialized view entries for view {0}
+DQPCore.unable_to_process_event=Unable to process event.
Modified: branches/7.4.x/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java
===================================================================
--- branches/7.4.x/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java 2011-07-28 20:03:06 UTC (rev 3348)
+++ branches/7.4.x/runtime/src/main/java/org/teiid/deployers/ContainerLifeCycleListener.java 2011-07-28 21:06:28 UTC (rev 3349)
@@ -23,4 +23,10 @@
public interface ContainerLifeCycleListener {
boolean isShutdownInProgress();
+ void addListener(LifeCycleEventListener listener);
+
+ public static interface LifeCycleEventListener{
+ void onStartupFinish();
+ void onShutdownStart();
+ }
}
13 years, 4 months
teiid SVN: r3348 - trunk/documentation/developer-guide/src/main/docbook/en-US/content.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-07-28 16:03:06 -0400 (Thu, 28 Jul 2011)
New Revision: 3348
Modified:
trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
Log:
TEIID-1667 finishing off window function support
Modified: trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
===================================================================
--- trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2011-07-28 19:58:08 UTC (rev 3347)
+++ trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2011-07-28 20:03:06 UTC (rev 3348)
@@ -380,12 +380,18 @@
</listitem>
<listitem>
<para>
- <code>Aggregate</code>
- – represents an aggregate function which holds a single expression
+ <code>AggregateFunction</code>
+ – represents an aggregate function which can hold a single expression
</para>
</listitem>
<listitem>
<para>
+ <code>WindowFunction</code>
+ – represents an window function which holds an AggregateFunction (which is also used to represent analytical functions) and a WindowSpecification
+ </para>
+ </listitem>
+ <listitem>
+ <para>
<code>ScalarSubquery</code>
– represents a subquery that returns a single value
</para>
@@ -1300,6 +1306,17 @@
</row>
<row>
<entry>
+ <para>WindowOrderByWithAggregates</para>
+ </entry>
+ <entry>
+ <para/>
+ </entry>
+ <entry>
+ <para>Translator supports windowed aggregates with a window order by clause.</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
<para>AdvancedOlapOperations</para>
</entry>
<entry>
13 years, 4 months
teiid SVN: r3347 - in trunk: build/kits/jboss-container and 11 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-07-28 15:58:08 -0400 (Thu, 28 Jul 2011)
New Revision: 3347
Added:
trunk/documentation/reference/src/main/docbook/en-US/content/sql_clauses.xml
Modified:
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
trunk/documentation/reference/src/main/docbook/en-US/Reference.xml
trunk/documentation/reference/src/main/docbook/en-US/content/grammar.xml
trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/RankingFunction.java
trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/query/processor/TestWindowFunctions.java
Log:
TEIID-1667 finishing off window function support
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2011-07-28 19:58:08 UTC (rev 3347)
@@ -879,6 +879,14 @@
}
/**
+ * @return true if all aggregates can have window function order by clauses.
+ * @since 7.5
+ */
+ public boolean supportsWindowOrderByWithAggregates() {
+ return supportsElementaryOlapOperations();
+ }
+
+ /**
* @return true if array_agg is supported
* @since 7.5
*/
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-07-28 19:58:08 UTC (rev 3347)
@@ -26,6 +26,7 @@
</UL>
<H2><A NAME="Highlights"></A>Highlights</H2>
<UL>
+ <LI><B>Window function support</B> - Teiid and pushdown support was added for SQL 2003 OLAP window functions. The analytical ranking functions RANK, DENSE_RANK, and ROW_NUMBER were also added. See the reference for more.
<LI><B>Subquery optimization control</B> - added the DJ hint to indicate that a subquery should be the independent side of a dependent join.
<LI><B>MAKEIND Hint</B> - The MAKEIND hint can be used to indicate that the other side of the join should be made dependent.
<LI><B>ODBC SSL</B> - added support for SSL encrypted ODBC connections.
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2011-07-28 19:58:08 UTC (rev 3347)
@@ -231,5 +231,10 @@
public boolean supportsElementaryOlapOperations() {
return true;
}
+
+ @Override
+ public boolean supportsWindowOrderByWithAggregates() {
+ return false;
+ }
}
Modified: trunk/documentation/reference/src/main/docbook/en-US/Reference.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/Reference.xml 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/documentation/reference/src/main/docbook/en-US/Reference.xml 2011-07-28 19:58:08 UTC (rev 3347)
@@ -48,6 +48,7 @@
<toc />
<xi:include href="content/preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/sql_support.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="content/sql_clauses.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/ddl_support.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/xml_queries.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/datatypes.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/grammar.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/grammar.xml 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/grammar.xml 2011-07-28 19:58:08 UTC (rev 3347)
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<appendix id="grammar">
- <title>BNF for SQL Grammar</title><section>
+ <title>BNF for SQL Grammar</title>
+<section>
<title>TOKENS</title>
<informaltable frame="none">
<tgroup cols="1">
@@ -189,6 +190,7 @@
| <NOT: "not">
| <NULL: "null">
| <OF: "of">
+| <OFFSET: "offset">
| <OLD: "old">
| <ON: "on">
| <ONLY: "only">
@@ -543,15 +545,15 @@
<row>
<entry align="right" valign="top"><para><anchor id="prod16" xreflabel="insert"/>insert</para></entry>
<entry align="left" valign="top"><para>::=
-<INSERT> <INTO> <link linkend="prod2">id</link> ( <link linkend="prod47">columnList</link> )? ( ( <VALUES> <link linkend="prod48">rowValues</link> ) | ( <link linkend="prod13">queryExpression</link> ) ) ( <link linkend="prod45">option</link> )?</para></entry></row>
+<INSERT> <INTO> <link linkend="prod2">id</link> ( <link linkend="prod47">columnList</link> )? ( ( <VALUES> <LPAREN> <link linkend="prod48">expressionList</link> <RPAREN> ) | ( <link linkend="prod13">queryExpression</link> ) ) ( <link linkend="prod45">option</link> )?</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod47" xreflabel="columnList"/>columnList</para></entry>
<entry align="left" valign="top"><para>::=
<LPAREN> <link linkend="prod2">id</link> ( <COMMA> <link linkend="prod2">id</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod48" xreflabel="rowValues"/>rowValues</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod48" xreflabel="expressionList"/>expressionList</para></entry>
<entry align="left" valign="top"><para>::=
-<LPAREN> <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod24">expression</link> )* <RPAREN></para></entry></row>
+<link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod24">expression</link> )*</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod17" xreflabel="update"/>update</para></entry>
<entry align="left" valign="top"><para>::=
@@ -609,47 +611,47 @@
<entry align="left" valign="top"><para>::=
<ALL_IN_GROUP></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod66" xreflabel="xmlAgg"/>xmlAgg</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod66" xreflabel="orderedAgg"/>orderedAgg</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLAGG> <LPAREN> <link linkend="prod24">expression</link> ( <link linkend="prod53">orderby</link> )? <RPAREN></para></entry></row>
+( <XMLAGG> | <ARRAY_AGG> ) <LPAREN> <link linkend="prod24">expression</link> ( <link linkend="prod53">orderby</link> )? <RPAREN> <link linkend="prod67">filterClause</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod67" xreflabel="arrayAgg"/>arrayAgg</para></entry>
-<entry align="left" valign="top"><para>::=
-<ARRAY_AGG> <LPAREN> <link linkend="prod24">expression</link> ( <link linkend="prod53">orderby</link> )? <RPAREN></para></entry></row>
-<row>
<entry align="right" valign="top"><para><anchor id="prod68" xreflabel="textAgg"/>textAgg</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod11">nonReserved</link> <LPAREN> <FOR> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* ( <ID> <link linkend="prod69">charVal</link> )? ( ( <ID> <link linkend="prod69">charVal</link> ) )? ( <ID> )? ( ( <ID> <link linkend="prod2">id</link> ) )? ( <link linkend="prod53">orderby</link> )? <RPAREN></para></entry></row>
+<link linkend="prod11">nonReserved</link> <LPAREN> <FOR> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* ( <ID> <link linkend="prod69">charVal</link> )? ( ( <ID> <link linkend="prod69">charVal</link> ) )? ( <ID> )? ( ( <ID> <link linkend="prod2">id</link> ) )? ( <link linkend="prod53">orderby</link> )? <RPAREN> <link linkend="prod67">filterClause</link></para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod70" xreflabel="aggregateSymbol"/>aggregateSymbol</para></entry>
<entry align="left" valign="top"><para>::=
-( ( <link linkend="prod11">nonReserved</link> <LPAREN> <STAR> <RPAREN> ) | ( ( <link linkend="prod11">nonReserved</link> | <ANY> | <SOME> ) <LPAREN> ( <DISTINCT> | <ALL> )? <link linkend="prod24">expression</link> <RPAREN> ) )</para></entry></row>
+( ( ( <link linkend="prod11">nonReserved</link> <LPAREN> <STAR> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <RPAREN> ) | ( ( <link linkend="prod11">nonReserved</link> | <ANY> | <SOME> ) <LPAREN> ( <DISTINCT> | <ALL> )? <link linkend="prod24">expression</link> <RPAREN> ) ) <link linkend="prod67">filterClause</link> )</para></entry></row>
<row>
+<entry align="right" valign="top"><para><anchor id="prod67" xreflabel="filterClause"/>filterClause</para></entry>
+<entry align="left" valign="top"><para>::=
+( <FILTER> <LPAREN> <WHERE> <link linkend="prod71">booleanPrimary</link> <RPAREN> )?</para></entry></row>
+<row>
<entry align="right" valign="top"><para><anchor id="prod59" xreflabel="from"/>from</para></entry>
<entry align="left" valign="top"><para>::=
-<FROM> ( <link linkend="prod71">tableReference</link> ( <COMMA> <link linkend="prod71">tableReference</link> )* )</para></entry></row>
+<FROM> ( <link linkend="prod72">tableReference</link> ( <COMMA> <link linkend="prod72">tableReference</link> )* )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod71" xreflabel="tableReference"/>tableReference</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod72" xreflabel="tableReference"/>tableReference</para></entry>
<entry align="left" valign="top"><para>::=
-( ( <LBRACE> <link linkend="prod11">nonReserved</link> <link linkend="prod72">joinedTable</link> <RBRACE> ) | <link linkend="prod72">joinedTable</link> )</para></entry></row>
+( ( <LBRACE> <link linkend="prod11">nonReserved</link> <link linkend="prod73">joinedTable</link> <RBRACE> ) | <link linkend="prod73">joinedTable</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod72" xreflabel="joinedTable"/>joinedTable</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod73" xreflabel="joinedTable"/>joinedTable</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod73">tablePrimary</link> ( ( <link linkend="prod74">crossJoin</link> | <link linkend="prod75">qualifiedJoin</link> ) )*</para></entry></row>
+<link linkend="prod74">tablePrimary</link> ( ( <link linkend="prod75">crossJoin</link> | <link linkend="prod76">qualifiedJoin</link> ) )*</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod74" xreflabel="crossJoin"/>crossJoin</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod75" xreflabel="crossJoin"/>crossJoin</para></entry>
<entry align="left" valign="top"><para>::=
-( ( <CROSS> | <UNION> ) <JOIN> <link linkend="prod73">tablePrimary</link> )</para></entry></row>
+( ( <CROSS> | <UNION> ) <JOIN> <link linkend="prod74">tablePrimary</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod75" xreflabel="qualifiedJoin"/>qualifiedJoin</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod76" xreflabel="qualifiedJoin"/>qualifiedJoin</para></entry>
<entry align="left" valign="top"><para>::=
-( ( ( <RIGHT> ( <OUTER> )? ) | ( <LEFT> ( <OUTER> )? ) | ( <FULL> ( <OUTER> )? ) | <INNER> )? <JOIN> <link linkend="prod71">tableReference</link> <ON> <link linkend="prod35">criteria</link> )</para></entry></row>
+( ( ( <RIGHT> ( <OUTER> )? ) | ( <LEFT> ( <OUTER> )? ) | ( <FULL> ( <OUTER> )? ) | <INNER> )? <JOIN> <link linkend="prod72">tableReference</link> <ON> <link linkend="prod35">criteria</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod73" xreflabel="tablePrimary"/>tablePrimary</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod74" xreflabel="tablePrimary"/>tablePrimary</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod76">textTable</link> | <link linkend="prod77">arrayTable</link> | <link linkend="prod78">xmlTable</link> | <link linkend="prod79">unaryFromClause</link> | <link linkend="prod80">subqueryFromClause</link> | ( <LPAREN> <link linkend="prod72">joinedTable</link> <RPAREN> ) ) ( ( <MAKEDEP> ) | ( <MAKENOTDEP> ) )?</para></entry></row>
+( <link linkend="prod77">textTable</link> | <link linkend="prod78">arrayTable</link> | <link linkend="prod79">xmlTable</link> | <link linkend="prod80">unaryFromClause</link> | <link linkend="prod81">subqueryFromClause</link> | ( <LPAREN> <link linkend="prod73">joinedTable</link> <RPAREN> ) ) ( ( <MAKEDEP> ) | ( <MAKENOTDEP> ) )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod81" xreflabel="xmlSerialize"/>xmlSerialize</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod82" xreflabel="xmlSerialize"/>xmlSerialize</para></entry>
<entry align="left" valign="top"><para>::=
<XMLSERIALIZE> <LPAREN> ( <link linkend="prod11">nonReserved</link> )? <link linkend="prod24">expression</link> ( <AS> ( <STRING> | <VARCHAR> | <CLOB> ) )? <RPAREN></para></entry></row>
<row>
@@ -657,39 +659,39 @@
<entry align="left" valign="top"><para>::=
<ID></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod77" xreflabel="arrayTable"/>arrayTable</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod78" xreflabel="arrayTable"/>arrayTable</para></entry>
<entry align="left" valign="top"><para>::=
<ID> <LPAREN> <link linkend="prod24">expression</link> <link linkend="prod11">nonReserved</link> <link linkend="prod42">createElementsWithTypes</link> <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod76" xreflabel="textTable"/>textTable</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod77" xreflabel="textTable"/>textTable</para></entry>
<entry align="left" valign="top"><para>::=
-<ID> <LPAREN> <link linkend="prod24">expression</link> <link linkend="prod11">nonReserved</link> <link linkend="prod82">textColumn</link> ( <COMMA> <link linkend="prod82">textColumn</link> )* ( <ID> <link linkend="prod69">charVal</link> )? ( ( <ESCAPE> <link linkend="prod69">charVal</link> ) | ( <ID> <link linkend="prod69">charVal</link> ) )? ( <ID> ( <link linkend="prod83">intVal</link> )? )? ( <ID> <link linkend="prod83">intVal</link> )? <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
+<ID> <LPAREN> <link linkend="prod24">expression</link> <link linkend="prod11">nonReserved</link> <link linkend="prod83">textColumn</link> ( <COMMA> <link linkend="prod83">textColumn</link> )* ( <ID> <link linkend="prod69">charVal</link> )? ( ( <ESCAPE> <link linkend="prod69">charVal</link> ) | ( <ID> <link linkend="prod69">charVal</link> ) )? ( <ID> ( <link linkend="prod84">intVal</link> )? )? ( <ID> <link linkend="prod84">intVal</link> )? <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod82" xreflabel="textColumn"/>textColumn</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod83" xreflabel="textColumn"/>textColumn</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod2">id</link> <link linkend="prod38">dataType</link> ( <ID> <link linkend="prod83">intVal</link> )?</para></entry></row>
+<link linkend="prod2">id</link> <link linkend="prod38">dataType</link> ( <ID> <link linkend="prod84">intVal</link> )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod84" xreflabel="xmlQuery"/>xmlQuery</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod85" xreflabel="xmlQuery"/>xmlQuery</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLQUERY> <LPAREN> ( <link linkend="prod85">xmlNamespaces</link> <COMMA> )? <link linkend="prod1">stringVal</link> ( <ID> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* )? ( ( <NULL> | <link linkend="prod11">nonReserved</link> ) <ON> <link linkend="prod11">nonReserved</link> )? <RPAREN></para></entry></row>
+<XMLQUERY> <LPAREN> ( <link linkend="prod86">xmlNamespaces</link> <COMMA> )? <link linkend="prod1">stringVal</link> ( <ID> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* )? ( ( <NULL> | <link linkend="prod11">nonReserved</link> ) <ON> <link linkend="prod11">nonReserved</link> )? <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod78" xreflabel="xmlTable"/>xmlTable</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod79" xreflabel="xmlTable"/>xmlTable</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLTABLE> <LPAREN> ( <link linkend="prod85">xmlNamespaces</link> <COMMA> )? <link linkend="prod1">stringVal</link> ( <ID> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* )? ( <ID> <link linkend="prod86">xmlColumn</link> ( <COMMA> <link linkend="prod86">xmlColumn</link> )* )? <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
+<XMLTABLE> <LPAREN> ( <link linkend="prod86">xmlNamespaces</link> <COMMA> )? <link linkend="prod1">stringVal</link> ( <ID> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* )? ( <ID> <link linkend="prod87">xmlColumn</link> ( <COMMA> <link linkend="prod87">xmlColumn</link> )* )? <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod86" xreflabel="xmlColumn"/>xmlColumn</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod87" xreflabel="xmlColumn"/>xmlColumn</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod2">id</link> ( ( <FOR> <link linkend="prod11">nonReserved</link> ) | ( <link linkend="prod38">dataType</link> ( <DEFAULT_KEYWORD> <link linkend="prod24">expression</link> )? ( <link linkend="prod11">nonReserved</link> <link linkend="prod1">stringVal</link> )? ) )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod83" xreflabel="intVal"/>intVal</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod84" xreflabel="intVal"/>intVal</para></entry>
<entry align="left" valign="top"><para>::=
<INTEGERVAL></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod80" xreflabel="subqueryFromClause"/>subqueryFromClause</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod81" xreflabel="subqueryFromClause"/>subqueryFromClause</para></entry>
<entry align="left" valign="top"><para>::=
( <TABLE> )? <LPAREN> ( <link linkend="prod13">queryExpression</link> | <link linkend="prod15">storedProcedure</link> ) <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod79" xreflabel="unaryFromClause"/>unaryFromClause</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod80" xreflabel="unaryFromClause"/>unaryFromClause</para></entry>
<entry align="left" valign="top"><para>::=
( <ID> ( ( <AS> )? <link linkend="prod2">id</link> )? )</para></entry></row>
<row>
@@ -699,21 +701,21 @@
<row>
<entry align="right" valign="top"><para><anchor id="prod35" xreflabel="criteria"/>criteria</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod87">compoundCritOr</link></para></entry></row>
+<link linkend="prod88">compoundCritOr</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod87" xreflabel="compoundCritOr"/>compoundCritOr</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod88" xreflabel="compoundCritOr"/>compoundCritOr</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod88">compoundCritAnd</link> ( <OR> <link linkend="prod88">compoundCritAnd</link> )*</para></entry></row>
+<link linkend="prod89">compoundCritAnd</link> ( <OR> <link linkend="prod89">compoundCritAnd</link> )*</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod88" xreflabel="compoundCritAnd"/>compoundCritAnd</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod89" xreflabel="compoundCritAnd"/>compoundCritAnd</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod89">notCrit</link> ( <AND> <link linkend="prod89">notCrit</link> )*</para></entry></row>
+<link linkend="prod90">notCrit</link> ( <AND> <link linkend="prod90">notCrit</link> )*</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod89" xreflabel="notCrit"/>notCrit</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod90" xreflabel="notCrit"/>notCrit</para></entry>
<entry align="left" valign="top"><para>::=
-( <NOT> )? <link linkend="prod90">booleanPrimary</link></para></entry></row>
+( <NOT> )? <link linkend="prod71">booleanPrimary</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod90" xreflabel="booleanPrimary"/>booleanPrimary</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod71" xreflabel="booleanPrimary"/>booleanPrimary</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod41">translateCriteria</link> | ( <link linkend="prod91">commonValueExpression</link> ( ( <link linkend="prod92">betweenCrit</link> | <link linkend="prod93">matchCrit</link> | <link linkend="prod94">setCrit</link> | <link linkend="prod95">isNullCrit</link> | <link linkend="prod96">subqueryCompareCriteria</link> | <link linkend="prod97">compareCrit</link> ) )? ) | <link linkend="prod98">existsCriteria</link> | <link linkend="prod37">hasCriteria</link> )</para></entry></row>
<row>
@@ -763,32 +765,36 @@
<row>
<entry align="right" valign="top"><para><anchor id="prod60" xreflabel="groupBy"/>groupBy</para></entry>
<entry align="left" valign="top"><para>::=
-<GROUP> <BY> ( <link linkend="prod102">groupByItem</link> ( <COMMA> <link linkend="prod102">groupByItem</link> )* )</para></entry></row>
+<GROUP> <BY> <link linkend="prod48">expressionList</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod102" xreflabel="groupByItem"/>groupByItem</para></entry>
-<entry align="left" valign="top"><para>::=
-<link linkend="prod24">expression</link></para></entry></row>
-<row>
<entry align="right" valign="top"><para><anchor id="prod61" xreflabel="having"/>having</para></entry>
<entry align="left" valign="top"><para>::=
<HAVING> <link linkend="prod35">criteria</link></para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod53" xreflabel="orderby"/>orderby</para></entry>
<entry align="left" valign="top"><para>::=
-<ORDER> <BY> <link linkend="prod103">sortSpecification</link> ( <COMMA> <link linkend="prod103">sortSpecification</link> )*</para></entry></row>
+<ORDER> <BY> <link linkend="prod102">sortSpecification</link> ( <COMMA> <link linkend="prod102">sortSpecification</link> )*</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod103" xreflabel="sortSpecification"/>sortSpecification</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod102" xreflabel="sortSpecification"/>sortSpecification</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod104">sortKey</link> ( <ASC> | <DESC> )? ( <link linkend="prod11">nonReserved</link> <link linkend="prod11">nonReserved</link> )?</para></entry></row>
+<link linkend="prod103">sortKey</link> ( <ASC> | <DESC> )? ( <link linkend="prod11">nonReserved</link> <link linkend="prod11">nonReserved</link> )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod104" xreflabel="sortKey"/>sortKey</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod103" xreflabel="sortKey"/>sortKey</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod24">expression</link></para></entry></row>
<row>
+<entry align="right" valign="top"><para><anchor id="prod104" xreflabel="intParam"/>intParam</para></entry>
+<entry align="left" valign="top"><para>::=
+( <link linkend="prod84">intVal</link> | <QMARK> )</para></entry></row>
+<row>
<entry align="right" valign="top"><para><anchor id="prod54" xreflabel="limit"/>limit</para></entry>
<entry align="left" valign="top"><para>::=
-<LIMIT> ( <INTEGERVAL> | <QMARK> ) ( <COMMA> ( <INTEGERVAL> | <QMARK> ) )?</para></entry></row>
+( ( <LIMIT> <link linkend="prod104">intParam</link> ( <COMMA> <link linkend="prod104">intParam</link> )? ) | ( <OFFSET> <link linkend="prod104">intParam</link> ( <ROW> | <ROWS> ) ( <link linkend="prod105">fetchLimit</link> )? ) | ( <link linkend="prod105">fetchLimit</link> ) )</para></entry></row>
<row>
+<entry align="right" valign="top"><para><anchor id="prod105" xreflabel="fetchLimit"/>fetchLimit</para></entry>
+<entry align="left" valign="top"><para>::=
+<FETCH> <link linkend="prod11">nonReserved</link> ( <link linkend="prod104">intParam</link> )? ( <ROW> | <ROWS> ) <ONLY></para></entry></row>
+<row>
<entry align="right" valign="top"><para><anchor id="prod45" xreflabel="option"/>option</para></entry>
<entry align="left" valign="top"><para>::=
<OPTION> ( <MAKEDEP> <link linkend="prod2">id</link> ( <COMMA> <link linkend="prod2">id</link> )* | <MAKENOTDEP> <link linkend="prod2">id</link> ( <COMMA> <link linkend="prod2">id</link> )* | <NOCACHE> ( <link linkend="prod2">id</link> ( <COMMA> <link linkend="prod2">id</link> )* )? )*</para></entry></row>
@@ -799,69 +805,73 @@
<row>
<entry align="right" valign="top"><para><anchor id="prod91" xreflabel="commonValueExpression"/>commonValueExpression</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod105">plusExpression</link> ( <CONCAT_OP> <link linkend="prod105">plusExpression</link> )* )</para></entry></row>
+( <link linkend="prod106">plusExpression</link> ( <CONCAT_OP> <link linkend="prod106">plusExpression</link> )* )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod105" xreflabel="plusExpression"/>plusExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod106" xreflabel="plusExpression"/>plusExpression</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod106">timesExpression</link> ( <link linkend="prod107">plusOperator</link> <link linkend="prod106">timesExpression</link> )* )</para></entry></row>
+( <link linkend="prod107">timesExpression</link> ( <link linkend="prod108">plusOperator</link> <link linkend="prod107">timesExpression</link> )* )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod107" xreflabel="plusOperator"/>plusOperator</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod108" xreflabel="plusOperator"/>plusOperator</para></entry>
<entry align="left" valign="top"><para>::=
( <PLUS> | <MINUS> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod106" xreflabel="timesExpression"/>timesExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod107" xreflabel="timesExpression"/>timesExpression</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod108">valueExpressionPrimary</link> ( <link linkend="prod109">timesOperator</link> <link linkend="prod108">valueExpressionPrimary</link> )* )</para></entry></row>
+( <link linkend="prod109">valueExpressionPrimary</link> ( <link linkend="prod110">timesOperator</link> <link linkend="prod109">valueExpressionPrimary</link> )* )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod109" xreflabel="timesOperator"/>timesOperator</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod110" xreflabel="timesOperator"/>timesOperator</para></entry>
<entry align="left" valign="top"><para>::=
( <STAR> | <SLASH> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod108" xreflabel="valueExpressionPrimary"/>valueExpressionPrimary</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod109" xreflabel="valueExpressionPrimary"/>valueExpressionPrimary</para></entry>
<entry align="left" valign="top"><para>::=
-( <QMARK> | <POS_REF> | <link linkend="prod110">literal</link> | ( <LBRACE> <link linkend="prod11">nonReserved</link> <link linkend="prod111">function</link> <RBRACE> ) | ( <link linkend="prod68">textAgg</link> ) | ( <link linkend="prod70">aggregateSymbol</link> ) | ( <link linkend="prod70">aggregateSymbol</link> ) | ( <link linkend="prod70">aggregateSymbol</link> ) | ( <link linkend="prod66">xmlAgg</link> ) | ( <link linkend="prod67">arrayAgg</link> ) | ( <link linkend="prod111">function</link> ) | ( <ID> ( <LSBRACE> <link linkend="prod83">intVal</link> <RSBRACE> )? ) | <link linkend="prod100">subquery</link> | ( <LPAREN> <link linkend="prod24">expression</link> <RPAREN> ( <LSBRACE> <link linkend="prod83">intVal</link> <RSBRACE> )? ) | <link linkend="prod112">searchedCaseExpression</link> | <link linkend="prod113">caseExpression</link> )</para></entry></row>
+( <QMARK> | <POS_REF> | <link linkend="prod111">literal</link> | ( <LBRACE> <link linkend="prod11">nonReserved</link> <link linkend="prod112">function</link> <RBRACE> ) | ( <link linkend="prod68">textAgg</link> ( <link linkend="prod113">windowSpecification</link> )? ) | ( <link linkend="prod70">aggregateSymbol</link> ( <link linkend="prod113">windowSpecification</link> )? ) | ( <link linkend="prod70">aggregateSymbol</link> ( <link linkend="prod113">windowSpecification</link> )? ) | <link linkend="prod66">orderedAgg</link> ( <link linkend="prod113">windowSpecification</link> )? | ( <link linkend="prod70">aggregateSymbol</link> <link linkend="prod113">windowSpecification</link> ) | ( <link linkend="prod112">function</link> ) | ( <ID> ( <LSBRACE> <link linkend="prod84">intVal</link> <RSBRACE> )? ) | <link linkend="prod100">subquery</link> | ( <LPAREN> <link linkend="prod24">expression</link> <RPAREN> ( <LSBRACE> <link!
linkend="prod84">intVal</link> <RSBRACE> )? ) | <link linkend="prod114">searchedCaseExpression</link> | <link linkend="prod115">caseExpression</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod113" xreflabel="caseExpression"/>caseExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod113" xreflabel="windowSpecification"/>windowSpecification</para></entry>
<entry align="left" valign="top"><para>::=
+<OVER> <LPAREN> ( <PARTITION> <BY> <link linkend="prod48">expressionList</link> )? ( <link linkend="prod53">orderby</link> )? <RPAREN></para></entry></row>
+<row>
+<entry align="right" valign="top"><para><anchor id="prod115" xreflabel="caseExpression"/>caseExpression</para></entry>
+<entry align="left" valign="top"><para>::=
<CASE> <link linkend="prod24">expression</link> ( <WHEN> <link linkend="prod24">expression</link> <THEN> <link linkend="prod24">expression</link> )+ ( <ELSE> <link linkend="prod24">expression</link> )? <END></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod112" xreflabel="searchedCaseExpression"/>searchedCaseExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod114" xreflabel="searchedCaseExpression"/>searchedCaseExpression</para></entry>
<entry align="left" valign="top"><para>::=
<CASE> ( <WHEN> <link linkend="prod35">criteria</link> <THEN> <link linkend="prod24">expression</link> )+ ( <ELSE> <link linkend="prod24">expression</link> )? <END></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod111" xreflabel="function"/>function</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod112" xreflabel="function"/>function</para></entry>
<entry align="left" valign="top"><para>::=
-( ( <CONVERT> <LPAREN> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod38">dataType</link> <RPAREN> ) | ( <CAST> <LPAREN> <link linkend="prod24">expression</link> <AS> <link linkend="prod38">dataType</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod114">stringConstant</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod115">intervalType</link> <COMMA> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod24">expression</link> <RPAREN> ) | <link linkend="prod116">queryString</link> | ( ( <LEFT> | <RIGHT> | <CHAR> | <USER> | <YEAR> | <MONTH> | <HOUR> | <MINUTE> | <SECOND> | <XMLCONCAT> | <XMLCOMMENT> ) <LPAREN> ( <link linkend="prod24">expression</link> !
( <COMMA> <link linkend="prod24">expression</link> )* )? <RPAREN> ) | ( ( <INSERT> ) <LPAREN> ( <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod24">expression</link> )* )? <RPAREN> ) | ( ( <TRANSLATE> ) <LPAREN> ( <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod24">expression</link> )* )? <RPAREN> ) | <link linkend="prod117">xmlParse</link> | <link linkend="prod118">xmlElement</link> | ( <XMLPI> <LPAREN> ( <ID> <link linkend="prod119">idExpression</link> | <link linkend="prod119">idExpression</link> ) ( <COMMA> <link linkend="prod24">expression</link> )? <RPAREN> ) | <link linkend="prod120">xmlForest</link> | <link linkend="prod81">xmlSerialize</link> | <link linkend="prod84">xmlQuery</link> | ( <link linkend="prod2">id</link> <LPAREN> ( <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod24">expression</link> )*!
)? <RPAREN> ) )</para></entry></row>
+( ( <CONVERT> <LPAREN> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod38">dataType</link> <RPAREN> ) | ( <CAST> <LPAREN> <link linkend="prod24">expression</link> <AS> <link linkend="prod38">dataType</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod116">stringConstant</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod117">intervalType</link> <COMMA> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod24">expression</link> <RPAREN> ) | <link linkend="prod118">queryString</link> | ( ( <LEFT> | <RIGHT> | <CHAR> | <USER> | <YEAR> | <MONTH> | <HOUR> | <MINUTE> | <SECOND> | <XMLCONCAT> | <XMLCOMMENT> ) <LPAREN> ( <link linkend="prod48">expressionList</li!
nk> )? <RPAREN> ) | ( ( <TRANSLATE> | <INSERT> ) <LPAREN> ( <link linkend="prod48">expressionList</link> )? <RPAREN> ) | <link linkend="prod119">xmlParse</link> | <link linkend="prod120">xmlElement</link> | ( <XMLPI> <LPAREN> ( <ID> <link linkend="prod121">idExpression</link> | <link linkend="prod121">idExpression</link> ) ( <COMMA> <link linkend="prod24">expression</link> )? <RPAREN> ) | <link linkend="prod122">xmlForest</link> | <link linkend="prod82">xmlSerialize</link> | <link linkend="prod85">xmlQuery</link> | ( <link linkend="prod2">id</link> <LPAREN> ( <link linkend="prod48">expressionList</link> )? <RPAREN> ) )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod114" xreflabel="stringConstant"/>stringConstant</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod116" xreflabel="stringConstant"/>stringConstant</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod1">stringVal</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod117" xreflabel="xmlParse"/>xmlParse</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod119" xreflabel="xmlParse"/>xmlParse</para></entry>
<entry align="left" valign="top"><para>::=
<XMLPARSE> <LPAREN> <link linkend="prod11">nonReserved</link> <link linkend="prod24">expression</link> ( <link linkend="prod11">nonReserved</link> )? <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod116" xreflabel="queryString"/>queryString</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod118" xreflabel="queryString"/>queryString</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod118" xreflabel="xmlElement"/>xmlElement</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod120" xreflabel="xmlElement"/>xmlElement</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLELEMENT> <LPAREN> ( <ID> <link linkend="prod2">id</link> | <link linkend="prod2">id</link> ) ( <COMMA> <link linkend="prod85">xmlNamespaces</link> )? ( <COMMA> <link linkend="prod121">xmlAttributes</link> )? ( <COMMA> <link linkend="prod24">expression</link> )* <RPAREN></para></entry></row>
+<XMLELEMENT> <LPAREN> ( <ID> <link linkend="prod2">id</link> | <link linkend="prod2">id</link> ) ( <COMMA> <link linkend="prod86">xmlNamespaces</link> )? ( <COMMA> <link linkend="prod123">xmlAttributes</link> )? ( <COMMA> <link linkend="prod24">expression</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod121" xreflabel="xmlAttributes"/>xmlAttributes</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod123" xreflabel="xmlAttributes"/>xmlAttributes</para></entry>
<entry align="left" valign="top"><para>::=
<XMLATTRIBUTES> <LPAREN> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod120" xreflabel="xmlForest"/>xmlForest</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod122" xreflabel="xmlForest"/>xmlForest</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLFOREST> <LPAREN> ( <link linkend="prod85">xmlNamespaces</link> <COMMA> )? <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* <RPAREN></para></entry></row>
+<XMLFOREST> <LPAREN> ( <link linkend="prod86">xmlNamespaces</link> <COMMA> )? <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod85" xreflabel="xmlNamespaces"/>xmlNamespaces</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod86" xreflabel="xmlNamespaces"/>xmlNamespaces</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLNAMESPACES> <LPAREN> <link linkend="prod122">namespaceItem</link> ( <COMMA> <link linkend="prod122">namespaceItem</link> )* <RPAREN></para></entry></row>
+<XMLNAMESPACES> <LPAREN> <link linkend="prod124">namespaceItem</link> ( <COMMA> <link linkend="prod124">namespaceItem</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod122" xreflabel="namespaceItem"/>namespaceItem</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod124" xreflabel="namespaceItem"/>namespaceItem</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod1">stringVal</link> <AS> <link linkend="prod2">id</link> )</para></entry></row>
<row>
@@ -873,7 +883,7 @@
<entry align="left" valign="top"><para>::=
( <DEFAULT_KEYWORD> <link linkend="prod1">stringVal</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod119" xreflabel="idExpression"/>idExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod121" xreflabel="idExpression"/>idExpression</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod2">id</link></para></entry></row>
<row>
@@ -885,15 +895,15 @@
<entry align="left" valign="top"><para>::=
<link linkend="prod22">dataTypeString</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod115" xreflabel="intervalType"/>intervalType</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod117" xreflabel="intervalType"/>intervalType</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod11">nonReserved</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod110" xreflabel="literal"/>literal</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod111" xreflabel="literal"/>literal</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod1">stringVal</link> | <INTEGERVAL> | <FLOATVAL> | <FALSE> | <TRUE> | <UNKNOWN> | <NULL> | ( ( <BOOLEANTYPE> | <TIMESTAMPTYPE> | <DATETYPE> | <TIMETYPE> ) <link linkend="prod1">stringVal</link> <RBRACE> ) )</para></entry></row>
</tbody>
</tgroup>
</informaltable>
</section>
-</appendix>
+</appendix>
\ No newline at end of file
Added: trunk/documentation/reference/src/main/docbook/en-US/content/sql_clauses.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/sql_clauses.xml (rev 0)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/sql_clauses.xml 2011-07-28 19:58:08 UTC (rev 3347)
@@ -0,0 +1,502 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="sql_clauses">
+ <title>SQL Clauses</title>
+ <para>This section describes the clauses that are used in the various <link linkend="sql_commands">SQL commands</link> described in the previous section. Nearly all these features follow standard SQL syntax and functionality, so any SQL reference can be used for more information.</para>
+ <section id="with_clause">
+ <title>WITH Clause</title>
+ <para>
+ Teiid supports non-recursive common table expressions via the WITH clause. With clause items may be referenced as tables in subsequent with clause items and in the main query. The WITH clause can be thought of as providing query scoped temporary tables.
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">WITH name [(column, ...)] AS (query expression) ... </synopsis>
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules:</para>
+ <listitem><para>All of the projected column names must be unique. If they are not unique, then the column name list must be provided.</para></listitem>
+ <listitem><para>If the columns of the WITH clause item are declared, then they must match the number of columns projected by the query expression.</para></listitem>
+ <listitem><para>Each with clause item must have a unique name.</para></listitem>
+ </itemizedlist>
+ </section>
+ <section id="select_clause">
+ <title>SELECT Clause</title>
+ <para>
+ SQL queries that start with the SELECT keyword and are often referred to as "SELECT statements". Teiid supports most of the standard SQL query constructs.
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">SELECT [DISTINCT|ALL] ((expression [[AS] name])|(group identifier.STAR))*|STAR ...</synopsis>
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules:</para>
+ <listitem><para>Aliased expressions are only used as the output column names and in the ORDER BY clause. They cannot be used in other clauses of the query.</para></listitem>
+ <listitem><para>DISTINCT may only be specified if the SELECT symbols are comparable.</para></listitem>
+ </itemizedlist>
+ </section>
+ <section id="from_clause">
+ <title>FROM Clause</title>
+ <para>
+ The FROM clause specifies the target table(s) for SELECT, UPDATE, and DELETE statements.
+ </para>
+ <itemizedlist>
+ <para>Example Syntax:</para>
+ <listitem><para>FROM table [[AS] alias]</para></listitem>
+ <listitem><para>FROM table1 [INNER|LEFT OUTER|RIGHT OUTER|FULL OUTER] JOIN table2 ON join-criteria</para></listitem>
+ <listitem><para>FROM table1 CROSS JOIN table2</para></listitem>
+ <listitem><para>FROM (subquery) [AS] alias</para></listitem>
+ <listitem><para>FROM <link linkend="nested_table">TABLE(subquery)</link> [AS] alias</para></listitem>
+ <listitem><para>FROM table1 JOIN /*+ MAKEDEP */ table2 ON join-criteria</para></listitem>
+ <listitem><para>FROM table1 JOIN /*+ MAKENOTDEP */ table2 ON join-criteria</para></listitem>
+ <listitem><para>FROM /*+ MAKEIND */ table1 JOIN table2 ON join-criteria</para></listitem>
+ <listitem><para>FROM table1 left outer join <link linkend="optional_join">/*+ optional */</link> table2 ON join-criteria</para></listitem>
+ <listitem><para>FROM <link linkend="texttable">TEXTTABLE...</link></para></listitem>
+ <listitem><para>FROM <link linkend="xmltable">XMLTABLE...</link></para></listitem>
+ <listitem><para>FROM <link linkend="arraytable">ARRAYTABLE...</link></para></listitem>
+ <listitem><para>FROM <link linkend="from_subquery">(SELECT ...</link></para></listitem>
+ </itemizedlist>
+ <note>
+ <title>DEP Hints</title>
+ <para>
+ MAKEIND, MAKEDEP, and MAKENOTDEP are hints used to control
+ <link linkend="dependent_joins">dependent join</link>
+ behavior. They should only be used in situations where the optimizer
+ does not choose the most optimal plan based upon query structure,
+ metadata, and costing information. The hints may appear in a comment that proceeds the from clause.
+ The hints can be specified against any from clause, not just a named table.
+ </para>
+ </note>
+ <section id="nested_table">
+ <title>Nested Table Reference</title>
+ <para>Nested tables may appear in the FROM clause with the TABLE
+ keyword. They are an alternative to using a view with normal join
+ semantics. The columns projected from the command contained in the nested table
+ may be used just as any of the other FROM clause projected columns in join criteria, the where clause, etc.
+ </para>
+ <para>A nested table may have correlated references to preceeding FROM
+ clause column references as long as INNER and LEFT OUTER joins are used. This is
+ especially useful in cases where then nested expression is a
+ procedure or function call.</para>
+ <para>Valid example:
+ <programlisting>select * from t1, TABLE(call proc(t1.x)) t2</programlisting>
+ </para>
+ <para>Invalid example, since t1 appears after the nested table in the from clause:
+ <programlisting>select * from TABLE(call proc(t1.x)) t2, t1</programlisting>
+ </para>
+ <note>
+ <title>Multiple Execution</title>
+ <para>The usage of a correlated nested table may result in multiple
+ executions of the table expression - once for each correlated row.
+ </para>
+ </note>
+ </section>
+ <section id="texttable">
+ <title>TEXTTABLE</title>
+ <para>The TEXTTABLE funciton processes character input to produce tabular ouptut. It supports both fixed and delimited file format parsing.
+ The function itself defines what columns it projects.
+ The TEXTTABLE function is implicitly a nested table and may be correlated to preceeding FROM clause entries.
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">TEXTTABLE(expression COLUMNS <COLUMN>, ... [DELIMITER char] [(QUOTE|ESCAPE) char] [HEADER [integer]] [SKIP integer]) AS name</synopsis>
+ <synopsis label="Usage">COLUMN := name datatype [WIDTH integer]</synopsis>
+ </para>
+ <itemizedlist>
+ <para>Parameters</para>
+ <listitem>
+ <para>expression - the text content to process, which should be convertable to CLOB.
+ </para>
+ </listitem>
+ <listitem>
+ <para>DELIMITER sets the field delimiter character to use. Defaults to ','.
+ </para>
+ </listitem>
+ <listitem>
+ <para>QUOTE sets the quote, or qualifier, character used to wrap field values. Defaults to '"'.
+ </para>
+ </listitem>
+ <listitem>
+ <para>ESCAPE sets the escape character to use if no quoting character is in use.
+ This is used in situations where the delimiter or new line characters are escaped with a preceding character, e.g. \,
+ </para>
+ </listitem>
+ <listitem>
+ <para>HEADER specifies the text line number (counting every new line) on which the column names occur. All lines prior to the header will be skipped.
+ If HEADER is specified, then the header line will be used to determine the TEXTTABLE column position by case-insensitive name matching. This is especially useful in situations where only a subset of the columns are needed.
+ If the HEADER value is not specified, it defaults to 1.
+ If HEADER is not specified, then columns are expected to match positionally with the text contents.
+ </para>
+ </listitem>
+ <listitem>
+ <para>SKIP specifies the number of text lines (counting every new line) to skip before parsing the contents. HEADER may still be specified with SKP.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>If width is specified for one column it must be specified for all columns.
+ </para>
+ </listitem>
+ <listitem>
+ <para>If width is specified, then fixed width parsing is used and ESCAPE, QUOTE, and HEADER should not be specified.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The columns names must be not contain duplicates.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Examples</para>
+ <listitem>
+ <para>Use of the HEADER parameter, returns 1 row ['b']: <programlisting>select * from texttable('col1,col2,col3\na,b,c' COLUMNS col2 string HEADER) x</programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>Use of fixed width, returns 1 row ['a', 'b', 'c']: <programlisting>select * from texttable('abc' COLUMNS col1 string width 1, col2 string width 1, col3 string width 1) x</programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>Use of ESCAPE parameter, returns 1 row ['a,', 'b']: <programlisting>select * from texttable('a:,,b' COLUMNS col1 string, col2 string ESCAPE ':') x</programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>As a nested table: <programlisting>select x.* from t, texttable(t.clobcolumn COLUMNS first string, second date SKIP 1) x</programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="xmltable">
+ <title>XMLTABLE</title>
+ <para>The XMLTABLE funciton uses XQuery to produce tabular ouptut.
+ The XMLTABLE function is implicitly a nested table and may be correlated to preceeding FROM clause entries. XMLTABLE is part of the SQL/XML 2006 specification.
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">XMLTABLE([<NSP>,] xquery-expression [<PASSING>] [COLUMNS <COLUMN>, ... )] AS name</synopsis>
+ <synopsis label="Usage">COLUMN := name (FOR ORDINALITY | (datatype [DEFAULT expression] [PATH string]))</synopsis>
+ </para>
+ <para>See XMLELEMENT for the definition of NSP - <link linkend="xmlnamespaces">XMLNAMESPACES</link>.</para>
+ <para>See XMLQUERY for the definition of <link linkend="passing">PASSING</link>.</para>
+ <para>See also <link linkend="xmlquery">XMLQUERY</link></para>
+ <note><para>See also <xref linkend="xquery_optimization"/></para></note>
+ <itemizedlist>
+ <para>Parameters</para>
+ <listitem>
+ <para>The optional XMLNAMESPACES clause specifies the namepaces for use in the XQuery and COLUMN path expressions.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The xquery-expression should be a valid XQuery. Each sequence item returned by the xquery will be used to create a row of values as defined by the COLUMNS clause.
+ </para>
+ </listitem>
+ <listitem>
+ <para>If COLUMNS is not specified, then that is the same as having the COLUMNS clause: "COLUMNS OBJECT_VALUE XML PATH '.'", which returns the entire item as an XML value.
+ </para>
+ </listitem>
+ <listitem>
+ <para>A FOR ORDINALITY column is typed as integer and will return the 1-based item number as its value.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Each non-ordinality column specifies a type and optionally a PATH and a DEFAULT expression.
+ </para>
+ </listitem>
+ <listitem>
+ <para>If PATH is not specified, then the path will be the same as the column name.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>Only 1 FOR ORDINALITY column may be specified.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The columns names must be not contain duplicates.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Examples</para>
+ <listitem>
+ <para>Use of passing, returns 1 row [1]: <programlisting>select * from xmltable('/a' PASSING xmlparse(document '<a id="1"/>') COLUMNS id integer PATH '@id') x</programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>As a nested table: <programlisting>select x.* from t, xmltable('/x/y' PASSING t.doc COLUMNS first string, second FOR ORDINALITY) x</programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ <section id="arraytable">
+ <title>ARRAYTABLE</title>
+ <para>The ARRAYTABLE funciton processes an array input to produce tabular ouptut.
+ The function itself defines what columns it projects.
+ The ARRAYTABLE function is implicitly a nested table and may be correlated to preceeding FROM clause entries.
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">ARRAYTABLE(expression COLUMNS <COLUMN>, ...) AS name</synopsis>
+ <synopsis label="Usage">COLUMN := name datatype</synopsis>
+ </para>
+ <itemizedlist>
+ <para>Parameters</para>
+ <listitem>
+ <para>expression - the array to process, which should be a java.sql.Array or java array value.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>The columns names must be not contain duplicates.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Examples</para>
+ <listitem>
+ <para>As a nested table: <programlisting>select x.* from (call source.invokeMDX('some query')) r, arraytable(r.tuple COLUMNS first string, second bigdecimal) x</programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>ARRAYTABLE is effectively a shortcut for using the <xref linkend="array_get"/> function in a nested table. For example "ARRAYGET(val COLUMNS col1 string, col2 integer) AS X" is the same as "TABLE(SELECT cast(array_get(val, 1) AS string) AS col1, cast(array_get(val, 2) AS integer) AS col2) AS X".</para>
+ </section>
+ <section id="where_clause">
+ <title>WHERE Clause</title>
+ <para>
+ The WHERE clause defines the criteria to limit the records affected by SELECT, UPDATE, and DELETE statements.
+ </para>
+ <itemizedlist>
+ <para>The general form of the WHERE is:
+ </para>
+ <listitem>
+ <para>WHERE <link linkend="criteria">criteria</link>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="groupby_clause">
+ <title>GROUP BY Clause</title>
+ <para>
+ The GROUP BY clause denotes that rows should be grouped according to the specified expression values. One row will be returned for each group, after optionally filtering those aggregate rows based on a HAVING clause.
+ </para>
+ <itemizedlist>
+ <para>The general form of the GROUP BY is:
+ </para>
+ <listitem>
+ <para>GROUP BY expression (,expression)*
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>Column references in the group by clause must by to unaliased output columns.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Expressions used in the group by must appear in the select clause.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Column references and expessions in the select clause that are not used in the group by clause must appear in aggregate functions.
+ </para>
+ </listitem>
+ <listitem>
+ <para>If an aggregate function is used in the SELECT clause and no
+ GROUP BY is specified, an implicit GROUP BY will be performed with
+ the entire result set as a single group. In this case, every column
+ in the SELECT must be an aggregate function as no other column value
+ will be fixed across the entire group.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The group by columns must be of a comparable type.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="having_clause">
+ <title>HAVING Clause</title>
+ <para>
+ The HAVING clause operates exactly as a WHERE clause although it operates on the output of a GROUP BY. It supports the same syntax as the WHERE clause.
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>Expressions used in the group by clause must either
+ contain an aggregate function: COUNT, AVG, SUM, MIN, MAX. or be one
+ of the grouping expressions.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="orderby_clause">
+ <title>ORDER BY Clause</title>
+ <para>
+ The ORDER BY clause specifies how records should be sorted. The options are ASC (ascending) and DESC (descending).
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">ORDER BY expression [ASC|DESC] [NULLS (FIRST|LAST)], ...</synopsis>
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>Sort columns may be specified positionally by a 1-based positional
+ integer, by SELECT clause alias name, by SELECT clause expression, or by an unrelated expression.</para>
+ </listitem>
+ <listitem>
+ <para>Column references may appear in the SELECT clause as the
+ expression for an aliased column or may reference columns from tables
+ in the FROM clause.
+ If the column reference is not in the SELECT clause the query must not
+ be a set operation, specify SELECT DISTINCT, or contain a GROUP BY
+ clause.</para>
+ </listitem>
+ <listitem>
+ <para>Unrelated expressions, expressions not appearing as an aliased expression in the select clause,
+ are allowed in the order by clause of a non-set QUERY. The columns referenced in the expression must come from the
+ from clause table references. The column references cannot be to alias names or positional.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The ORDER BY columns must be of a comparable type.</para>
+ </listitem>
+ <listitem>
+ <para>If an ORDER BY is used in an inline view or view
+ definition without a limit clause, it will be removed by the Teiid
+ optimizer.</para>
+ </listitem>
+ <listitem>
+ <para>If NULLS FIRST/LAST is specified, then nulls are guaranteed to be sorted either first or last. If the null ordering is not specified, then results will
+ typically be sorted with nulls as low values, which is Teiid's internal default sorting behavior.
+ However not all sources return results with nulss sorted as low values by default, and Teiid may return results with different null orderings.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <warning>
+ <para>The use of positional ordering is no longer supported by the
+ ANSI SQL standard and is a deprecated feature in Teiid. It is
+ preferable to use alias names in the order by clause.</para>
+ </warning>
+ </section>
+ <section id="limit_clause">
+ <title>LIMIT Clause</title>
+ <para>
+ The LIMIT clause specifies a limit on the number of records returned from the SELECT command. An optional offset (the number of rows to skip) can be specified. The LIMIT clause can also be specfied using the SQL 2008 OFFSET/FETCH FIRST clauses.
+ If an ORDER BY is also specified, it will be applied before the OFFSET/LIMIT are applied. If an ORDER BY is not specified there is generally no guarantee what subset of rows will be returned.
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">LIMIT [offset,] limit</synopsis>
+ <synopsis label="Usage">[OFFSET offset ROW|ROWS] [FETCH FIRST|NEXT [limit] ROW|ROWS ONLY</synopsis>
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>The limit/offset expressions must be a non-negative integer or a parameter reference (?). An offset of 0 is ignored. A limit of 0 will return no rows.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The terms FIRST/NEXT are interchangable as well as ROW/ROWS.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Examples:
+ </para>
+ <listitem>
+ <para>LIMIT 100 - returns the first 100 records (rows 1-100)</para>
+ </listitem>
+ <listitem>
+ <para>LIMIT 500, 100 - skips 500 records and returns the next 100 records (rows 501-600)</para>
+ </listitem>
+ <listitem>
+ <para>OFFSET 500 ROWS - skips 500 records</para>
+ </listitem>
+ <listitem>
+ <para>OFFSET 500 ROWS FETCH NEXT 100 ROWS ONLY - skips 500 records and returns the next 100 records (rows 501-600)</para>
+ </listitem>
+ <listitem>
+ <para>FETCH FIRST ROW ONLY - returns only the first record</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="into_clause">
+ <title>INTO Clause</title>
+ <warning>
+ <para>Usage of the INTO Clause for inserting into a table has been been deprecated. An <link linkend="insert_command">INSERT</link> with a query command should be used instead.</para>
+ </warning>
+ <para>
+ When the into clause is specified with a SELECT, the results of the query are inserted into the specified table. This is often used to insert records into a temporary table. The INTO clause immediately precedes the FROM clause.
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">INTO table FROM ...</synopsis>
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>The INTO clause is logically applied last in processing, after the ORDER BY and LIMIT clauses.</para>
+ </listitem>
+ <listitem>
+ <para>Teiid's support for SELECT INTO is similar to
+ MS SQL Server. The target of the INTO clause is a table where
+ the result of the rest select command will be inserted. SELECT
+ INTO should not be used UNION query.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="option_clause">
+ <title>OPTION Clause</title>
+ <para>
+ The OPTION keyword denotes options the user can pass in with the command. These options are Teiid-specific and not covered by any SQL specification.
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">OPTION option, (option)*</synopsis>
+ </para>
+ <itemizedlist>
+ <para>Supported options:
+ </para>
+ <listitem>
+ <para>MAKEDEP table [(,table)*] - specifies source tables that should be made dependent in the join
+ </para>
+ </listitem>
+ <listitem>
+ <para>MAKENOTDEP table [(,table)*] - prevents a dependent join from being used
+ </para>
+ </listitem>
+ <listitem>
+ <para>NOCACHE [table (,table)*] - prevents cache from being used for all tables or for the given tables
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <para>Examples:
+ </para>
+ <listitem>
+ <para>OPTION MAKEDEP table1</para>
+ </listitem>
+ <listitem>
+ <para>OPTION NOCACHE</para>
+ </listitem>
+ </itemizedlist>
+ <para>All tables specified in the OPTION clause should be fully qualified.</para>
+ <note><para>Previous versions of Teiid accepted the PLANONLY, DEBUG, and SHOWPLAN option arguments. These are no longer accepted in the OPTION clause.
+ Please see the Client Developers Guide for replacements to those options.
+ </para></note>
+ </section>
+</chapter>
\ No newline at end of file
Property changes on: trunk/documentation/reference/src/main/docbook/en-US/content/sql_clauses.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2011-07-28 19:58:08 UTC (rev 3347)
@@ -115,7 +115,7 @@
</para>
</section>
</section>
- <section>
+ <section id="expressions">
<title>Expressions</title>
<para> Identifiers, literals, and functions can be combined into
expressions. Expressions can be used almost anywhere in a query --
@@ -136,6 +136,9 @@
<para><link linkend="aggregate_functions">Aggregate functions</link></para>
</listitem>
<listitem>
+ <para><link linkend="window_functions">Window functions</link></para>
+ </listitem>
+ <listitem>
<para><link linkend="case">Case and searched case</link></para>
</listitem>
<listitem>
@@ -253,7 +256,7 @@
</para>
</listitem>
<listitem>
- <para>XMLAGG(xml_expr <link linkend="orderby_clause">[ORDER BY ...]</link>) – xml concatination of all xml expressions in a group (excluding null)</para>
+ <para>XMLAGG(xml_expr <link linkend="orderby_clause">[ORDER BY ...]</link>) – xml concatination of all xml expressions in a group (excluding null). The ORDER BY clause cannot reference alias names or use positional ordering.</para>
</listitem>
</itemizedlist>
<itemizedlist>
@@ -285,6 +288,123 @@
For more information on aggregates, see the sections on GROUP BY or HAVING.
</para>
</section>
+ <section id="window_functions">
+ <title>Window functions</title>
+ <para>Teiid supports ANSI SQL 2003 window functions. A window function allows an aggregrate function to be applied to a subset of the result set, without the need for a GROUP BY clause.
+ A window function is similar to an aggregate function, but requires the use of an OVER clause or window specification.
+ </para>
+ <para>
+ Usage:
+ <synopsis label="Usage">aggregate|ranking OVER ([PARTION BY expression [, expression]*] <link linkend="orderby_clause">[ORDER BY ...]</link>)</synopsis>
+ aggregate can be any <xref linkend="aggregate_functions"/>. Ranking can be one of ROW_NUMBER(), RANK(), DENSE_RANK().
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules:
+ </para>
+ <listitem>
+ <para>Window functions can only appear in the SELECT and ORDER BY clauses of a query expression.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Window functions cannot be nested in one another.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Partitioning and order by expressions cannot contain subqueries or outer references.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The ranking (ROW_NUMBER, RANK, DENSE_RANK) functions require the use of the window specification ORDER BY clause.
+ </para>
+ </listitem>
+ <listitem>
+ <para>An XMLAGG ORDER BY clause cannot be used when windowed.
+ </para>
+ </listitem>
+ <listitem>
+ <para>The window specification ORDER BY clause cannot reference alias names or use positional ordering.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Windowed aggregates may not use DISTINCT.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <section>
+ <title>Function Definitions</title>
+ <itemizedlist>
+ <listitem>
+ <para>ROW_NUMBER() – functional the same as COUNT(*) with the same window specification. Assigns a number to each row in a partition starting at 1.</para>
+ </listitem>
+ <listitem>
+ <para>RANK() – Assigns a number to each unique ordering value within each partition starting at 1, such that the next rank is equal to the count of prior rows.</para>
+ </listitem>
+ <listitem>
+ <para>DENSE_RANK() – Assigns a number to each unique ordering value within each partition starting at 1, such that the next rank is sequential.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Processing</title>
+ <para>Window functions are logically processed just before creating the output from the SELECT clause. Window functions can use nested aggregates if a GROUP BY clause is present.
+ The is no guarenteed affect on the output ordering from the presense of window functions. The SELECT statement must have an ORDER BY clause to have a predictable ordering.
+ </para><para>
+ Teiid will process all window functions with the same window specification together. In general a full pass over the row values coming into the SELECT clause will be required for each unique window specification.
+ For each window specification the values will be grouped according to the PARTITION BY clause. If no PARTITION BY clause is specified, then the entire input is treated as a single partition.
+ The output value is determined based upon the current row value, it's peers (that is rows that are the same with respect to their ordering), and all prior row values based upon ordering in the partition.
+ The ROW_NUMBER function will assign a unique value to every row regardless of the number of peers.
+ </para>
+ <example>
+ <title>Example Windowed Results</title>
+ <programlisting language="SQL">SELECT name, salary, max(salary) over (partition by name) as max_sal,
+ rank() over (order by salary) as rank, dense_rank() over (order by salary) as dense_rank,
+ row_number() over (order by salary) as row_num FROM employees</programlisting>
+ <informaltable frame="all">
+ <tgroup cols="6">
+ <thead>
+ <row>
+ <entry>
+ <para>name</para>
+ </entry>
+ <entry>
+ <para>salary</para>
+ </entry>
+ <entry>
+ <para>max_sal</para>
+ </entry>
+ <entry>
+ <para>rank</para>
+ </entry>
+ <entry>
+ <para>dense_rank</para>
+ </entry>
+ <entry>
+ <para>row_num</para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><para>John</para></entry><entry><para>100000</para></entry><entry><para>100000</para></entry><entry><para>2</para></entry><entry><para>2</para></entry><entry><para>2</para></entry>
+ </row>
+ <row>
+ <entry><para>Henry</para></entry><entry><para>50000</para></entry><entry><para>100000</para></entry><entry><para>5</para></entry><entry><para>4</para></entry><entry><para>5</para></entry>
+ </row>
+ <row>
+ <entry><para>John</para></entry><entry><para>60000</para></entry><entry><para>60000</para></entry><entry><para>3</para></entry><entry><para>3</para></entry><entry><para>3</para></entry>
+ </row>
+ <row>
+ <entry><para>Suzie</para></entry><entry><para>60000</para></entry><entry><para>150000</para></entry><entry><para>3</para></entry><entry><para>3</para></entry><entry><para>4</para></entry>
+ </row>
+ <row>
+ <entry><para>Suzie</para></entry><entry><para>150000</para></entry><entry><para>150000</para></entry><entry><para>1</para></entry><entry><para>1</para></entry><entry><para>1</para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </example>
+ </section>
+ </section>
<section id="case">
<title>Case and searched case</title>
<para>
@@ -666,506 +786,6 @@
</note>
</section>
</section>
- <section>
- <title>SQL Clauses</title>
- <para>This section describes the clauses that are used in the various <link linkend="sql_commands">SQL commands</link> described in the previous section. Nearly all these features follow standard SQL syntax and functionality, so any SQL reference can be used for more information.</para>
- <section id="with_clause">
- <title>WITH Clause</title>
- <para>
- Teiid supports non-recursive common table expressions via the WITH clause. With clause items may be referenced as tables in subsequent with clause items and in the main query. The WITH clause can be thought of as providing query scoped temporary tables.
- </para>
- <para>
- Usage:
- <synopsis label="Usage">WITH name [(column, ...)] AS (query expression) ... </synopsis>
- </para>
- <itemizedlist>
- <para>Syntax Rules:</para>
- <listitem><para>All of the projected column names must be unique. If they are not unique, then the column name list must be provided.</para></listitem>
- <listitem><para>If the columns of the WITH clause item are declared, then they must match the number of columns projected by the query expression.</para></listitem>
- <listitem><para>Each with clause item must have a unique name.</para></listitem>
- </itemizedlist>
- </section>
- <section id="select_clause">
- <title>SELECT Clause</title>
- <para>
- SQL queries that start with the SELECT keyword and are often referred to as "SELECT statements". Teiid supports most of the standard SQL query constructs.
- </para>
- <para>
- Usage:
- <synopsis label="Usage">SELECT [DISTINCT|ALL] ((expression [[AS] name])|(group identifier.STAR))*|STAR ...</synopsis>
- </para>
- <itemizedlist>
- <para>Syntax Rules:</para>
- <listitem><para>Aliased expressions are only used as the output column names and in the ORDER BY clause. They cannot be used in other clauses of the query.</para></listitem>
- <listitem><para>DISTINCT may only be specified if the SELECT symbols are comparable.</para></listitem>
- </itemizedlist>
- </section>
- <section id="from_clause">
- <title>FROM Clause</title>
- <para>
- The FROM clause specifies the target table(s) for SELECT, UPDATE, and DELETE statements.
- </para>
- <itemizedlist>
- <para>Example Syntax:</para>
- <listitem><para>FROM table [[AS] alias]</para></listitem>
- <listitem><para>FROM table1 [INNER|LEFT OUTER|RIGHT OUTER|FULL OUTER] JOIN table2 ON join-criteria</para></listitem>
- <listitem><para>FROM table1 CROSS JOIN table2</para></listitem>
- <listitem><para>FROM (subquery) [AS] alias</para></listitem>
- <listitem><para>FROM <link linkend="nested_table">TABLE(subquery)</link> [AS] alias</para></listitem>
- <listitem><para>FROM table1 JOIN /*+ MAKEDEP */ table2 ON join-criteria</para></listitem>
- <listitem><para>FROM table1 JOIN /*+ MAKENOTDEP */ table2 ON join-criteria</para></listitem>
- <listitem><para>FROM /*+ MAKEIND */ table1 JOIN table2 ON join-criteria</para></listitem>
- <listitem><para>FROM table1 left outer join <link linkend="optional_join">/*+ optional */</link> table2 ON join-criteria</para></listitem>
- <listitem><para>FROM <link linkend="texttable">TEXTTABLE...</link></para></listitem>
- <listitem><para>FROM <link linkend="xmltable">XMLTABLE...</link></para></listitem>
- <listitem><para>FROM <link linkend="arraytable">ARRAYTABLE...</link></para></listitem>
- <listitem><para>FROM <link linkend="from_subquery">(SELECT ...</link></para></listitem>
- </itemizedlist>
- <note>
- <title>DEP Hints</title>
- <para>
- MAKEIND, MAKEDEP, and MAKENOTDEP are hints used to control
- <link linkend="dependent_joins">dependent join</link>
- behavior. They should only be used in situations where the optimizer
- does not choose the most optimal plan based upon query structure,
- metadata, and costing information. The hints may appear in a comment that proceeds the from clause.
- The hints can be specified against any from clause, not just a named table.
- </para>
- </note>
- <section id="nested_table">
- <title>Nested Table Reference</title>
- <para>Nested tables may appear in the FROM clause with the TABLE
- keyword. They are an alternative to using a view with normal join
- semantics. The columns projected from the command contained in the nested table
- may be used just as any of the other FROM clause projected columns in join criteria, the where clause, etc.
- </para>
- <para>A nested table may have correlated references to preceeding FROM
- clause column references as long as INNER and LEFT OUTER joins are used. This is
- especially useful in cases where then nested expression is a
- procedure or function call.</para>
- <para>Valid example:
- <programlisting>select * from t1, TABLE(call proc(t1.x)) t2</programlisting>
- </para>
- <para>Invalid example, since t1 appears after the nested table in the from clause:
- <programlisting>select * from TABLE(call proc(t1.x)) t2, t1</programlisting>
- </para>
- <note>
- <title>Multiple Execution</title>
- <para>The usage of a correlated nested table may result in multiple
- executions of the table expression - once for each correlated row.
- </para>
- </note>
- </section>
- <section id="texttable">
- <title>TEXTTABLE</title>
- <para>The TEXTTABLE funciton processes character input to produce tabular ouptut. It supports both fixed and delimited file format parsing.
- The function itself defines what columns it projects.
- The TEXTTABLE function is implicitly a nested table and may be correlated to preceeding FROM clause entries.
- </para>
- <para>
- Usage:
- <synopsis label="Usage">TEXTTABLE(expression COLUMNS <COLUMN>, ... [DELIMITER char] [(QUOTE|ESCAPE) char] [HEADER [integer]] [SKIP integer]) AS name</synopsis>
- <synopsis label="Usage">COLUMN := name datatype [WIDTH integer]</synopsis>
- </para>
- <itemizedlist>
- <para>Parameters</para>
- <listitem>
- <para>expression - the text content to process, which should be convertable to CLOB.
- </para>
- </listitem>
- <listitem>
- <para>DELIMITER sets the field delimiter character to use. Defaults to ','.
- </para>
- </listitem>
- <listitem>
- <para>QUOTE sets the quote, or qualifier, character used to wrap field values. Defaults to '"'.
- </para>
- </listitem>
- <listitem>
- <para>ESCAPE sets the escape character to use if no quoting character is in use.
- This is used in situations where the delimiter or new line characters are escaped with a preceding character, e.g. \,
- </para>
- </listitem>
- <listitem>
- <para>HEADER specifies the text line number (counting every new line) on which the column names occur. All lines prior to the header will be skipped.
- If HEADER is specified, then the header line will be used to determine the TEXTTABLE column position by case-insensitive name matching. This is especially useful in situations where only a subset of the columns are needed.
- If the HEADER value is not specified, it defaults to 1.
- If HEADER is not specified, then columns are expected to match positionally with the text contents.
- </para>
- </listitem>
- <listitem>
- <para>SKIP specifies the number of text lines (counting every new line) to skip before parsing the contents. HEADER may still be specified with SKP.
- </para>
- </listitem>
- </itemizedlist>
- <itemizedlist>
- <para>Syntax Rules:
- </para>
- <listitem>
- <para>If width is specified for one column it must be specified for all columns.
- </para>
- </listitem>
- <listitem>
- <para>If width is specified, then fixed width parsing is used and ESCAPE, QUOTE, and HEADER should not be specified.
- </para>
- </listitem>
- <listitem>
- <para>The columns names must be not contain duplicates.
- </para>
- </listitem>
- </itemizedlist>
- <itemizedlist>
- <para>Examples</para>
- <listitem>
- <para>Use of the HEADER parameter, returns 1 row ['b']: <programlisting>select * from texttable('col1,col2,col3\na,b,c' COLUMNS col2 string HEADER) x</programlisting>
- </para>
- </listitem>
- <listitem>
- <para>Use of fixed width, returns 1 row ['a', 'b', 'c']: <programlisting>select * from texttable('abc' COLUMNS col1 string width 1, col2 string width 1, col3 string width 1) x</programlisting>
- </para>
- </listitem>
- <listitem>
- <para>Use of ESCAPE parameter, returns 1 row ['a,', 'b']: <programlisting>select * from texttable('a:,,b' COLUMNS col1 string, col2 string ESCAPE ':') x</programlisting>
- </para>
- </listitem>
- <listitem>
- <para>As a nested table: <programlisting>select x.* from t, texttable(t.clobcolumn COLUMNS first string, second date SKIP 1) x</programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- <section id="xmltable">
- <title>XMLTABLE</title>
- <para>The XMLTABLE funciton uses XQuery to produce tabular ouptut.
- The XMLTABLE function is implicitly a nested table and may be correlated to preceeding FROM clause entries. XMLTABLE is part of the SQL/XML 2006 specification.
- </para>
- <para>
- Usage:
- <synopsis label="Usage">XMLTABLE([<NSP>,] xquery-expression [<PASSING>] [COLUMNS <COLUMN>, ... )] AS name</synopsis>
- <synopsis label="Usage">COLUMN := name (FOR ORDINALITY | (datatype [DEFAULT expression] [PATH string]))</synopsis>
- </para>
- <para>See XMLELEMENT for the definition of NSP - <link linkend="xmlnamespaces">XMLNAMESPACES</link>.</para>
- <para>See XMLQUERY for the definition of <link linkend="passing">PASSING</link>.</para>
- <para>See also <link linkend="xmlquery">XMLQUERY</link></para>
- <note><para>See also <xref linkend="xquery_optimization"/></para></note>
- <itemizedlist>
- <para>Parameters</para>
- <listitem>
- <para>The optional XMLNAMESPACES clause specifies the namepaces for use in the XQuery and COLUMN path expressions.
- </para>
- </listitem>
- <listitem>
- <para>The xquery-expression should be a valid XQuery. Each sequence item returned by the xquery will be used to create a row of values as defined by the COLUMNS clause.
- </para>
- </listitem>
- <listitem>
- <para>If COLUMNS is not specified, then that is the same as having the COLUMNS clause: "COLUMNS OBJECT_VALUE XML PATH '.'", which returns the entire item as an XML value.
- </para>
- </listitem>
- <listitem>
- <para>A FOR ORDINALITY column is typed as integer and will return the 1-based item number as its value.
- </para>
- </listitem>
- <listitem>
- <para>Each non-ordinality column specifies a type and optionally a PATH and a DEFAULT expression.
- </para>
- </listitem>
- <listitem>
- <para>If PATH is not specified, then the path will be the same as the column name.
- </para>
- </listitem>
- </itemizedlist>
- <itemizedlist>
- <para>Syntax Rules:
- </para>
- <listitem>
- <para>Only 1 FOR ORDINALITY column may be specified.
- </para>
- </listitem>
- <listitem>
- <para>The columns names must be not contain duplicates.
- </para>
- </listitem>
- </itemizedlist>
- <itemizedlist>
- <para>Examples</para>
- <listitem>
- <para>Use of passing, returns 1 row [1]: <programlisting>select * from xmltable('/a' PASSING xmlparse(document '<a id="1"/>') COLUMNS id integer PATH '@id') x</programlisting>
- </para>
- </listitem>
- <listitem>
- <para>As a nested table: <programlisting>select x.* from t, xmltable('/x/y' PASSING t.doc COLUMNS first string, second FOR ORDINALITY) x</programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
- <section id="arraytable">
- <title>ARRAYTABLE</title>
- <para>The ARRAYTABLE funciton processes an array input to produce tabular ouptut.
- The function itself defines what columns it projects.
- The ARRAYTABLE function is implicitly a nested table and may be correlated to preceeding FROM clause entries.
- </para>
- <para>
- Usage:
- <synopsis label="Usage">ARRAYTABLE(expression COLUMNS <COLUMN>, ...) AS name</synopsis>
- <synopsis label="Usage">COLUMN := name datatype</synopsis>
- </para>
- <itemizedlist>
- <para>Parameters</para>
- <listitem>
- <para>expression - the array to process, which should be a java.sql.Array or java array value.
- </para>
- </listitem>
- </itemizedlist>
- <itemizedlist>
- <para>Syntax Rules:
- </para>
- <listitem>
- <para>The columns names must be not contain duplicates.
- </para>
- </listitem>
- </itemizedlist>
- <itemizedlist>
- <para>Examples</para>
- <listitem>
- <para>As a nested table: <programlisting>select x.* from (call source.invokeMDX('some query')) r, arraytable(r.tuple COLUMNS first string, second bigdecimal) x</programlisting>
- </para>
- </listitem>
- </itemizedlist>
- <para>ARRAYTABLE is effectively a shortcut for using the <xref linkend="array_get"/> function in a nested table. For example "ARRAYGET(val COLUMNS col1 string, col2 integer) AS X" is the same as "TABLE(SELECT cast(array_get(val, 1) AS string) AS col1, cast(array_get(val, 2) AS integer) AS col2) AS X".</para>
- </section>
- <section id="where_clause">
- <title>WHERE Clause</title>
- <para>
- The WHERE clause defines the criteria to limit the records affected by SELECT, UPDATE, and DELETE statements.
- </para>
- <itemizedlist>
- <para>The general form of the WHERE is:
- </para>
- <listitem>
- <para>WHERE <link linkend="criteria">criteria</link>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- <section id="groupby_clause">
- <title>GROUP BY Clause</title>
- <para>
- The GROUP BY clause denotes that rows should be grouped according to the specified expression values. One row will be returned for each group, after optionally filtering those aggregate rows based on a HAVING clause.
- </para>
- <itemizedlist>
- <para>The general form of the GROUP BY is:
- </para>
- <listitem>
- <para>GROUP BY expression (,expression)*
- </para>
- </listitem>
- </itemizedlist>
- <itemizedlist>
- <para>Syntax Rules:
- </para>
- <listitem>
- <para>Column references in the group by clause must by to unaliased output columns.
- </para>
- </listitem>
- <listitem>
- <para>Expressions used in the group by must appear in the select clause.
- </para>
- </listitem>
- <listitem>
- <para>Column references and expessions in the select clause that are not used in the group by clause must appear in aggregate functions.
- </para>
- </listitem>
- <listitem>
- <para>If an aggregate function is used in the SELECT clause and no
- GROUP BY is specified, an implicit GROUP BY will be performed with
- the entire result set as a single group. In this case, every column
- in the SELECT must be an aggregate function as no other column value
- will be fixed across the entire group.
- </para>
- </listitem>
- <listitem>
- <para>The group by columns must be of a comparable type.</para>
- </listitem>
- </itemizedlist>
- </section>
- <section id="having_clause">
- <title>HAVING Clause</title>
- <para>
- The HAVING clause operates exactly as a WHERE clause although it operates on the output of a GROUP BY. It supports the same syntax as the WHERE clause.
- </para>
- <itemizedlist>
- <para>Syntax Rules:
- </para>
- <listitem>
- <para>Expressions used in the group by clause must either
- contain an aggregate function: COUNT, AVG, SUM, MIN, MAX. or be one
- of the grouping expressions.</para>
- </listitem>
- </itemizedlist>
- </section>
- <section id="orderby_clause">
- <title>ORDER BY Clause</title>
- <para>
- The ORDER BY clause specifies how records should be sorted. The options are ASC (ascending) and DESC (descending).
- </para>
- <para>
- Usage:
- <synopsis label="Usage">ORDER BY expression [ASC|DESC] [NULLS (FIRST|LAST)], ...</synopsis>
- </para>
- <itemizedlist>
- <para>Syntax Rules:
- </para>
- <listitem>
- <para>Sort columns may be specified positionally by a 1-based positional
- integer, by SELECT clause alias name, by SELECT clause expression, or by an unrelated expression.</para>
- </listitem>
- <listitem>
- <para>Column references may appear in the SELECT clause as the
- expression for an aliased column or may reference columns from tables
- in the FROM clause.
- If the column reference is not in the SELECT clause the query must not
- be a set operation, specify SELECT DISTINCT, or contain a GROUP BY
- clause.</para>
- </listitem>
- <listitem>
- <para>Unrelated expressions, expressions not appearing as an aliased expression in the select clause,
- are allowed in the order by clause of a non-set QUERY. The columns referenced in the expression must come from the
- from clause table references. The column references cannot be to alias names or positional.
- </para>
- </listitem>
- <listitem>
- <para>The ORDER BY columns must be of a comparable type.</para>
- </listitem>
- <listitem>
- <para>If an ORDER BY is used in an inline view or view
- definition without a limit clause, it will be removed by the Teiid
- optimizer.</para>
- </listitem>
- <listitem>
- <para>If NULLS FIRST/LAST is specified, then nulls are guaranteed to be sorted either first or last. If the null ordering is not specified, then results will
- typically be sorted with nulls as low values, which is Teiid's internal default sorting behavior.
- However not all sources return results with nulss sorted as low values by default, and Teiid may return results with different null orderings.
- </para>
- </listitem>
- </itemizedlist>
- <warning>
- <para>The use of positional ordering is no longer supported by the
- ANSI SQL standard and is a deprecated feature in Teiid. It is
- preferable to use alias names in the order by clause.</para>
- </warning>
- </section>
- <section id="limit_clause">
- <title>LIMIT Clause</title>
- <para>
- The LIMIT clause specifies a limit on the number of records returned from the SELECT command. An optional offset (the number of rows to skip) can be specified. The LIMIT clause can also be specfied using the SQL 2008 OFFSET/FETCH FIRST clauses.
- If an ORDER BY is also specified, it will be applied before the OFFSET/LIMIT are applied. If an ORDER BY is not specified there is generally no guarantee what subset of rows will be returned.
- </para>
- <para>
- Usage:
- <synopsis label="Usage">LIMIT [offset,] limit</synopsis>
- <synopsis label="Usage">[OFFSET offset ROW|ROWS] [FETCH FIRST|NEXT [limit] ROW|ROWS ONLY</synopsis>
- </para>
- <itemizedlist>
- <para>Syntax Rules:
- </para>
- <listitem>
- <para>The limit/offset expressions must be a non-negative integer or a parameter reference (?). An offset of 0 is ignored. A limit of 0 will return no rows.
- </para>
- </listitem>
- <listitem>
- <para>The terms FIRST/NEXT are interchangable as well as ROW/ROWS.
- </para>
- </listitem>
- </itemizedlist>
- <itemizedlist>
- <para>Examples:
- </para>
- <listitem>
- <para>LIMIT 100 - returns the first 100 records (rows 1-100)</para>
- </listitem>
- <listitem>
- <para>LIMIT 500, 100 - skips 500 records and returns the next 100 records (rows 501-600)</para>
- </listitem>
- <listitem>
- <para>OFFSET 500 ROWS - skips 500 records</para>
- </listitem>
- <listitem>
- <para>OFFSET 500 ROWS FETCH NEXT 100 ROWS ONLY - skips 500 records and returns the next 100 records (rows 501-600)</para>
- </listitem>
- <listitem>
- <para>FETCH FIRST ROW ONLY - returns only the first record</para>
- </listitem>
- </itemizedlist>
- </section>
- <section id="into_clause">
- <title>INTO Clause</title>
- <warning>
- <para>Usage of the INTO Clause for inserting into a table has been been deprecated. An <link linkend="insert_command">INSERT</link> with a query command should be used instead.</para>
- </warning>
- <para>
- When the into clause is specified with a SELECT, the results of the query are inserted into the specified table. This is often used to insert records into a temporary table. The INTO clause immediately precedes the FROM clause.
- </para>
- <para>
- Usage:
- <synopsis label="Usage">INTO table FROM ...</synopsis>
- </para>
- <itemizedlist>
- <para>Syntax Rules:
- </para>
- <listitem>
- <para>The INTO clause is logically applied last in processing, after the ORDER BY and LIMIT clauses.</para>
- </listitem>
- <listitem>
- <para>Teiid's support for SELECT INTO is similar to
- MS SQL Server. The target of the INTO clause is a table where
- the result of the rest select command will be inserted. SELECT
- INTO should not be used UNION query.</para>
- </listitem>
- </itemizedlist>
- </section>
- <section id="option_clause">
- <title>OPTION Clause</title>
- <para>
- The OPTION keyword denotes options the user can pass in with the command. These options are Teiid-specific and not covered by any SQL specification.
- </para>
- <para>
- Usage:
- <synopsis label="Usage">OPTION option, (option)*</synopsis>
- </para>
- <itemizedlist>
- <para>Supported options:
- </para>
- <listitem>
- <para>MAKEDEP table [(,table)*] - specifies source tables that should be made dependent in the join
- </para>
- </listitem>
- <listitem>
- <para>MAKENOTDEP table [(,table)*] - prevents a dependent join from being used
- </para>
- </listitem>
- <listitem>
- <para>NOCACHE [table (,table)*] - prevents cache from being used for all tables or for the given tables
- </para>
- </listitem>
- </itemizedlist>
- <itemizedlist>
- <para>Examples:
- </para>
- <listitem>
- <para>OPTION MAKEDEP table1</para>
- </listitem>
- <listitem>
- <para>OPTION NOCACHE</para>
- </listitem>
- </itemizedlist>
- <para>All tables specified in the OPTION clause should be fully qualified.</para>
- <note><para>Previous versions of Teiid accepted the PLANONLY, DEBUG, and SHOWPLAN option arguments. These are no longer accepted in the OPTION clause.
- Please see the Client Developers Guide for replacements to those options.
- </para></note>
- </section>
- </section>
<section id="set_operations">
<title>Set Operations</title>
<para>Teiid supports the UNION, UNION ALL, INTERSECT, EXCEPT set operation as a way of combining the results of query expressions.</para>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2011-07-28 19:58:08 UTC (rev 3347)
@@ -101,6 +101,7 @@
tgtCaps.setCapabilitySupport(Capability.COMMON_TABLE_EXPRESSIONS, srcCaps.supportsCommonTableExpressions());
tgtCaps.setCapabilitySupport(Capability.ADVANCED_OLAP, srcCaps.supportsAdvancedOlapOperations());
tgtCaps.setCapabilitySupport(Capability.ELEMENTARY_OLAP, srcCaps.supportsAdvancedOlapOperations());
+ tgtCaps.setCapabilitySupport(Capability.WINDOW_FUNCTION_ORDER_BY_AGGREGATES, srcCaps.supportsWindowOrderByWithAggregates());
tgtCaps.setCapabilitySupport(Capability.QUERY_AGGREGATES_ARRAY, srcCaps.supportsArrayAgg());
List functions = srcCaps.getSupportedFunctions();
if(functions != null && functions.size() > 0) {
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/RankingFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/RankingFunction.java 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/RankingFunction.java 2011-07-28 19:58:08 UTC (rev 3347)
@@ -27,7 +27,6 @@
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
-import org.teiid.query.processor.relational.GroupingNode;
import org.teiid.query.sql.symbol.AggregateSymbol.Type;
/**
@@ -36,38 +35,37 @@
public class RankingFunction extends AggregateFunction {
private int count = 0;
- private int result = 0;
- private int[] orderIndexes;
+ private int lastCount = 0;
private Type type;
- private List<?> previousTuple;
- public RankingFunction(Type function, int[] orderIndexes) {
+ public RankingFunction(Type function) {
this.type = function;
- this.orderIndexes = orderIndexes;
}
@Override
public void reset() {
count = 0;
- result = 0;
+ lastCount = 0;
}
@Override
public void addInputDirect(Object input, List<?> tuple)
throws FunctionExecutionException, ExpressionEvaluationException,
TeiidComponentException {
- if (previousTuple == null || !GroupingNode.sameGroup(orderIndexes, tuple, previousTuple)) {
+ if (type == Type.RANK) {
count++;
- result = count;
- } else if (type == Type.RANK) {
- count++;
}
- previousTuple = tuple;
}
@Override
public Object getResult() throws FunctionExecutionException,
ExpressionEvaluationException, TeiidComponentException {
+ if (type == Type.DENSE_RANK) {
+ count++;
+ return count;
+ }
+ int result = ++lastCount;
+ lastCount = count;
return result;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java 2011-07-28 19:58:08 UTC (rev 3347)
@@ -323,7 +323,8 @@
MAX_DEPENDENT_PREDICATES,
ADVANCED_OLAP,
QUERY_AGGREGATES_ARRAY,
- ELEMENTARY_OLAP
+ ELEMENTARY_OLAP,
+ WINDOW_FUNCTION_ORDER_BY_AGGREGATES
}
public enum Scope {
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2011-07-28 19:58:08 UTC (rev 3347)
@@ -168,7 +168,14 @@
public void visit(WindowFunction windowFunction) {
if(! this.caps.supportsCapability(Capability.ELEMENTARY_OLAP)) {
markInvalid(windowFunction, "Window function not supported by source"); //$NON-NLS-1$
- }
+ return;
+ }
+ if (!this.caps.supportsCapability(Capability.WINDOW_FUNCTION_ORDER_BY_AGGREGATES)
+ && windowFunction.getWindowSpecification().getOrderBy() != null
+ && !windowFunction.getFunction().isAnalytical()) {
+ markInvalid(windowFunction, "Window function order by with aggregate not supported by source"); //$NON-NLS-1$
+ return;
+ }
}
public void visit(CaseExpression obj) {
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java 2011-07-28 19:58:08 UTC (rev 3347)
@@ -498,7 +498,7 @@
ss = ((AliasSymbol)ss).getSymbol();
}
- if (ss instanceof ExpressionSymbol && !(ss instanceof AggregateSymbol)) {
+ if (ss instanceof WindowFunction || (ss instanceof ExpressionSymbol && !(ss instanceof AggregateSymbol))) {
createdSymbols.add(ss);
}
ElementCollectorVisitor.getElements(ss, requiredSymbols);
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java 2011-07-28 19:58:08 UTC (rev 3347)
@@ -73,6 +73,8 @@
public class WindowFunctionProjectNode extends SubqueryAwareRelationalNode {
+ private static final List<Integer> SINGLE_VALUE_ID = Arrays.asList(0);
+
private enum Phase {
COLLECT,
PROCESS,
@@ -92,6 +94,7 @@
List<NullOrdering> nullOrderings = new ArrayList<NullOrdering>();
List<Boolean> orderType = new ArrayList<Boolean>();
List<WindowFunctionInfo> functions = new ArrayList<WindowFunctionInfo>();
+ List<WindowFunctionInfo> rowValuefunctions = new ArrayList<WindowFunctionInfo>();
}
private LinkedHashMap<WindowSpecification, WindowSpecificationInfo> windows = new LinkedHashMap<WindowSpecification, WindowSpecificationInfo>();
@@ -106,6 +109,7 @@
private TupleSource inputTs;
private STree[] partitionMapping;
private STree[] valueMapping;
+ private STree[] rowValueMapping;
private IndexedTupleSource outputTs;
public WindowFunctionProjectNode(int nodeId) {
@@ -123,6 +127,7 @@
this.phase = Phase.COLLECT;
this.partitionMapping = null;
this.valueMapping = null;
+ this.rowValueMapping = null;
this.outputTs = null;
}
@@ -132,20 +137,22 @@
tb.remove();
tb = null;
}
- if (partitionMapping != null) {
- for (STree tree : partitionMapping) {
+ removeMappings(partitionMapping);
+ partitionMapping = null;
+ removeMappings(valueMapping);
+ valueMapping = null;
+ removeMappings(rowValueMapping);
+ rowValueMapping = null;
+ }
+
+ private void removeMappings(STree[] mappings) {
+ if (mappings != null) {
+ for (STree tree : mappings) {
if (tree != null) {
tree.remove();
}
}
- partitionMapping = null;
}
- if (valueMapping != null) {
- for (STree tree : valueMapping) {
- tree.remove();
- }
- valueMapping = null;
- }
}
public Object clone(){
@@ -201,7 +208,11 @@
wfi.conditionIndex = getIndex(ex);
}
wfi.outputIndex = i;
- wsi.functions.add(wfi);
+ if (wf.getFunction().getAggregateFunction() == Type.ROW_NUMBER) {
+ wsi.rowValuefunctions.add(wfi);
+ } else {
+ wsi.functions.add(wfi);
+ }
} else {
int index = getIndex(ex);
passThrough.put(i, index);
@@ -218,6 +229,7 @@
phase = Phase.PROCESS;
partitionMapping = new STree[this.windows.size()];
valueMapping = new STree[this.windows.size()];
+ rowValueMapping = new STree[this.windows.size()];
}
if (phase == Phase.PROCESS) {
@@ -244,15 +256,27 @@
for (int specIndex = 0; specIndex < specs.size(); specIndex++) {
Map.Entry<WindowSpecification, WindowSpecificationInfo> entry = specs.get(specIndex);
List<?> idRow = Arrays.asList(rowId);
- if (partitionMapping[specIndex] != null) {
- idRow = partitionMapping[specIndex].find(idRow);
- idRow = idRow.subList(1, 2);
+ List<WindowFunctionInfo> functions = entry.getValue().rowValuefunctions;
+ if (!functions.isEmpty()) {
+ List<?> valueRow = rowValueMapping[specIndex].find(idRow);
+ for (int i = 0; i < functions.size(); i++) {
+ WindowFunctionInfo wfi = functions.get(i);
+ outputRow.set(wfi.outputIndex, valueRow.get(i+1));
+ }
}
- List<?> valueRow = valueMapping[specIndex].find(idRow);
- List<WindowFunctionInfo> functions = entry.getValue().functions;
- for (int i = 0; i < functions.size(); i++) {
- WindowFunctionInfo wfi = functions.get(i);
- outputRow.set(wfi.outputIndex, valueRow.get(i+1));
+ functions = entry.getValue().functions;
+ if (!functions.isEmpty()) {
+ if (partitionMapping[specIndex] != null) {
+ idRow = partitionMapping[specIndex].find(idRow);
+ idRow = idRow.subList(1, 2);
+ } else {
+ idRow = SINGLE_VALUE_ID;
+ }
+ List<?> valueRow = valueMapping[specIndex].find(idRow);
+ for (int i = 0; i < functions.size(); i++) {
+ WindowFunctionInfo wfi = functions.get(i);
+ outputRow.set(wfi.outputIndex, valueRow.get(i+1));
+ }
}
}
this.addBatchRow(outputRow);
@@ -281,24 +305,20 @@
Map.Entry<WindowSpecification, WindowSpecificationInfo> entry = specs.get(specIndex);
WindowSpecificationInfo info = entry.getValue();
IndexedTupleSource specificationTs = tb.createIndexedTupleSource();
- int[] groupingIndexes = null;
+ boolean multiGroup = false;
+ int[] partitionIndexes = null;
int[] orderIndexes = null;
//if there is partitioning or ordering, then sort
if (!info.orderType.isEmpty()) {
+ multiGroup = true;
int[] sortKeys = new int[info.orderType.size()];
int i = 0;
if (!info.groupIndexes.isEmpty()) {
for (Integer sortIndex : info.groupIndexes) {
sortKeys[i++] = sortIndex;
}
- groupingIndexes = Arrays.copyOf(sortKeys, info.groupIndexes.size());
- ElementSymbol key = new ElementSymbol("rowid"); //$NON-NLS-1$
- key.setType(DataTypeManager.DefaultDataClasses.INTEGER);
- ElementSymbol value = new ElementSymbol("partitionid"); //$NON-NLS-1$
- key.setType(DataTypeManager.DefaultDataClasses.INTEGER);
- List<ElementSymbol> elements = Arrays.asList(key, value);
- partitionMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1);
+ partitionIndexes = Arrays.copyOf(sortKeys, info.groupIndexes.size());
}
if (!info.sortIndexes.isEmpty()) {
for (Integer sortIndex : info.sortIndexes) {
@@ -306,73 +326,97 @@
}
orderIndexes = Arrays.copyOfRange(sortKeys, info.groupIndexes.size(), info.groupIndexes.size() + info.sortIndexes.size());
}
+ if (!info.functions.isEmpty()) {
+ ElementSymbol key = new ElementSymbol("rowId"); //$NON-NLS-1$
+ key.setType(DataTypeManager.DefaultDataClasses.INTEGER);
+ ElementSymbol value = new ElementSymbol("partitionId"); //$NON-NLS-1$
+ key.setType(DataTypeManager.DefaultDataClasses.INTEGER);
+ List<ElementSymbol> elements = Arrays.asList(key, value);
+ partitionMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1);
+ }
SortUtility su = new SortUtility(specificationTs, Mode.SORT, this.getBufferManager(), this.getConnectionID(), tb.getSchema(), info.orderType, info.nullOrderings, sortKeys);
TupleBuffer sorted = su.sort();
specificationTs = sorted.createIndexedTupleSource(true);
}
- List<AggregateFunction> aggs = initializeAccumulators(info, specIndex, orderIndexes);
+ List<AggregateFunction> aggs = initializeAccumulators(info.functions, specIndex, false);
+ List<AggregateFunction> rowValueAggs = initializeAccumulators(info.rowValuefunctions, specIndex, true);
- int partitionId = 0;
+ int groupId = 0;
List<?> lastRow = null;
while (specificationTs.hasNext()) {
List<?> tuple = specificationTs.nextTuple();
- boolean sameGroup = true;
- if (lastRow != null) {
- sameGroup = GroupingNode.sameGroup(groupingIndexes, tuple, lastRow);
- if (!sameGroup || orderIndexes != null) {
- saveValues(specIndex, orderIndexes, aggs, partitionId, lastRow, sameGroup);
+ if (multiGroup) {
+ if (lastRow != null) {
+ boolean samePartition = GroupingNode.sameGroup(partitionIndexes, tuple, lastRow);
+ if (!aggs.isEmpty() && (!samePartition || !GroupingNode.sameGroup(orderIndexes, tuple, lastRow))) {
+ saveValues(specIndex, aggs, groupId, samePartition, false);
+ groupId++;
+ }
+ saveValues(specIndex, rowValueAggs, lastRow.get(lastRow.size() - 1), samePartition, true);
}
- }
- if (orderIndexes == null) {
- if (!sameGroup) {
- partitionId++;
- }
- List<Object> partitionTuple = Arrays.asList(tuple.get(tuple.size() - 1), partitionId);
- partitionMapping[specIndex].insert(partitionTuple, InsertMode.NEW, -1);
+ if (!aggs.isEmpty()) {
+ List<Object> partitionTuple = Arrays.asList(tuple.get(tuple.size() - 1), groupId);
+ partitionMapping[specIndex].insert(partitionTuple, InsertMode.NEW, -1);
+ }
}
for (AggregateFunction function : aggs) {
function.addInput(tuple);
}
+ for (AggregateFunction function : rowValueAggs) {
+ function.addInput(tuple);
+ }
lastRow = tuple;
}
if(lastRow != null) {
- saveValues(specIndex, orderIndexes, aggs, partitionId, lastRow, true);
+ saveValues(specIndex, aggs, groupId, true, false);
+ saveValues(specIndex, rowValueAggs, lastRow.get(lastRow.size() - 1), true, true);
}
}
}
- private void saveValues(int specIndex, int[] orderIndexes,
- List<AggregateFunction> aggs, int partitionId, List<?> tuple,
- boolean sameGroup) throws FunctionExecutionException,
+ private void saveValues(int specIndex,
+ List<AggregateFunction> aggs, Object id,
+ boolean samePartition, boolean rowValue) throws FunctionExecutionException,
ExpressionEvaluationException, TeiidComponentException,
TeiidProcessingException {
+ if (aggs.isEmpty()) {
+ return;
+ }
List<Object> row = new ArrayList<Object>(aggs.size() + 1);
- if (orderIndexes == null) {
- row.add(partitionId);
- } else {
- //use the rowid
- row.add(tuple.get(tuple.size() - 1));
- }
+ row.add(id);
for (AggregateFunction function : aggs) {
row.add(function.getResult());
- if (!sameGroup) {
+ if (!samePartition) {
function.reset();
}
}
- valueMapping[specIndex].insert(row, orderIndexes != null?InsertMode.NEW:InsertMode.ORDERED, -1);
+ if (rowValue) {
+ rowValueMapping[specIndex].insert(row, InsertMode.NEW, -1);
+ } else {
+ valueMapping[specIndex].insert(row, InsertMode.ORDERED, -1);
+ }
}
- private List<AggregateFunction> initializeAccumulators(WindowSpecificationInfo info, int specIndex,
- int[] orderIndexes) {
- List<AggregateFunction> aggs = new ArrayList<AggregateFunction>();
+ /**
+ * TODO: consolidate with {@link GroupingNode}
+ * @param functions
+ * @param specIndex
+ * @param rowValues
+ * @return
+ */
+ private List<AggregateFunction> initializeAccumulators(List<WindowFunctionInfo> functions, int specIndex, boolean rowValues) {
+ List<AggregateFunction> aggs = new ArrayList<AggregateFunction>(functions.size());
+ if (functions.isEmpty()) {
+ return aggs;
+ }
//initialize the function accumulators
- List<ElementSymbol> elements = new ArrayList<ElementSymbol>(info.functions.size() + 1);
+ List<ElementSymbol> elements = new ArrayList<ElementSymbol>(functions.size() + 1);
ElementSymbol key = new ElementSymbol("id"); //$NON-NLS-1$
key.setType(DataTypeManager.DefaultDataClasses.INTEGER);
elements.add(key);
CommandContext context = this.getContext();
- for (WindowFunctionInfo wfi : info.functions) {
+ for (WindowFunctionInfo wfi : functions) {
AggregateSymbol aggSymbol = wfi.function.getFunction();
Class<?> outputType = aggSymbol.getType();
ElementSymbol value = new ElementSymbol("val"); //$NON-NLS-1$
@@ -387,7 +431,7 @@
switch (function) {
case RANK:
case DENSE_RANK:
- af = new RankingFunction(function, orderIndexes);
+ af = new RankingFunction(function);
break;
case ROW_NUMBER: //same as count(*)
case COUNT:
@@ -424,7 +468,13 @@
aggs.add(af);
}
- valueMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1);
+ if (!aggs.isEmpty()) {
+ if (!rowValues) {
+ valueMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1);
+ } else {
+ rowValueMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1);
+ }
+ }
return aggs;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java 2011-07-28 19:58:08 UTC (rev 3347)
@@ -176,18 +176,28 @@
return DataTypeManager.DefaultDataClasses.OBJECT;
case TEXTAGG:
return DataTypeManager.DefaultDataClasses.BLOB;
- case RANK:
- case ROW_NUMBER:
- case DENSE_RANK:
- return DataTypeManager.DefaultDataClasses.INTEGER;
}
if (isBoolean()) {
return DataTypeManager.DefaultDataClasses.BOOLEAN;
- } else if (isEnhancedNumeric()) {
+ }
+ if (isEnhancedNumeric()) {
return DataTypeManager.DefaultDataClasses.DOUBLE;
}
+ if (isAnalytical()) {
+ return DataTypeManager.DefaultDataClasses.INTEGER;
+ }
return this.getExpression().getType();
}
+
+ public boolean isAnalytical() {
+ switch (this.aggregate) {
+ case RANK:
+ case ROW_NUMBER:
+ case DENSE_RANK:
+ return true;
+ }
+ return false;
+ }
public boolean isBoolean() {
return this.aggregate == Type.EVERY
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-07-28 19:58:08 UTC (rev 3347)
@@ -113,7 +113,7 @@
ERR.015.008.0040= The function ''{0}'' is a valid function form, but the arguments do not match a known type signature and cannot be converted using implicit type conversions.
ERR.015.008.0041= Expected value of type ''{0}'' but ''{1}'' is of type ''{2}'' and no implicit conversion is available.
ERR.015.008.0042= Element ''{0}'' in ORDER BY is ambiguous and may refer to more than one element of SELECT clause.
-ERR.015.008.0043= Element ''{0}'' in ORDER BY was not found in SELECT clause.
+ERR.015.008.0043= Element ''{0}'' in ORDER BY was not found in the FROM clause.
ERR.015.008.0045= Failed parsing {1} plan for {0}
ERR.015.008.0046= The symbol {0} may only be used once in the FROM clause.
ERR.015.008.0047= The symbol {0} refers to a group not defined in the FROM clause.
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestWindowFunctions.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestWindowFunctions.java 2011-07-28 11:43:06 UTC (rev 3346)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestWindowFunctions.java 2011-07-28 19:58:08 UTC (rev 3347)
@@ -51,6 +51,46 @@
checkNodeTypes(plan, FULL_PUSHDOWN);
}
+ @Test public void testWindowFunctionPushdown() throws Exception {
+ BasicSourceCapabilities caps = getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.ELEMENTARY_OLAP, true);
+ caps.setCapabilitySupport(Capability.WINDOW_FUNCTION_ORDER_BY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
+ ProcessorPlan plan = TestOptimizer.helpPlan("select max(e1) over (order by e1) as y from pm1.g1", //$NON-NLS-1$
+ RealMetadataFactory.example1Cached(), null, new DefaultCapabilitiesFinder(caps),
+ new String[] {
+ "SELECT MAX(g_0.e1) OVER (ORDER BY g_0.e1) FROM pm1.g1 AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+
+ checkNodeTypes(plan, FULL_PUSHDOWN);
+ }
+
+ @Test public void testWindowFunctionPushdown1() throws Exception {
+ BasicSourceCapabilities caps = getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.ELEMENTARY_OLAP, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
+ ProcessorPlan plan = TestOptimizer.helpPlan("select max(e1) over (order by e1) as y from pm1.g1", //$NON-NLS-1$
+ RealMetadataFactory.example1Cached(), null, new DefaultCapabilitiesFinder(caps),
+ new String[] {
+ "SELECT g_0.e1 FROM pm1.g1 AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+
+ checkNodeTypes(plan, new int[] {
+ 1, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 0, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+ }
+
@Test public void testRanking() throws Exception {
String sql = "select e1, row_number() over (order by e1), rank() over (order by e1), dense_rank() over (order by e1 nulls last) from pm1.g1";
@@ -127,5 +167,73 @@
helpProcess(plan, dataManager, expected);
}
+ /**
+ * Note that we've optimized the ordering to be performed prior to the windowing.
+ * If we change the windowing logic to not preserve the incoming row ordering, then this optimization will need to change
+ * @throws Exception
+ */
+ @Test public void testCountDuplicates() throws Exception {
+ String sql = "select e1, count(e1) over (order by e1) as c from pm1.g1 order by e1";
+
+ List<?>[] expected = new List[] {
+ Arrays.asList("a", 2),
+ Arrays.asList("a", 2),
+ Arrays.asList("b", 3),
+ };
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("SELECT g_0.e1 AS c_0 FROM pm1.g1 AS g_0 ORDER BY c_0", new List[] {Arrays.asList("a"), Arrays.asList("a"), Arrays.asList("b")});
+ ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder());
+
+ helpProcess(plan, dataManager, expected);
+ }
+ @Test public void testEmptyOver() throws Exception {
+ String sql = "select e1, max(e1) over () as c from pm1.g1";
+
+ List<?>[] expected = new List[] {
+ Arrays.asList("a", "c"),
+ Arrays.asList(null, "c"),
+ Arrays.asList("a", "c"),
+ Arrays.asList("c", "c"),
+ Arrays.asList("b", "c"),
+ Arrays.asList("a", "c"),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+ ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testRowNumberMedian() throws Exception {
+ String sql = "select e1, r, c from (select e1, row_number() over (order by e1) as r, count(*) over () c from pm1.g1) x where r = ceiling(c/2)";
+
+ List<?>[] expected = new List[] {
+ Arrays.asList("a", 3, 6),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+ ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testPartitionedRowNumber() throws Exception {
+ String sql = "select e1, e3, row_number() over (partition by e3 order by e1) as r from pm1.g1 order by r limit 2";
+
+ List<?>[] expected = new List[] {
+ Arrays.asList(null, Boolean.FALSE, 1),
+ Arrays.asList("a", Boolean.TRUE, 1),
+ };
+
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+ ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder());
+
+ helpProcess(plan, dataManager, expected);
+ }
+
}
13 years, 4 months
teiid SVN: r3346 - branches/7.4.x/engine/src/main/java/org/teiid/query/processor/xml.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-07-28 07:43:06 -0400 (Thu, 28 Jul 2011)
New Revision: 3346
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java
Log:
TEIID-993 adding the ability to start sibling mapping class queries in parallel.
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java 2011-07-27 21:30:01 UTC (rev 3345)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java 2011-07-28 11:43:06 UTC (rev 3346)
@@ -73,7 +73,7 @@
// bound references; they are not part of the document; so they do not know about document
// details.
Map referenceValues = null;
- executor.execute(referenceValues);
+ executor.execute(referenceValues, false);
env.markStagingTableAsLoaded(this.resultSetName);
// now that we done executing the plan; remove the plan from context
13 years, 5 months
teiid SVN: r3345 - in branches/7.4.x: build/kits/jboss-container/deploy/teiid and 7 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-07-27 17:30:01 -0400 (Wed, 27 Jul 2011)
New Revision: 3345
Modified:
branches/7.4.x/api/src/main/java/org/teiid/events/EventDistributor.java
branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml
branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/TupleBatchCacheLoader.java
branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties
branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
branches/7.4.x/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
Log:
TEIID-1657: added distributed refresh of cache node. When a internal materialized view(imv) is loaded at a node, after that imv contents finished loading at that node, a event will be sent to all the other nodes to refresh their content with contents of the original node. The other nodes will pull the updated data.
Modified: branches/7.4.x/api/src/main/java/org/teiid/events/EventDistributor.java
===================================================================
--- branches/7.4.x/api/src/main/java/org/teiid/events/EventDistributor.java 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/api/src/main/java/org/teiid/events/EventDistributor.java 2011-07-27 21:30:01 UTC (rev 3345)
@@ -121,4 +121,11 @@
*/
void setViewDefinition(String vdbName, int vdbVersion, String schema, String viewName, String definition);
+ /**
+ *
+ * @param vdbName
+ * @param vdbVersion
+ * @param viewName
+ */
+ void refreshMatView(String vdbName, int vdbVersion, String tableName);
}
Modified: branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml
===================================================================
--- branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml 2011-07-27 21:30:01 UTC (rev 3345)
@@ -145,7 +145,7 @@
</property>
<property name="clusterName">${jboss.partition.name:DefaultPartition}-teiid-events</property>
<property name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
- <property name="localEventDistributorName">teiid/runtime-engine</property>
+ <property name="localEventDistributorName">teiid/engine-deployer</property>
</bean>
</deployment>
\ No newline at end of file
Modified: branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
===================================================================
--- branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2011-07-27 21:30:01 UTC (rev 3345)
@@ -59,7 +59,9 @@
if (!this.cacheStore.getCacheStatus().allowInvocations()) {
this.cacheStore.start();
- this.cacheStore.getRegion(this.cacheStore.getRoot().getFqn(), true).activate();
+ if (this.cacheStore.getRegion(this.cacheStore.getRoot().getFqn(), false) != null) {
+ this.cacheStore.getRegion(this.cacheStore.getRoot().getFqn(), true).activate();
+ }
}
Node cacheRoot = this.cacheStore.getRoot().addChild(Fqn.fromString("Teiid")); //$NON-NLS-1$
Modified: branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/TupleBatchCacheLoader.java
===================================================================
--- branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/TupleBatchCacheLoader.java 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/TupleBatchCacheLoader.java 2011-07-27 21:30:01 UTC (rev 3345)
@@ -62,9 +62,8 @@
map.put(id, b);
return map;
}
- return super.get(fqn);
}
- return null;
+ return super.get(fqn);
}
@Override
Modified: branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2011-07-27 21:30:01 UTC (rev 3345)
@@ -99,8 +99,12 @@
this.uuid = java.util.UUID.randomUUID().toString();
}
return this.uuid;
- }
+ }
+ public void setId(String uuid) {
+ this.uuid = uuid;
+ }
+
public boolean isLobs() {
return lobIndexes != null;
}
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2011-07-27 21:30:01 UTC (rev 3345)
@@ -139,6 +139,7 @@
}
buffer = bufferManager.createTupleBuffer(schema, "cached", TupleSourceType.FINAL); //$NON-NLS-1$
buffer.setBatchSize(this.batchSize);
+ buffer.setId(this.uuid);
if (this.hint != null) {
buffer.setPrefersMemory(this.hint.getPrefersMemory());
}
@@ -151,6 +152,7 @@
return false;
}
buffer.addTupleBatch(batch, true);
+ cache.remove(uuid+","+row); //$NON-NLS-1$
}
this.results = buffer;
bufferManager.addTupleBuffer(this.results);
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-07-27 21:30:01 UTC (rev 3345)
@@ -405,7 +405,7 @@
}
}
- void addWork(Runnable work) {
+ public void addWork(Runnable work) {
this.processWorkerPool.execute(work);
}
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-07-27 21:30:01 UTC (rev 3345)
@@ -309,15 +309,27 @@
QueryMetadataInterface metadata = context.getMetadata();
TempTableStore globalStore = context.getGlobalTableStore();
if (StringUtil.endsWithIgnoreCase(proc.getProcedureCallableName(), REFRESHMATVIEW)) {
- Object groupID = validateMatView(metadata, proc);
+ Object groupID = validateMatView(metadata, (String)((Constant)proc.getParameter(1).getExpression()).getValue());
Object matTableId = context.getGlobalTableStore().getGlobalTempTableMetadataId(groupID, metadata);
String matViewName = metadata.getFullName(groupID);
String matTableName = metadata.getFullName(matTableId);
LogManager.logDetail(LogConstants.CTX_MATVIEWS, "processing refreshmatview for", matViewName); //$NON-NLS-1$
MatTableInfo info = globalStore.getMatTableInfo(matTableName);
+ Long loadTime = null;
+ boolean useCache = false;
+ if (this.distributedCache != null) {
+ MatTableKey key = new MatTableKey();
+ key.name = matTableName;
+ key.vdb = new VDBKey(context.getVdbName(),context.getVdbVersion());
+ MatTableEntry entry = this.tables.get(key);
+ useCache = (entry != null && entry.valid && entry.lastUpdate > info.getUpdateTime());
+ if (useCache) {
+ loadTime = entry.lastUpdate;
+ }
+ }
boolean invalidate = Boolean.TRUE.equals(((Constant)proc.getParameter(2).getExpression()).getValue());
if (invalidate) {
- touchTable(context, matTableName, false);
+ touchTable(context, matTableName, false, System.currentTimeMillis());
}
MatState oldState = info.setState(MatState.NEEDS_LOADING, invalidate?Boolean.FALSE:null, null);
if (oldState == MatState.LOADING) {
@@ -325,10 +337,10 @@
}
GroupSymbol matTable = new GroupSymbol(matTableName);
matTable.setMetadataID(matTableId);
- int rowCount = loadGlobalTable(context, matTable, matTableName, globalStore, info, null, false);
+ int rowCount = loadGlobalTable(context, matTable, matTableName, matViewName, globalStore, info, invalidate?null:loadTime, !invalidate && useCache);
return CollectionTupleSource.createUpdateCountTupleSource(rowCount);
} else if (StringUtil.endsWithIgnoreCase(proc.getProcedureCallableName(), REFRESHMATVIEWROW)) {
- Object groupID = validateMatView(metadata, proc);
+ Object groupID = validateMatView(metadata, (String)((Constant)proc.getParameter(1).getExpression()).getValue());
Object pk = metadata.getPrimaryKey(groupID);
String matViewName = metadata.getFullName(groupID);
if (pk == null) {
@@ -377,15 +389,36 @@
TempTable tempTable = globalStore.getOrCreateTempTable(matTableName, new Query(), bufferManager, false);
return tempTable.updateTuple(tuple, delete);
}
+
+ public void refreshMatView(String vdbName, int vdbVersion, String viewName,
+ QueryMetadataInterface metadata, TempTableStore globalStore)
+ throws QueryProcessingException, TeiidComponentException, TeiidProcessingException {
+
+ Object groupID = validateMatView(metadata, viewName);
+ Object matTableId = globalStore.getGlobalTempTableMetadataId(groupID, metadata);
+ String matViewName = metadata.getFullName(groupID);
+ String matTableName = metadata.getFullName(matTableId);
+ LogManager.logDetail(LogConstants.CTX_MATVIEWS, "processing refreshmatview for", matViewName); //$NON-NLS-1$
+ MatTableInfo info = globalStore.getMatTableInfo(matTableName);
- private Object validateMatView(QueryMetadataInterface metadata,
- StoredProcedure proc) throws TeiidComponentException,
+ MatState oldState = info.setState(MatState.NEEDS_LOADING, Boolean.FALSE, null);
+ if (oldState == MatState.LOADING) {
+ return;
+ }
+ GroupSymbol matTable = new GroupSymbol(matTableName);
+ matTable.setMetadataID(matTableId);
+ CommandContext context = new CommandContext(new Object(), "internal", "internal", vdbName, vdbVersion); //$NON-NLS-1$ //$NON-NLS-2$
+ context.setMetadata(metadata);
+ context.setGlobalTableStore(globalStore);
+ loadGlobalTable(context, matTable, matTableName, matViewName, globalStore, info, null, true);
+ }
+
+ private Object validateMatView(QueryMetadataInterface metadata, String viewName) throws TeiidComponentException,
TeiidProcessingException {
- String name = (String)((Constant)proc.getParameter(1).getExpression()).getValue();
try {
- Object groupID = metadata.getGroupID(name);
+ Object groupID = metadata.getGroupID(viewName);
if (!metadata.hasMaterialization(groupID) || metadata.getMaterialization(groupID) != null) {
- throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableDataManager.not_implicit_matview", name)); //$NON-NLS-1$
+ throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableDataManager.not_implicit_matview", viewName)); //$NON-NLS-1$
}
return groupID;
} catch (QueryMetadataException e) {
@@ -402,8 +435,13 @@
if (!group.isTempGroupSymbol()) {
return null;
}
+ String viewName = null;
final String tableName = group.getNonCorrelationName().toUpperCase();
boolean remapColumns = !tableName.equalsIgnoreCase(group.getName());
+ TempMetadataID groupID = (TempMetadataID)group.getMetadataID();
+ if (groupID.getOriginalMetadataID() != null) {
+ viewName = context.getMetadata().getFullName(groupID.getOriginalMetadataID());
+ }
TempTable table = null;
if (group.isGlobalTable()) {
final TempTableStore globalStore = context.getGlobalTableStore();
@@ -429,9 +467,9 @@
if (load) {
if (!info.isValid()) {
//blocking load
- loadGlobalTable(context, group, tableName, globalStore, info, loadTime, true);
+ loadGlobalTable(context, group, tableName, viewName, globalStore, info, loadTime, true);
} else {
- loadAsynch(context, group, tableName, globalStore, info, loadTime);
+ loadAsynch(context, group, tableName, viewName, globalStore, info, loadTime);
}
}
table = globalStore.getOrCreateTempTable(tableName, query, bufferManager, false);
@@ -464,13 +502,13 @@
}
private void loadAsynch(final CommandContext context,
- final GroupSymbol group, final String tableName,
+ final GroupSymbol group, final String tableName, final String viewName,
final TempTableStore globalStore, final MatTableInfo info,
final Long loadTime) {
Callable<Integer> toCall = new Callable<Integer>() {
@Override
public Integer call() throws Exception {
- return loadGlobalTable(context, group, tableName, globalStore, info, loadTime, true);
+ return loadGlobalTable(context, group, tableName, viewName, globalStore, info, loadTime, true);
}
};
FutureTask<Integer> task = new FutureTask<Integer>(toCall);
@@ -478,7 +516,7 @@
}
private int loadGlobalTable(CommandContext context,
- GroupSymbol group, final String tableName,
+ GroupSymbol group, final String tableName, final String viewName,
TempTableStore globalStore, MatTableInfo info, Long loadTime, boolean useCache)
throws TeiidComponentException, TeiidProcessingException {
LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.getString("TempTableDataManager.loading", tableName)); //$NON-NLS-1$
@@ -506,6 +544,7 @@
}
}
int rowCount = -1;
+ boolean viewFetched = false;
try {
String fullName = metadata.getFullName(group.getMetadataID());
TupleSource ts = null;
@@ -517,6 +556,7 @@
CachedResults cr = this.distributedCache.get(cid);
if (cr != null) {
ts = cr.getResults().createIndexedTupleSource();
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.getString("TempTableDataManager.cache_load", tableName)); //$NON-NLS-1$
}
}
}
@@ -536,9 +576,10 @@
BatchCollector bc = qp.createBatchCollector();
TupleBuffer tb = bc.collectTuples();
cr.setResults(tb, qp.getProcessorPlan());
- touchTable(context, fullName, true);
+ touchTable(context, fullName, true, info.getUpdateTime());
this.distributedCache.put(cid, Determinism.VDB_DETERMINISTIC, cr, info.getTtl());
ts = tb.createIndexedTupleSource();
+ viewFetched = true;
} else {
ts = new BatchCollector.BatchProducerTupleSource(qp);
}
@@ -570,18 +611,22 @@
} else {
globalStore.swapTempTable(tableName, table);
info.setState(MatState.LOADED, true, loadTime);
+ if (viewFetched & viewName != null && this.eventDistributor != null) {
+ this.eventDistributor.refreshMatView(context.getVdbName(), context.getVdbVersion(), viewName);
+ }
LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryPlugin.Util.getString("TempTableDataManager.loaded", tableName, rowCount)); //$NON-NLS-1$
}
}
return rowCount;
}
- private void touchTable(CommandContext context, String fullName, boolean valid) {
+ private void touchTable(CommandContext context, String fullName, boolean valid, long loadtime) {
MatTableKey key = new MatTableKey();
key.name = fullName;
key.vdb = new VDBKey(context.getVdbName(), context.getVdbVersion());
MatTableEntry matTableEntry = new MatTableEntry();
matTableEntry.valid = valid;
+ matTableEntry.lastUpdate = loadtime;
tables.put(key, matTableEntry, null);
}
@@ -644,5 +689,4 @@
public MetadataRepository getMetadataRepository() {
return this.processorDataManager.getMetadataRepository();
}
-
}
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2011-07-27 21:30:01 UTC (rev 3345)
@@ -264,6 +264,7 @@
id = tempMetadataStore.addTempGroup(matTableName, ResolverUtil.resolveElementsInGroup(group, metadata), false, true);
id.setQueryNode(metadata.getVirtualPlan(viewId));
id.setCardinality(metadata.getCardinality(viewId));
+ id.setOriginalMetadataID(viewId);
Object pk = metadata.getPrimaryKey(viewId);
if (pk != null) {
Modified: branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties 2011-07-27 21:30:01 UTC (rev 3345)
@@ -813,6 +813,7 @@
TempTableDataManager.failed_load=Failed to load materialized view table {0}.
TempTableDataManager.loaded=Loaded materialized view table {0} with row count {1}.
TempTableDataManager.loading=Loading materialized view table {0}
+TempTableDataManager.cache_load=Loaded materialized view table {0} from cached contents from another clustered node.
TempTableDataManager.not_implicit_matview={0} does not target an internal materialized view.
TempTableDataManager.row_refresh_pk=Materialized view {0} cannot have a row refreshed since there is no primary key.
TempTableDataManager.row_refresh_composite=Materialized view {0} cannot have a row refreshed because it uses a composite key.
Modified: branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-07-27 21:30:01 UTC (rev 3345)
@@ -113,6 +113,8 @@
import org.teiid.metadata.Table.TriggerEvent;
import org.teiid.net.TeiidURL;
import org.teiid.query.QueryPlugin;
+import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.metadata.TempMetadataAdapter;
import org.teiid.query.metadata.TransformationMetadata;
import org.teiid.query.optimizer.relational.RelationalPlanner;
import org.teiid.query.processor.DdlPlan;
@@ -548,21 +550,11 @@
@Override
@ManagementOperation(description="Execute a sql query", params={@ManagementParameter(name="vdbName"),@ManagementParameter(name="vdbVersion"), @ManagementParameter(name="command"), @ManagementParameter(name="timoutInMilli")})
public List<List> executeQuery(final String vdbName, final int version, final String command, final long timoutInMilli) throws AdminException {
- Properties properties = new Properties();
- properties.setProperty(TeiidURL.JDBC.VDB_NAME, vdbName);
- properties.setProperty(TeiidURL.JDBC.VDB_VERSION, String.valueOf(version));
String user = "JOPR ADMIN"; //$NON-NLS-1$
LogManager.logDetail(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("admin_executing", user, command)); //$NON-NLS-1$
- SessionMetadata session = null;
- try {
- session = this.sessionService.createSession(user, null, "JOPR", properties, false, false); //$NON-NLS-1$
- } catch (SessionServiceException e1) {
- throw new AdminProcessingException(e1);
- } catch (LoginException e1) {
- throw new AdminProcessingException(e1);
- }
+ SessionMetadata session = createTemporarySession(vdbName, version, user);
final long requestID = 0L;
@@ -580,8 +572,12 @@
request.setExecutionId(0L);
request.setRowLimit(getMaxRowsFetchSize()); // this would limit the number of rows that are returned.
Future<ResultsMessage> message = dqpCore.executeRequest(requestID, request);
- ResultsMessage rm = message.get(timoutInMilli, TimeUnit.MILLISECONDS);
-
+ ResultsMessage rm = null;
+ if (timoutInMilli < 0) {
+ rm = message.get();
+ } else {
+ rm = message.get(timoutInMilli, TimeUnit.MILLISECONDS);
+ }
if (rm.getException() != null) {
throw new AdminProcessingException(rm.getException());
}
@@ -616,6 +612,23 @@
} catch (InvalidSessionException e) { //ignore
}
}
+ }
+
+ private SessionMetadata createTemporarySession(final String vdbName, final int version, final String user)
+ throws AdminProcessingException {
+ Properties properties = new Properties();
+ properties.setProperty(TeiidURL.JDBC.VDB_NAME, vdbName);
+ properties.setProperty(TeiidURL.JDBC.VDB_VERSION, String.valueOf(version));
+
+ SessionMetadata session = null;
+ try {
+ session = this.sessionService.createSession(user, null, "JOPR", properties, false, false); //$NON-NLS-1$
+ } catch (SessionServiceException e1) {
+ throw new AdminProcessingException(e1);
+ } catch (LoginException e1) {
+ throw new AdminProcessingException(e1);
+ }
+ return session;
}
/**
@@ -685,6 +698,54 @@
}
@Override
+ public void refreshMatView(final String vdbName, final int vdbVersion, final String viewName) {
+ final VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
+ if (vdb == null) {
+ return;
+ }
+ final TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
+ if (globalStore == null) {
+ return;
+ }
+
+ Runnable refreshWork = new Runnable() {
+ @Override
+ public void run() {
+ SessionMetadata session = null;
+ try {
+ session = createTemporarySession(vdbName, vdbVersion, "internal"); //$NON-NLS-1$
+
+ DQPWorkContext context = new DQPWorkContext();
+ context.setSession(session);
+ Runnable work = new Runnable() {
+ @Override
+ public void run() {
+ QueryMetadataInterface metadata = vdb.getAttachment(QueryMetadataInterface.class);
+ TempTableStore tempStore = new TempTableStore("internal"); //$NON-NLS-1$
+ TempMetadataAdapter tma = new TempMetadataAdapter(metadata, tempStore.getMetadataStore());
+ try {
+ dqpCore.getDataTierManager().refreshMatView(vdbName, vdbVersion, viewName, tma, globalStore);
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.getString("error_refresh", viewName )); //$NON-NLS-1$
+ }
+ }
+ };
+ context.runInContext(work);
+ } catch (AdminProcessingException e) {
+ LogManager.logError(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.getString("error_refresh", viewName )); //$NON-NLS-1$
+ } finally {
+ try {
+ sessionService.closeSession(session.getSessionId());
+ } catch (InvalidSessionException e) {
+ // ignore
+ }
+ }
+ }
+ };
+ this.dqpCore.addWork(refreshWork);
+ }
+
+ @Override
public void dataModification(String vdbName, int vdbVersion, String schema,
String... tableNames) {
updateModified(true, vdbName, vdbVersion, schema, tableNames);
Modified: branches/7.4.x/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- branches/7.4.x/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-07-27 21:13:25 UTC (rev 3344)
+++ branches/7.4.x/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-07-27 21:30:01 UTC (rev 3345)
@@ -48,3 +48,4 @@
admin_executing=JOPR admin {0} is executing command {1}
DQPCore.unable_to_process_event=Unable to process event.
+error_refresh=error occurred during refreshing the materialized view entries for view {0}
13 years, 5 months