teiid SVN: r4125 - in branches/7.7.x/client/src/main/java/org/teiid: jdbc and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-05-20 09:12:16 -0400 (Sun, 20 May 2012)
New Revision: 4125
Modified:
branches/7.7.x/client/src/main/java/org/teiid/client/SourceWarning.java
branches/7.7.x/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
Log:
TEIID-2054 fixing double reporting of initial warnings and also removing SourceWarning stacktrace
Modified: branches/7.7.x/client/src/main/java/org/teiid/client/SourceWarning.java
===================================================================
--- branches/7.7.x/client/src/main/java/org/teiid/client/SourceWarning.java 2012-05-20 13:11:32 UTC (rev 4124)
+++ branches/7.7.x/client/src/main/java/org/teiid/client/SourceWarning.java 2012-05-20 13:12:16 UTC (rev 4125)
@@ -34,6 +34,7 @@
public class SourceWarning extends TeiidException {
+ private static final StackTraceElement[] EMPTY_STACK_TRACE = new StackTraceElement[0];
private String modelName = "UNKNOWN"; // variable stores the name of the model for the atomic query //$NON-NLS-1$
private String connectorBindingName = "UNKNOWN"; // variable stores name of the connector binding //$NON-NLS-1$
private boolean partialResults;
@@ -53,6 +54,7 @@
this.connectorBindingName = connectorBinding;
}
this.partialResults = partialResults;
+ this.setStackTrace(EMPTY_STACK_TRACE);
}
/**
Modified: branches/7.7.x/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- branches/7.7.x/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2012-05-20 13:11:32 UTC (rev 4124)
+++ branches/7.7.x/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2012-05-20 13:12:16 UTC (rev 4125)
@@ -27,20 +27,7 @@
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.Date;
-import java.sql.NClob;
-import java.sql.Ref;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.RowId;
-import java.sql.SQLException;
-import java.sql.SQLWarning;
-import java.sql.SQLXML;
-import java.sql.Time;
-import java.sql.Timestamp;
+import java.sql.*;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@@ -131,7 +118,6 @@
this.requestID = statement.getCurrentRequestID();
this.cursorType = statement.getResultSetType();
this.batchResults = new BatchResults(this, getCurrentBatch(resultsMsg), this.cursorType == ResultSet.TYPE_FORWARD_ONLY ? 1 : BatchResults.DEFAULT_SAVED_BATCHES);
- accumulateWarnings(resultsMsg);
this.serverTimeZone = statement.getServerTimeZone();
if (metadata == null) {
MetadataProvider provider = new DeferredMetadataProvider(resultsMsg.getColumnNames(),
12 years, 7 months
teiid SVN: r4124 - trunk/client/src/main/java/org/teiid/client.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-05-20 09:11:32 -0400 (Sun, 20 May 2012)
New Revision: 4124
Modified:
trunk/client/src/main/java/org/teiid/client/SourceWarning.java
Log:
TEIID-2054 also removing SourceWarning stacktrace
Modified: trunk/client/src/main/java/org/teiid/client/SourceWarning.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/SourceWarning.java 2012-05-18 16:54:05 UTC (rev 4123)
+++ trunk/client/src/main/java/org/teiid/client/SourceWarning.java 2012-05-20 13:11:32 UTC (rev 4124)
@@ -34,6 +34,7 @@
public class SourceWarning extends TeiidException {
+ private static final StackTraceElement[] EMPTY_STACK_TRACE = new StackTraceElement[0];
private String modelName = "UNKNOWN"; // variable stores the name of the model for the atomic query //$NON-NLS-1$
private String connectorBindingName = "UNKNOWN"; // variable stores name of the connector binding //$NON-NLS-1$
private boolean partialResults;
@@ -53,6 +54,7 @@
this.connectorBindingName = connectorBinding;
}
this.partialResults = partialResults;
+ setStackTrace(EMPTY_STACK_TRACE);
}
/**
12 years, 7 months
teiid SVN: r4123 - branches/7.7.x.
by teiid-commits@lists.jboss.org
Author: van.halbert
Date: 2012-05-18 12:54:05 -0400 (Fri, 18 May 2012)
New Revision: 4123
Modified:
branches/7.7.x/pom.xml
Log:
Changing it back to 3.2.3 based on productization deciding not to use 3.2.5
Modified: branches/7.7.x/pom.xml
===================================================================
--- branches/7.7.x/pom.xml 2012-05-18 15:45:14 UTC (rev 4122)
+++ branches/7.7.x/pom.xml 2012-05-18 16:54:05 UTC (rev 4123)
@@ -463,7 +463,7 @@
<dependency>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
- <version>3.2.5.Final</version>
+ <version>3.2.3.Final</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
12 years, 7 months
teiid SVN: r4122 - branches/7.7.x.
by teiid-commits@lists.jboss.org
Author: van.halbert
Date: 2012-05-18 11:45:14 -0400 (Fri, 18 May 2012)
New Revision: 4122
Modified:
branches/7.7.x/pom.xml
Log:
Moving to netty 3.2.5 due to EAP/HornetQ making this necessary for SOA 5.3
Modified: branches/7.7.x/pom.xml
===================================================================
--- branches/7.7.x/pom.xml 2012-05-18 03:28:02 UTC (rev 4121)
+++ branches/7.7.x/pom.xml 2012-05-18 15:45:14 UTC (rev 4122)
@@ -463,7 +463,7 @@
<dependency>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
- <version>3.2.1.Final</version>
+ <version>3.2.5.Final</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
12 years, 7 months
teiid SVN: r4121 - in trunk/client/src: main/java/org/teiid/jdbc and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-05-17 23:28:02 -0400 (Thu, 17 May 2012)
New Revision: 4121
Modified:
trunk/client/src/main/java/org/teiid/client/ResultsMessage.java
trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java
trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java
Log:
TEIID-2054 fixing initial warnings
Modified: trunk/client/src/main/java/org/teiid/client/ResultsMessage.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/ResultsMessage.java 2012-05-17 18:21:28 UTC (rev 4120)
+++ trunk/client/src/main/java/org/teiid/client/ResultsMessage.java 2012-05-18 03:28:02 UTC (rev 4121)
@@ -158,7 +158,7 @@
/**
* @return
*/
- public List getWarnings() {
+ public List<Throwable> getWarnings() {
return warnings;
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2012-05-17 18:21:28 UTC (rev 4120)
+++ trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2012-05-18 03:28:02 UTC (rev 4121)
@@ -119,7 +119,6 @@
this.requestID = statement.getCurrentRequestID();
this.cursorType = statement.getResultSetType();
this.batchResults = new BatchResults(this, getCurrentBatch(resultsMsg), this.cursorType == ResultSet.TYPE_FORWARD_ONLY ? 1 : BatchResults.DEFAULT_SAVED_BATCHES);
- accumulateWarnings(resultsMsg);
this.serverTimeZone = statement.getServerTimeZone();
if (metadata == null) {
MetadataProvider provider = new DeferredMetadataProvider(resultsMsg.getColumnNames(),
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2012-05-17 18:21:28 UTC (rev 4120)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2012-05-18 03:28:02 UTC (rev 4121)
@@ -134,7 +134,7 @@
// resultSet object produced by execute methods on the statement.
protected volatile ResultSetImpl resultSet;
- private List<Exception> serverWarnings;
+ private List<Throwable> serverWarnings;
// the per-execution security payload
private Serializable payload;
@@ -783,12 +783,12 @@
return this.updateCounts[0];
}
- protected void accumulateWarnings(List<Exception> serverWarnings) {
+ protected void accumulateWarnings(List<Throwable> serverWarnings) {
if (serverWarnings == null || serverWarnings.isEmpty()) {
return;
}
if (this.serverWarnings == null) {
- this.serverWarnings = new ArrayList<Exception>();
+ this.serverWarnings = new ArrayList<Throwable>();
}
this.serverWarnings.addAll(serverWarnings);
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java 2012-05-17 18:21:28 UTC (rev 4120)
+++ trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java 2012-05-18 03:28:02 UTC (rev 4121)
@@ -70,13 +70,13 @@
* @param exceptions List of exceptions from server
* @return Chain of SQLWarning corresponding to list of exceptions
*/
- static SQLWarning convertWarnings(List<Exception> exceptions) {
+ static SQLWarning convertWarnings(List<Throwable> exceptions) {
if(exceptions == null || exceptions.size() == 0) {
return null;
}
SQLWarning warning = null;
- for (Exception ex : exceptions) {
+ for (Throwable ex : exceptions) {
SQLWarning newWarning = createWarning(ex);
if(warning == null) {
warning = newWarning;
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java 2012-05-17 18:21:28 UTC (rev 4120)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java 2012-05-18 03:28:02 UTC (rev 4121)
@@ -25,6 +25,7 @@
import static org.junit.Assert.*;
import java.sql.ResultSet;
+import java.sql.SQLWarning;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
@@ -59,6 +60,30 @@
assertTrue(Arrays.equals(new int[] {1, 2}, statement.executeBatch()));
}
+ @Test public void testWarnings() throws Exception {
+ ConnectionImpl conn = Mockito.mock(ConnectionImpl.class);
+ DQP dqp = Mockito.mock(DQP.class);
+ ResultsFuture<ResultsMessage> results = new ResultsFuture<ResultsMessage>();
+ Mockito.stub(dqp.executeRequest(Mockito.anyLong(), (RequestMessage)Mockito.anyObject())).toReturn(results);
+ ResultsMessage rm = new ResultsMessage();
+ rm.setResults(new List<?>[] {Arrays.asList(1)});
+ rm.setWarnings(Arrays.asList(new Throwable()));
+ rm.setColumnNames(new String[] {"expr1"});
+ rm.setDataTypes(new String[] {"string"});
+ results.getResultsReceiver().receiveResults(rm);
+ Mockito.stub(conn.getDQP()).toReturn(dqp);
+ StatementImpl statement = new StatementImpl(conn, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY) {
+ protected java.util.TimeZone getServerTimeZone() throws java.sql.SQLException {
+ return null;
+ }
+ };
+ statement.execute("select 'a'");
+ assertNotNull(statement.getResultSet());
+ SQLWarning warning = statement.getWarnings();
+ assertNotNull(warning);
+ assertNull(warning.getNextWarning());
+ }
+
@Test public void testSetStatement() throws Exception {
ConnectionImpl conn = Mockito.mock(ConnectionImpl.class);
Properties p = new Properties();
12 years, 7 months
teiid SVN: r4120 - in trunk: api/src/test/java/org/teiid and 13 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-05-17 14:21:28 -0400 (Thu, 17 May 2012)
New Revision: 4120
Removed:
trunk/api/src/test/java/org/teiid/metadata/
Modified:
trunk/api/src/main/java/org/teiid/metadata/FunctionMethod.java
trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java
trunk/api/src/main/java/org/teiid/metadata/Schema.java
trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html
trunk/engine/src/main/java/org/teiid/query/metadata/NativeMetadataRepository.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
trunk/engine/src/main/java/org/teiid/query/parser/QueryParser.java
trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java
trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/query/metadata/TestMetadataValidator.java
trunk/engine/src/test/java/org/teiid/query/parser/TestDDLParser.java
trunk/engine/src/test/java/org/teiid/query/processor/TestFunctionPushdown.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataRepository.java
trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestDynamicImportedMetaData.java
Log:
TEIID-2053 fix for metadata issues
Modified: trunk/api/src/main/java/org/teiid/metadata/FunctionMethod.java
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/FunctionMethod.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/api/src/main/java/org/teiid/metadata/FunctionMethod.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -147,31 +147,6 @@
}
/**
- * Return name of method
- * @return Name
- */
- public String getName() {
- return super.getName();
- }
-
- /**
- * Set name of method
- * @param name Name
- */
- public void setName(String name) {
- super.setName(name);
- }
-
- @Override
- public String getFullName() {
- if (this.category != null) {
- return this.category + NAME_DELIM_CHAR + getName();
- }
- return getName();
- }
-
-
- /**
* Get description of method
* @return Description
*/
Modified: trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -24,7 +24,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -43,7 +42,7 @@
* TODO: add support for datatype import
* TODO: add support for unique constraints
*/
-public class MetadataFactory extends Schema {
+public class MetadataFactory {
private static final long serialVersionUID = 8590341087771685630L;
private String vdbName;
@@ -53,13 +52,14 @@
private Map<String, String> namespaces = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
private String rawMetadata;
private Properties importProperties;
+ private Schema schema = new Schema();
public MetadataFactory(String vdbName, int vdbVersion, String schemaName, Map<String, Datatype> dataTypes, Properties importProperties, String rawMetadata) {
this.vdbName = vdbName;
this.vdbVersion = vdbVersion;
this.dataTypes = dataTypes;
- setName(schemaName);
- setUUID(this);
+ schema.setName(schemaName);
+ setUUID(schema);
this.importProperties = importProperties;
this.rawMetadata = rawMetadata;
}
@@ -75,6 +75,14 @@
protected void setUUID(AbstractMetadataRecord record) {
record.setUUID("mmuuid:" +UUID.randomUUID()); //$NON-NLS-1$
}
+
+ public String getName() {
+ return this.schema.getName();
+ }
+
+ public Schema getSchema() {
+ return this.schema;
+ }
/**
* Add a table with the given name to the model.
@@ -87,7 +95,7 @@
table.setTableType(Table.Type.Table);
table.setName(name);
setUUID(table);
- addTable(table);
+ schema.addTable(table);
return table;
}
@@ -246,7 +254,7 @@
procedure.setName(name);
setUUID(procedure);
procedure.setParameters(new LinkedList<ProcedureParameter>());
- addProcedure(procedure);
+ schema.addProcedure(procedure);
return procedure;
}
@@ -317,7 +325,7 @@
FunctionMethod function = new FunctionMethod();
function.setName(name);
setUUID(function);
- addFunction(function);
+ schema.addFunction(function);
return function;
}
@@ -334,7 +342,7 @@
}
public void mergeInto (MetadataStore store) {
- store.addSchema(this);
+ store.addSchema(this.schema);
store.addDataTypes(this.dataTypes.values());
store.addNamespaces(this.namespaces);
}
@@ -344,25 +352,9 @@
mergeInto(store);
return store;
}
-
- public void mergeFrom(Schema schema) {
- setName(schema.getName());
- setUUID(schema.getUUID());
- setPhysical(schema.isPhysical());
- setProperties(schema.getProperties());
- setVisible(schema.isVisible());
- setAnnotation(schema.getAnnotation());
-
- for (Table t:schema.getTables().values()) {
- addTable(t);
- }
- for (Procedure p: schema.getProcedures().values()) {
- addProcedure(p);
- }
- for (FunctionMethod fm:schema.getFunctions().values()) {
- addFunction(fm);
- }
- setProperties(new LinkedHashMap<String, String>(schema.getProperties()));
+
+ public void setSchema(Schema schema) {
+ this.schema = schema;
}
public Map<String, Datatype> getDataTypes() {
Modified: trunk/api/src/main/java/org/teiid/metadata/Schema.java
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/Schema.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/api/src/main/java/org/teiid/metadata/Schema.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -33,7 +33,6 @@
private static final long serialVersionUID = -5113742472848113008L;
private boolean physical = true;
- private boolean isVisible = true;
private String primaryMetamodelUri = "http://www.metamatrix.com/metamodels/Relational"; //$NON-NLS-1$
private Map<String, Table> tables = new TreeMap<String, Table>(String.CASE_INSENSITIVE_ORDER);
@@ -107,10 +106,6 @@
return primaryMetamodelUri;
}
- public boolean isVisible() {
- return isVisible;
- }
-
public boolean isPhysical() {
return physical;
}
@@ -122,13 +117,6 @@
primaryMetamodelUri = string;
}
- /**
- * @param b
- */
- public void setVisible(boolean b) {
- isVisible = b;
- }
-
public void setPhysical(boolean physical) {
this.physical = physical;
}
Modified: trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html 2012-05-17 18:21:28 UTC (rev 4120)
@@ -10,7 +10,7 @@
<P><A HREF="http://www.teiid.org/"><IMG SRC="https://www.jboss.org/dms/teiid/images/teiid-banner.png" NAME="graphics1" ALT="Teiid" ALIGN=BOTTOM WIDTH=800></A>
<H1>Teiid ${project.version} Release Notes</H1>
-<P>Teiid ${project.version} is the first Teiid release compatible with JBoss AS 7.x.
+<P>Teiid ${project.version} adds metadata and integration features.
<H2>Overview</H2>
<UL>
@@ -26,30 +26,6 @@
</UL>
<H2><A NAME="Highlights"></A>Highlights</H2>
<UL>
- <LI><B>DDL Based View Definitions</B> - Define virtual tables, procedures and functions for Dynamic VDBs using DDL.
- <LI><B>MetadataRepository</B> - Pluggable metadata facility for any VDB and models inside it.
- <LI><B>CallableStatement Named Parameters</B> - you can now use CallableStatement named parameter get/set methods.
- <LI><B>New Translator capabilities</B>
- <UL>
- <LI>translators may indicate which convert functions they support
- <LI>restrict non-join comparisons to only literals.
- <LI>return ReusableExecution instances for processing nodes that issue multiple queries.
- <LI>translators may indicate support for dependent join handling
- </UL>
- <LI><B>Continuous Asynch Queries</B> to process plans in a streamed window fashion the TeiidStatement/TeiidPreparedStatement methods now take a RequestOptions object to specify continuous mode. See the Client and Developers Guides for more.
- <LI><B>Texttable selectors</B> - can be used to selectively parse only record lines matching a given selector string. Selectors may also be used for column values to join data from other records positionally.
- <LI><B>Enhanced Comparison Support</B> - see the Admin Guide more.
- <UL>
- <LI><B>Comparable LOBs</B> - the system property org.teiid.comparableLobs can be set to use CLOB and BLOB values in comparison/sorting/grouping operations.
- <LI><B>Padded Comparison</B> - the system property org.teiid.padSpace can be set to effectively right pad strings to the same length for comparison.
- <LI><B>Collation Support</B> - the system property org.teiid.collationLocale can be set to use a different collation than the Java UTF-16 default.
- </UL>
- <LI><B>VARBINARY type support</B> - the Teiid VARBINARY type can now be used to support source BINARY and VARBINARY types.
- <LI><B>Greenplum Translator</B> - for use with the Greenplum database.
- <LI><B>Enhanced parse/format pushdown</B> - added more built-in support and extension points for parse/format function pushdown. Added parse/format timestamp handling for SQLServer, Sybase, Oracle, and PostgreSQL.
- <LI><B>User Defined Aggregates</B> - user defined aggregate functions can be defined via extension metadata, DDL, or connector metadata.
- <LI><B>SET PAYLOAD statement</B> - SET PAYLOAD can be used to set a name value pair on a session scoped payload that will be sent with requests.
- <LI><B>ENCRYPT REQUESTS</B> - encryptRequests may be used as a connection/datasource property when not using SSL to indicate that request messgaes and any associated payload should be encrypted.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
@@ -62,7 +38,11 @@
<h4>from 8.0</h4>
<ul>
- <li>org.teiid.metadata.Schema holds FunctionMethods by uuid rather than name to accommodate overriden method signatures.
+ <li>org.teiid.metadata.Schema holds FunctionMethods by uuid rather than name to accommodate overridden method signatures.
+ <li>MetadataFactory no longer extends Schema. Use the MetadataFactory.getSchema method to get the target Schema.
+ <li>DDL created VIRTUAL pushdown functions should be referenced in the ExecutionFactory.getSupportedFunctions by their full <schema>.<function> name.
+ <li>DDL functions/procedures defined without the VIRTUAL keyword are by default VIRTUAL. Use the FOREIGN keyword to indicate that they are source specific.
+ <li>FunctionMethod.getFullName returns the proper schema, not category quailified name.
<ul>
<h4>from 7.x</h4>
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/NativeMetadataRepository.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/NativeMetadataRepository.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/NativeMetadataRepository.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -24,6 +24,7 @@
import javax.resource.ResourceException;
import org.teiid.metadata.MetadataFactory;
+import org.teiid.metadata.Schema;
import org.teiid.metadata.Table;
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.metadata.FunctionMetadataValidator;
@@ -62,12 +63,12 @@
} finally {
executionFactory.closeConnection(connection, connectionFactory);
}
- validateMetadata(factory);
+ validateMetadata(factory.getSchema());
super.loadMetadata(factory, executionFactory, connectionFactory);
}
- private void validateMetadata(MetadataFactory schema) throws TranslatorException {
+ private void validateMetadata(Schema schema) throws TranslatorException {
for (Table t : schema.getTables().values()) {
if (t.getColumns() == null || t.getColumns().size() == 0) {
throw new TranslatorException(QueryPlugin.Event.TEIID30580, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30580, t.getFullName()));
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -230,9 +230,9 @@
//technically the other functions are scoped to SYS or their function model, but that's
//not formally part of their metadata yet
Schema schema = function.getFunctionDescriptor().getMethod().getParent();
- if (schema == null) {
+ if (schema == null || !schema.isPhysical()) {
// Find capabilities
- if (!caps.supportsFunction(function.getFunctionDescriptor().getName())) {
+ if (!caps.supportsFunction(function.getFunctionDescriptor().getMethod().getFullName())) {
return false;
}
if (FunctionLibrary.isConvert(function)) {
Modified: trunk/engine/src/main/java/org/teiid/query/parser/QueryParser.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/parser/QueryParser.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/engine/src/main/java/org/teiid/query/parser/QueryParser.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -351,7 +351,7 @@
public void parseDDL(MetadataFactory factory, String ddl) throws ParseException {
getSqlParser(ddl).parseMetadata(factory);
HashSet<FunctionMethod> functions = new HashSet<FunctionMethod>();
- for (FunctionMethod functionMethod : factory.getFunctions().values()) {
+ for (FunctionMethod functionMethod : factory.getSchema().getFunctions().values()) {
if (!functions.add(functionMethod)) {
throw new DuplicateRecordException(DataPlugin.Util.gs(DataPlugin.Event.TEIID60015, functionMethod.getName()));
}
Modified: trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -525,8 +525,8 @@
}
FunctionMethod.convertExtensionMetadata(proc, method);
- factory.addFunction(method);
- factory.getProcedures().remove(proc.getName());
+ factory.getSchema().addFunction(method);
+ factory.getSchema().getProcedures().remove(proc.getName());
}
void setProcedureOptions(Procedure proc) {
@@ -555,7 +555,7 @@
void createDDLTrigger(MetadataFactory schema, AlterTrigger trigger) {
GroupSymbol group = trigger.getTarget();
- Table table = schema.getTable(group.getName());
+ Table table = schema.getSchema().getTable(group.getName());
if (trigger.getEvent().equals(Table.TriggerEvent.INSERT)) {
table.setInsertPlan(trigger.getDefinition().toString());
}
Modified: trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2012-05-17 18:21:28 UTC (rev 4120)
@@ -4110,7 +4110,7 @@
*/
CreateProcedureCommand createDDLProcedure(MetadataFactory factory, ParseInfo info) :
{
- boolean virtual = false;
+ boolean virtual = true;
boolean function = false;
Procedure proc = null;
String procName = null;
@@ -4119,7 +4119,7 @@
ParsedDataType returnDataType = null;
}
{
- <CREATE> [<VIRTUAL> {virtual = true;}] (<PROCEDURE> | <FUNCTION> {function = true;})
+ <CREATE> [<VIRTUAL> | <FOREIGN> {virtual = false;}] (<PROCEDURE> | <FUNCTION> {function = true;})
//the below is optional beacuse to allow the designer based metadata
( procName = id()
{
@@ -4151,8 +4151,15 @@
proc.setQueryPlan("CREATE VIRTUAL PROCEDURE "+asBlock(stmt).toString());
}
- if (virtual && !function && stmt == null){
- throw new ParseException(QueryPlugin.Util.getString("SQLParser.virtual_proc_def", procName));
+ if (!function) {
+ if (virtual && stmt == null){
+ throw new ParseException(QueryPlugin.Util.getString("SQLParser.virtual_proc_def", procName));
+ }
+ if (!virtual && stmt != null){
+ throw new ParseException(QueryPlugin.Util.getString("SQLParser.foreign_proc_def", procName));
+ }
+ } else if (stmt != null) {
+ throw new ParseException(QueryPlugin.Util.getString("SQLParser.function_def", procName));
}
if (returnDataType != null){
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2012-05-17 18:21:28 UTC (rev 4120)
@@ -268,7 +268,9 @@
SQLParser.Invalid_char={0} value must be a single character: [{1}].
SQLParser.expected_non_reserved=Expected non-reserved word {0}, but was {1}.
SQLParser.invalid_window=Cannot window a non-aggregate expression {0}.
-SQLParser.virtual_proc_def=Virtual procedure {0} must define the procedure block after ''AS'' keyword
+SQLParser.virtual_proc_def=Virtual procedure {0} must define the procedure after an ''AS'' keyword.
+SQLParser.foreign_proc_def=Foreign procedure {0} must not define a procedure body.
+SQLParser.function_def=Function {0} must not define a function body.
SQLParser.view_def=Virtual view {0} must be defined with a query expression.
SQLParser.pk_exists=Primary Key is already defined on {0}
SQLParser.no_column=Column name {0} not found on table {1}
Modified: trunk/engine/src/test/java/org/teiid/query/metadata/TestMetadataValidator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/metadata/TestMetadataValidator.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/engine/src/test/java/org/teiid/query/metadata/TestMetadataValidator.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -64,7 +64,7 @@
DDLMetadataRepository repo = new DDLMetadataRepository();
MetadataFactory mf = new MetadataFactory("myVDB",1, modelName, TestDDLParser.getDataTypes(), new Properties(), ddl);
- mf.setPhysical(physical);
+ mf.getSchema().setPhysical(physical);
repo.loadMetadata(mf, null, null);
mf.mergeInto(store);
return model;
@@ -276,7 +276,7 @@
vdb.addModel(model);
MetadataFactory mf = new MetadataFactory("myVDB",1, "xmlstuff", TestDDLParser.getDataTypes(), new Properties(), null);
- mf.setPhysical(false);
+ mf.getSchema().setPhysical(false);
Table t = mf.addTable("xmldoctable");
t.setTableType(Table.Type.Document);
Modified: trunk/engine/src/test/java/org/teiid/query/parser/TestDDLParser.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestDDLParser.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestDDLParser.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -34,8 +34,8 @@
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.ObjectConverterUtil;
+import org.teiid.metadata.*;
import org.teiid.metadata.BaseColumn.NullType;
-import org.teiid.metadata.*;
import org.teiid.query.metadata.MetadataValidator;
import org.teiid.query.validator.ValidatorReport;
@@ -57,7 +57,7 @@
"e6 varchar index default 'hello')\n" +
"OPTIONS (CARDINALITY 12, UUID 'uuid2', UPDATABLE 'true', FOO 'BAR', ANNOTATION 'Test Table')";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
assertTrue("Table not found", tableMap.containsKey("G1"));
@@ -133,7 +133,7 @@
public void testMultiKeyPK() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1( e1 integer, e2 varchar, e3 date CONSTRAINT PRIMARY KEY (e1, e2))";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
assertTrue("Table not found", tableMap.containsKey("G1"));
@@ -145,7 +145,7 @@
@Test
public void testOptionsKey() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1( e1 integer, e2 varchar, e3 date CONSTRAINT UNIQUE (e1) OPTIONS (CUSTOM_PROP 'VALUE'))";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
assertTrue("Table not found", tableMap.containsKey("G1"));
@@ -160,7 +160,7 @@
" CONSTRAINT PRIMARY KEY (e1, e2), INDEX(e2, e3), ACCESSPATTERN(e1), UNIQUE(e1)," +
" ACCESSPATTERN(e2, e3))";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
assertTrue("Table not found", tableMap.containsKey("G1"));
@@ -179,7 +179,7 @@
String ddl = "CREATE FOREIGN TABLE G1( e1 integer, e2 varchar, e3 date CONSTRAINT " +
"ACCESSPATTERN(e1), UNIQUE(e1), ACCESSPATTERN(e2, e3))";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
assertTrue("Table not found", tableMap.containsKey("G1"));
@@ -191,19 +191,14 @@
assertEquals(table.getColumns().subList(1, 3), table.getAccessPatterns().get(1).getColumns());
}
- @Test
+ @Test(expected=ParseException.class)
public void testWrongPrimarykey() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1( e1 integer, e2 varchar, PRIMARY KEY (e3))";
- try {
- MetadataStore mds = new MetadataStore();
- MetadataFactory mf = new MetadataFactory(null, 1, "model", getDataTypes(), new Properties(), null);
- parser.parseDDL(mf, ddl);
- mf.mergeInto(mds);
- fail("should fail to find e3 as the column");
- } catch(ParseException e) {
-
- }
+ MetadataStore mds = new MetadataStore();
+ MetadataFactory mf = new MetadataFactory(null, 1, "model", getDataTypes(), new Properties(), null);
+ parser.parseDDL(mf, ddl);
+ mf.mergeInto(mds);
}
@Test
@@ -212,7 +207,7 @@
"CREATE FOREIGN TABLE G2( g2e1 integer, g2e2 varchar CONSTRAINT " +
"FOREIGN KEY (g2e1, g2e2) REFERENCES G1 (g1e1, g1e2))";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
assertEquals(2, tableMap.size());
@@ -232,7 +227,7 @@
"FOREIGN KEY (g2e1, g2e2) REFERENCES G1)";
MetadataFactory s = helpParse(ddl, "model");
- Map<String, Table> tableMap = s.getTables();
+ Map<String, Table> tableMap = s.getSchema().getTables();
assertEquals(2, tableMap.size());
assertTrue("Table not found", tableMap.containsKey("G1"));
@@ -263,7 +258,7 @@
"FOREIGN KEY (g2e1, g2e2) REFERENCES G1)";
MetadataFactory s = helpParse(ddl, "model");
- Map<String, Table> tableMap = s.getTables();
+ Map<String, Table> tableMap = s.getSchema().getTables();
assertEquals(2, tableMap.size());
assertTrue("Table not found", tableMap.containsKey("G1"));
@@ -336,14 +331,10 @@
@Test
public void testViewWithoutColumns() throws Exception {
- try {
- MetadataStore mds = new MetadataStore();
- MetadataFactory mf = new MetadataFactory(null, 1, "VM1", getDataTypes(), new Properties(), null);
- parser.parseDDL(mf,"CREATE VIEW V1 AS SELECT * FROM PM1.G1");
- mf.mergeInto(mds);
- } catch(ParseException e) {
- fail(e.getMessage());
- }
+ MetadataStore mds = new MetadataStore();
+ MetadataFactory mf = new MetadataFactory(null, 1, "VM1", getDataTypes(), new Properties(), null);
+ parser.parseDDL(mf,"CREATE VIEW V1 AS SELECT * FROM PM1.G1");
+ mf.mergeInto(mds);
}
@Test
@@ -351,7 +342,7 @@
String ddl = "CREATE VIEW V1 AS SELECT * FROM PM1.G1 " +
"CREATE PROCEDURE FOO(P1 integer) RETURNS (e1 integer, e2 varchar) AS SELECT * FROM PM1.G1;";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
Table table = tableMap.get("V1");
assertNotNull(table);
@@ -379,7 +370,7 @@
" text string PATH 'text') tweet;" +
" CREATE VIEW Tweet AS select * FROM twitterview.getTweets;";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
Table table = tableMap.get("Tweet");
assertNotNull(table);
@@ -394,7 +385,7 @@
public void testView() throws Exception {
String ddl = "CREATE View G1( e1 integer, e2 varchar) OPTIONS (CARDINALITY 12) AS select e1, e2 from foo.bar";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
Table table = tableMap.get("G1");
@@ -405,9 +396,9 @@
@Test
public void testPushdownFunctionNoArgs() throws Exception {
- String ddl = "CREATE FUNCTION SourceFunc() RETURNS integer OPTIONS (UUID 'hello world')";
+ String ddl = "CREATE FOREIGN FUNCTION SourceFunc() RETURNS integer OPTIONS (UUID 'hello world')";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
FunctionMethod fm = s.getFunction("hello world");
assertNotNull(fm);
@@ -439,7 +430,7 @@
"OPTIONS(CATEGORY 'misc', DETERMINISM 'DETERMINISTIC', " +
"\"NULL-ON-NULL\" 'true', JAVA_CLASS 'foo', JAVA_METHOD 'bar', RANDOM 'any', UUID 'x')";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
FunctionMethod fm = s.getFunction("x");
assertNotNull(fm);
@@ -465,7 +456,7 @@
String ddl = "CREATE VIRTUAL FUNCTION SourceFunc(flag boolean, msg varchar) RETURNS varchar " +
"OPTIONS(CATEGORY 'misc', AGGREGATE 'true', \"allows-distinct\" 'true', UUID 'y')";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
FunctionMethod fm = s.getFunction("y");
assertNotNull(fm);
@@ -488,12 +479,30 @@
public void testVarArgs() throws Exception {
String ddl = "CREATE FUNCTION SourceFunc(flag boolean) RETURNS varchar options (varargs 'true', UUID 'z')";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
FunctionMethod fm = s.getFunction("z");
assertTrue( fm.getInputParameters().get(0).isVarArg());
}
+ @Test(expected=ParseException.class) public void testInvalidFunctionBody() throws Exception {
+ String ddl = "CREATE FUNCTION SourceFunc(flag boolean) RETURNS varchar AS SELECT 'a';";
+
+ Schema s = helpParse(ddl, "model").getSchema();
+
+ FunctionMethod fm = s.getFunction("z");
+ assertTrue( fm.getInputParameters().get(0).isVarArg());
+ }
+
+ @Test(expected=ParseException.class) public void testInvalidProcedurenBody() throws Exception {
+ String ddl = "CREATE FOREIGN PROCEDURE SourceFunc(flag boolean) RETURNS varchar AS SELECT 'a';";
+
+ Schema s = helpParse(ddl, "model").getSchema();
+
+ FunctionMethod fm = s.getFunction("z");
+ assertTrue( fm.getInputParameters().get(0).isVarArg());
+ }
+
@Test
public void testVirtualProcedure() throws Exception {
String ddl = "CREATE VIRTUAL PROCEDURE myProc(OUT p1 boolean, p2 varchar, INOUT p3 decimal) " +
@@ -501,7 +510,7 @@
"OPTIONS(RANDOM 'any', UUID 'uuid', NAMEINSOURCE 'nis', ANNOTATION 'desc', UPDATECOUNT '2') " +
"AS BEGIN select * from foo; END";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Procedure proc = s.getProcedure("myProc");
assertNotNull(proc);
@@ -550,7 +559,7 @@
"END;" +
"CREATE View G2( e1 integer, e2 varchar) AS select * from foo;";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
assertTrue("Table not found", tableMap.containsKey("G1"));
@@ -560,11 +569,11 @@
@Test
public void testSourceProcedure() throws Exception {
- String ddl = "CREATE PROCEDURE myProc(OUT p1 boolean, p2 varchar, INOUT p3 decimal) " +
+ String ddl = "CREATE FOREIGN PROCEDURE myProc(OUT p1 boolean, p2 varchar, INOUT p3 decimal) " +
"RETURNS (r1 varchar, r2 decimal)" +
"OPTIONS(RANDOM 'any', UUID 'uuid', NAMEINSOURCE 'nis', ANNOTATION 'desc', UPDATECOUNT '2');";
- Schema s = helpParse(ddl, "model");
+ Schema s = helpParse(ddl, "model").getSchema();
Procedure proc = s.getProcedure("myProc");
assertNotNull(proc);
@@ -613,9 +622,9 @@
assertEquals("http://teiid.org", mds.getNamespaces().get("teiid"));
}
- private MetadataFactory helpParse(String ddl, String model) throws ParseException {
+ public static MetadataFactory helpParse(String ddl, String model) throws ParseException {
MetadataFactory mf = new MetadataFactory(null, 1, model, getDataTypes(), new Properties(), null);
- parser.parseDDL(mf, ddl);
+ QueryParser.getQueryParser().parseDDL(mf, ddl);
return mf;
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestFunctionPushdown.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestFunctionPushdown.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestFunctionPushdown.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -28,6 +28,8 @@
import java.util.List;
import org.junit.Test;
+import org.teiid.metadata.MetadataFactory;
+import org.teiid.metadata.MetadataStore;
import org.teiid.query.function.FunctionTree;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.FakeFunctionMetadataSource;
@@ -35,6 +37,7 @@
import org.teiid.query.optimizer.TestOptimizer.ComparisonMode;
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
+import org.teiid.query.parser.TestDDLParser;
import org.teiid.query.unittest.RealMetadataFactory;
@SuppressWarnings({"nls", "unchecked"})
@@ -111,4 +114,35 @@
new String[] {}, ComparisonMode.FAILED_PLANNING); //$NON-NLS-1$
}
+ @Test public void testDDLMetadata() throws Exception {
+ String ddl = "CREATE VIRTUAL FUNCTION SourceFunc(msg varchar) RETURNS varchar " +
+ "OPTIONS(CATEGORY 'misc', DETERMINISM 'DETERMINISTIC', " +
+ "\"NULL-ON-NULL\" 'true', JAVA_CLASS '"+TestFunctionPushdown.class.getName()+"', JAVA_METHOD 'sourceFunc');" +
+ "CREATE VIEW X (Y varchar) as SELECT e1 from pm1.g1;";
+
+ MetadataFactory mf = TestDDLParser.helpParse(ddl, "model");
+ mf.getSchema().setPhysical(false);
+ MetadataStore ms = mf.asMetadataStore();
+ ms.merge(RealMetadataFactory.example1Cached().getMetadataStore());
+
+ QueryMetadataInterface metadata = RealMetadataFactory.createTransformationMetadata(ms, "example1");
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setFunctionSupport("model.SourceFunc", true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ helpPlan("select sourceFunc(y) from x", metadata, null, capFinder,
+ new String[] {"SELECT sourceFunc(g_0.e1) FROM pm1.g1 AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+
+ caps.setFunctionSupport("model.SourceFunc", false);
+
+ helpPlan("select sourceFunc(y) from x", metadata, null, capFinder,
+ new String[] {"SELECT g_0.e1 FROM pm1.g1 AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ }
+
+ public static String sourceFunc(String msg) {
+ return msg;
+ }
+
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -315,8 +315,7 @@
// designer based models define data types based on their built in data types, which are system vdb data types
Map<String, Datatype> datatypes = indexStore?getVDBRepository().getSystemStore().getDatatypes():getVDBRepository().getBuiltinDatatypes();
factory = new MetadataFactory(vdb.getName(), vdb.getVersion(), model.getName(), datatypes, model.getProperties(), model.getSchemaText());
- factory.setPhysical(model.isSource());
- factory.setVisible(model.isVisible());
+ factory.getSchema().setPhysical(model.isSource());
ExecutionFactory ef = null;
Object cf = null;
Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataRepository.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataRepository.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataRepository.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -44,7 +44,7 @@
if (this.idxStore.getSchema(factory.getName()) == null) {
throw new TranslatorException(RuntimeMetadataPlugin.Util.gs(RuntimeMetadataPlugin.Event.TEIID80004, factory.getName()));
}
- factory.mergeFrom(this.idxStore.getSchema(factory.getName()));
+ factory.setSchema(this.idxStore.getSchema(factory.getName()));
} catch (IOException e) {
throw new TranslatorException(e);
}
Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -315,8 +315,7 @@
model.setPrimaryMetamodelUri(getObjectValue(tokens.get(tokenIndex++)));
// The next token are the supports flags
- char[] supportFlags = (tokens.get(tokenIndex++)).toCharArray();
- model.setVisible(getBooleanValue(supportFlags[0]));
+ tokens.get(tokenIndex++);
// The next tokens are footer values - the footer will contain the version number for the index record
setRecordFooterValues(model, tokens, tokenIndex);
Modified: trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -537,7 +537,7 @@
}
FunctionMethod func = FunctionMethod.createFunctionMethod(name, name, "pg", returnType, paramTypes); //$NON-NLS-1$
setUUID(func);
- addFunction(func);
+ getSchema().addFunction(func);
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
func.setInvocationMethod(javaFunction);
func.setPushdown(PushDown.CANNOT_PUSHDOWN);
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestDynamicImportedMetaData.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestDynamicImportedMetaData.java 2012-05-17 14:30:37 UTC (rev 4119)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestDynamicImportedMetaData.java 2012-05-17 18:21:28 UTC (rev 4120)
@@ -167,7 +167,7 @@
@Test
public void testDDLMetadata() throws Exception {
- String ddl = "CREATE PROCEDURE getTextFiles(IN pathAndPattern varchar) RETURNS (file clob, filpath string) OPTIONS(UUID 'uuid')";
+ String ddl = "CREATE FOREIGN PROCEDURE getTextFiles(IN pathAndPattern varchar) RETURNS (file clob, filpath string) OPTIONS(UUID 'uuid')";
MetadataFactory mf = createMetadataFactory("MarketData", new Properties());
QueryParser.getQueryParser().parseDDL(mf, ddl);
MetadataStore ms = mf.asMetadataStore();
12 years, 7 months
teiid SVN: r4119 - branches/7.7.x/api/src/main/java/org/teiid/translator.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-05-17 10:30:37 -0400 (Thu, 17 May 2012)
New Revision: 4119
Modified:
branches/7.7.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java
Log:
TEIID-2051 fixing the display text
Modified: branches/7.7.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- branches/7.7.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2012-05-17 14:16:49 UTC (rev 4118)
+++ branches/7.7.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2012-05-17 14:30:37 UTC (rev 4119)
@@ -731,11 +731,11 @@
}
/**
- * Get the integer value representing the number of values allowed in an IN criteria
- * in the WHERE clause of a query
- * @since 5.0
+ * Get the integer value representing the max number of dependent IN predicates.
+ * This may be used to split a single dependent value via OR, or multiple dependent values
+ * via AND.
*/
- @TranslatorProperty(display="Max number of dependent values across all IN predicates", advanced=true)
+ @TranslatorProperty(display="Max number of dependent IN predicates", advanced=true)
public int getMaxDependentInPredicates() {
return maxDependentInPredicates;
}
12 years, 7 months
teiid SVN: r4118 - trunk/api/src/main/java/org/teiid/translator.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-05-17 10:16:49 -0400 (Thu, 17 May 2012)
New Revision: 4118
Modified:
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
Log:
TEIID-2051 fixing the display text
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2012-05-16 21:19:08 UTC (rev 4117)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2012-05-17 14:16:49 UTC (rev 4118)
@@ -710,11 +710,11 @@
}
/**
- * Get the integer value representing the number of values allowed in an IN criteria
- * in the WHERE clause of a query
- * @since 5.0
+ * Get the integer value representing the max number of dependent IN predicates.
+ * This may be used to split a single dependent value via OR, or multiple dependent values
+ * via AND.
*/
- @TranslatorProperty(display="Max number of dependent values across all IN predicates", advanced=true)
+ @TranslatorProperty(display="Max number of dependent IN predicates", advanced=true)
public int getMaxDependentInPredicates() {
return maxDependentInPredicates;
}
12 years, 7 months