teiid SVN: r3978 - trunk/engine.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-04-05 14:56:28 -0400 (Thu, 05 Apr 2012)
New Revision: 3978
Modified:
trunk/engine/pom.xml
Log:
TEIID-1976: wrong check in
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2012-04-05 18:55:21 UTC (rev 3977)
+++ trunk/engine/pom.xml 2012-04-05 18:56:28 UTC (rev 3978)
@@ -33,11 +33,6 @@
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-common-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
<type>test-jar</type>
</dependency>
12 years, 8 months
teiid SVN: r3977 - in trunk: engine and 8 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-04-05 14:55:21 -0400 (Thu, 05 Apr 2012)
New Revision: 3977
Modified:
trunk/api/src/main/java/org/teiid/metadata/MetadataStore.java
trunk/engine/pom.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/query/metadata/MetadataValidator.java
trunk/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java
trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testDataTypes.expected
Log:
TEIID-1976: index stores need to use the data types defined by system store to match with uuid based look ups. The sub-selection data types defined in the teiid map correctly with designer data types in terms of runtime type, however they do not align with uuids or their names. This fixes the both issues.
Modified: trunk/api/src/main/java/org/teiid/metadata/MetadataStore.java
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/MetadataStore.java 2012-04-05 18:55:12 UTC (rev 3976)
+++ trunk/api/src/main/java/org/teiid/metadata/MetadataStore.java 2012-04-05 18:55:21 UTC (rev 3977)
@@ -25,7 +25,6 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@@ -40,7 +39,7 @@
private static final long serialVersionUID = -3130247626435324312L;
protected Map<String, Schema> schemas = new TreeMap<String, Schema>(String.CASE_INSENSITIVE_ORDER);
protected List<Schema> schemaList = new ArrayList<Schema>(); //used for a stable ordering
- protected Collection<Datatype> datatypes = new LinkedHashSet<Datatype>();
+ protected Map<String, Datatype> datatypes = new TreeMap<String, Datatype>();
protected Map<String, String> namespaces = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
public Map<String, Schema> getSchemas() {
@@ -67,18 +66,18 @@
}
void addDataTypes(Collection<Datatype> types) {
- this.datatypes.addAll(types);
+ if (types != null){
+ for (Datatype type:types) {
+ addDatatype(type);
+ }
+ }
}
public void addDatatype(Datatype datatype) {
- this.datatypes.add(datatype);
+ this.datatypes.put(datatype.getName(), datatype);
}
- /**
- * Get the datatypes defined in this store
- * @return
- */
- public Collection<Datatype> getDatatypes() {
+ public Map<String, Datatype> getDatatypes() {
return datatypes;
}
@@ -99,7 +98,7 @@
for (Schema s:store.getSchemaList()) {
addSchema(s);
}
- this.datatypes.addAll(store.getDatatypes());
+ addDataTypes(store.getDatatypes().values());
}
}
}
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2012-04-05 18:55:12 UTC (rev 3976)
+++ trunk/engine/pom.xml 2012-04-05 18:55:21 UTC (rev 3977)
@@ -33,6 +33,11 @@
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-common-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
<type>test-jar</type>
</dependency>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2012-04-05 18:55:12 UTC (rev 3976)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2012-04-05 18:55:21 UTC (rev 3977)
@@ -273,7 +273,7 @@
final SystemTables sysTable = SystemTables.valueOf(group.getNonCorrelationName().substring(CoreConstants.SYSTEM_MODEL.length() + 1).toUpperCase());
switch (sysTable) {
case DATATYPES:
- for (Datatype datatype : metadata.getDatatypes()) {
+ for (Datatype datatype : metadata.getDatatypes().values()) {
rows.add(Arrays.asList(datatype.getName(), datatype.isBuiltin(), datatype.isBuiltin(), datatype.getName(), datatype.getJavaClassName(), datatype.getScale(),
datatype.getLength(), datatype.getNullType().toString(), datatype.isSigned(), datatype.isAutoIncrement(), datatype.isCaseSensitive(), datatype.getPrecisionLength(),
datatype.getRadix(), datatype.getSearchType().toString(), datatype.getUUID(), datatype.getRuntimeTypeName(), datatype.getBasetypeName(), datatype.getAnnotation(), oid++));
@@ -543,7 +543,7 @@
public static Collection<AbstractMetadataRecord> getAllPropertiedObjects(CompositeMetadataStore metadata, Collection<Schema> schemas) {
Collection<AbstractMetadataRecord> records = new LinkedHashSet<AbstractMetadataRecord>();
- records.addAll(metadata.getDatatypes());
+ records.addAll(metadata.getDatatypes().values());
for (Schema schema : schemas) {
records.add(schema);
for (Table table : schema.getTables().values()) {
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/MetadataValidator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/MetadataValidator.java 2012-04-05 18:55:12 UTC (rev 3976)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/MetadataValidator.java 2012-04-05 18:55:21 UTC (rev 3977)
@@ -196,7 +196,7 @@
List<Expression> symbols = command.getProjectedSymbols();
for (Expression column:symbols) {
try {
- addColumn(Symbol.getShortName(column), getDataType(store.getDatatypes(), column.getType()), t);
+ addColumn(Symbol.getShortName(column), getDataType(store.getDatatypes().values(), column.getType()), t);
} catch (TranslatorException e) {
log(report, model, e.getMessage());
}
Modified: trunk/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java 2012-04-05 18:55:12 UTC (rev 3976)
+++ trunk/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java 2012-04-05 18:55:21 UTC (rev 3977)
@@ -72,7 +72,10 @@
private TransformationMetadata exampleTransformationMetadata()
throws TranslatorException {
Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
- datatypes.put(DataTypeManager.DefaultDataTypes.STRING, new Datatype());
+ Datatype dt = new Datatype();
+ dt.setName(DataTypeManager.DefaultDataTypes.STRING);
+ dt.setJavaClassName(String.class.getCanonicalName());
+ datatypes.put(DataTypeManager.DefaultDataTypes.STRING, dt);
MetadataFactory mf = new MetadataFactory(null, 1, "x", datatypes, new Properties(), null); //$NON-NLS-1$
mf.addProcedure("y"); //$NON-NLS-1$
@@ -112,7 +115,10 @@
@Test public void testAmbiguousTableWithPrivateModel() throws Exception {
Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
- datatypes.put(DataTypeManager.DefaultDataTypes.STRING, new Datatype());
+ Datatype dt = new Datatype();
+ dt.setName(DataTypeManager.DefaultDataTypes.STRING);
+ dt.setJavaClassName(String.class.getCanonicalName());
+ datatypes.put(DataTypeManager.DefaultDataTypes.STRING, dt);
MetadataFactory mf = new MetadataFactory(null, 1, "x", datatypes, new Properties(), null); //$NON-NLS-1$
mf.addTable("y"); //$NON-NLS-1$
MetadataFactory mf1 = new MetadataFactory(null, 1, "x1", datatypes, new Properties(), null); //$NON-NLS-1$
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-04-05 18:55:12 UTC (rev 3976)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-04-05 18:55:21 UTC (rev 3977)
@@ -29,6 +29,7 @@
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executor;
@@ -66,9 +67,11 @@
import org.teiid.dqp.internal.datamgr.TranslatorRepository;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
+import org.teiid.metadata.Datatype;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.MetadataRepository;
import org.teiid.metadata.MetadataStore;
+import org.teiid.metadata.index.IndexMetadataRepository;
import org.teiid.query.ObjectReplicator;
import org.teiid.query.metadata.TransformationMetadata;
import org.teiid.query.tempdata.GlobalTableStore;
@@ -304,9 +307,11 @@
}
if (!metadataLoaded) {
- factory = new MetadataFactory(vdb.getName(), vdb.getVersion(), model.getName(), getVDBRepository().getBuiltinDatatypes(), model.getProperties(), model.getSchemaText());
+ boolean indexStore = (metadataRepo instanceof IndexMetadataRepository);
+ // 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());
-
ExecutionFactory ef = null;
Object cf = null;
Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java 2012-04-05 18:55:12 UTC (rev 3976)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java 2012-04-05 18:55:21 UTC (rev 3977)
@@ -272,7 +272,7 @@
uuidToRecord.put(datatype.getUUID(), datatype);
}
} else {
- for (Datatype datatype : getDatatypes()) {
+ for (Datatype datatype : getDatatypes().values()) {
uuidToRecord.put(datatype.getUUID(), datatype);
}
}
Modified: trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java
===================================================================
--- trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java 2012-04-05 18:55:12 UTC (rev 3976)
+++ trunk/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java 2012-04-05 18:55:21 UTC (rev 3977)
@@ -84,7 +84,7 @@
}
try {
- IndexMetadataStore imf = loadMetadata(vdbName, vdbURL, getSystem().getDatatypes());
+ IndexMetadataStore imf = loadMetadata(vdbName, vdbURL, getSystem().getDatatypes().values());
Collection <FunctionMethod> methods = null;
Collection<FunctionTree> trees = null;
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java 2012-04-05 18:55:12 UTC (rev 3976)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java 2012-04-05 18:55:21 UTC (rev 3977)
@@ -148,14 +148,27 @@
public void setSystemStore(MetadataStore store) {
this.systemStore = store;
- Collection<Datatype> datatypes = this.systemStore.getDatatypes();
- for (Class<?> typeClass : DataTypeManager.getAllDataTypeClasses()) {
+ Collection<Datatype> datatypes = this.systemStore.getDatatypes().values();
+
+ for (String typeName : DataTypeManager.getAllDataTypeNames()) {
+
+ boolean found = false;
for (Datatype datatypeRecordImpl : datatypes) {
- if (datatypeRecordImpl.getJavaClassName().equals(typeClass.getName())) {
- datatypeMap.put(DataTypeManager.getDataTypeName(typeClass), datatypeRecordImpl);
+ if (datatypeRecordImpl.getRuntimeTypeName().equalsIgnoreCase(typeName)) {
+ datatypeMap.put(typeName, datatypeRecordImpl);
+ found = true;
break;
}
}
+
+ if (!found) {
+ for (Datatype datatypeRecordImpl : datatypes) {
+ if (datatypeRecordImpl.getJavaClassName().equals(DataTypeManager.getDataTypeClass(typeName))) {
+ datatypeMap.put(typeName, datatypeRecordImpl);
+ break;
+ }
+ }
+ }
}
// add alias types
Modified: trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testDataTypes.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testDataTypes.expected 2012-04-05 18:55:12 UTC (rev 3976)
+++ trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testDataTypes.expected 2012-04-05 18:55:21 UTC (rev 3977)
@@ -1,52 +1,52 @@
string boolean boolean string string integer integer string boolean boolean boolean integer integer string string string string string integer
Name IsStandard IsPhysical TypeName JavaClass Scale TypeLength NullType IsSigned IsAutoIncremented IsCaseSensitive Precision Radix SearchType UID RuntimeType BaseType Description OID
-ENTITIES false false ENTITIES java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:20360100-e742-1e20-8c26-a038c6ed7576 string ENTITY <null> 9
-ENTITY false false ENTITY java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:9fece300-e71a-1e20-8c26-a038c6ed7576 string NCName <null> 10
-ID false false ID java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:88b13dc0-e702-1e20-8c26-a038c6ed7576 string NCName <null> 13
-IDREF false false IDREF java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:dd33ff40-e6df-1e20-8c26-a038c6ed7576 string NCName <null> 12
-IDREFS false false IDREFS java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:3c99f780-e72d-1e20-8c26-a038c6ed7576 string IDREF <null> 11
-NCName false false NCName java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:ac00e000-e676-1e20-8c26-a038c6ed7576 string Name <null> 14
-NMTOKEN false false NMTOKEN java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:4ca2ae00-3a95-1e20-921b-eeee28353879 string token <null> 16
-NMTOKENS false false NMTOKENS java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:4b0f8500-e6a6-1e20-8c26-a038c6ed7576 string NMTOKEN <null> 15
-NOTATION false false NOTATION java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:3dcaf900-e8dc-1e2a-b433-fb67ea35c07e string anySimpleType <null> 17
-Name false false Name java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:e66c4600-e65b-1e20-8c26-a038c6ed7576 string token <null> 18
-QName false false QName java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:eeb5d780-e8c3-1e2a-b433-fb67ea35c07e string anySimpleType <null> 19
-XMLLiteral false false XMLLiteral org.teiid.core.types.XMLType 0 0 No Nulls false false false 0 0 Searchable mmuuid:43f5274e-55e1-1f87-ba1c-eea49143eb32 xml string <null> 1
-anyURI false false anyURI java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:6247ec80-e8a4-1e2a-b433-fb67ea35c07e string anySimpleType <null> 20
-base64Binary false false base64Binary java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:b4c99380-ebc6-1e2a-9319-8eaa9b2276c7 string anySimpleType <null> 21
-bigdecimal false false bigdecimal java.math.BigDecimal 0 0 No Nulls false false false 0 0 Searchable mmuuid:f2249740-a078-1e26-9b08-d6079ebe1f0d bigdecimal decimal <null> 2
-biginteger false false biginteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:822b9a40-a066-1e26-9b08-d6079ebe1f0d biginteger decimal <null> 3
-blob false false blob org.teiid.core.types.BlobType 0 0 No Nulls false false false 0 0 Searchable mmuuid:5a793100-1836-1ed0-ba0f-f2334f5fbf95 blob base64Binary <null> 4
-boolean false false boolean java.lang.Boolean 0 0 No Nulls false false false 0 0 Searchable mmuuid:dc476100-c483-1e24-9b01-c8207cd53eb7 boolean anySimpleType <null> 22
-byte false false byte java.lang.Byte 0 0 No Nulls false false false 0 0 Searchable mmuuid:26dc1cc0-b9c8-1e21-b812-969c8fc8b016 byte short <null> 23
-char false false char java.lang.Character 0 0 No Nulls false false false 0 0 Searchable mmuuid:62472700-a064-1e26-9b08-d6079ebe1f0d char string <null> 5
-clob false false clob org.teiid.core.types.ClobType 0 0 No Nulls false false false 0 0 Searchable mmuuid:559646c0-4941-1ece-b22b-f49159d22ad3 clob string <null> 6
-date false false date java.sql.Date 0 0 No Nulls false false false 0 0 Searchable mmuuid:65dcde00-c4ab-1e24-9b01-c8207cd53eb7 date anySimpleType <null> 25
-dateTime false false dateTime java.sql.Timestamp 0 0 No Nulls false false false 0 0 Searchable mmuuid:5c69dec0-b3ea-1e2a-9a03-beb8638ffd21 timestamp anySimpleType <null> 24
-decimal false false decimal java.math.BigDecimal 0 0 No Nulls false false false 0 0 Searchable mmuuid:569dfa00-c456-1e24-9b01-c8207cd53eb7 bigdecimal anySimpleType <null> 26
-double false false double java.lang.Double 0 0 No Nulls false false false 0 0 Searchable mmuuid:1f18b140-c4a3-1e24-9b01-c8207cd53eb7 double anySimpleType <null> 27
-duration false false duration java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:28d98540-b3e7-1e2a-9a03-beb8638ffd21 string anySimpleType <null> 28
-float false false float java.lang.Float 0 0 No Nulls false false false 0 0 Searchable mmuuid:d86b0d00-c48a-1e24-9b01-c8207cd53eb7 float anySimpleType <null> 29
-gDay false false gDay java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:860b7dc0-b3f8-1e2a-9a03-beb8638ffd21 biginteger anySimpleType <null> 30
-gMonth false false gMonth java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:187f5580-b3fb-1e2a-9a03-beb8638ffd21 biginteger anySimpleType <null> 32
-gMonthDay false false gMonthDay java.sql.Timestamp 0 0 No Nulls false false false 0 0 Searchable mmuuid:6e604140-b3f5-1e2a-9a03-beb8638ffd21 timestamp anySimpleType <null> 31
-gYear false false gYear java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:b02c7600-b3f2-1e2a-9a03-beb8638ffd21 biginteger anySimpleType <null> 34
-gYearMonth false false gYearMonth java.sql.Timestamp 0 0 No Nulls false false false 0 0 Searchable mmuuid:17d08040-b3ed-1e2a-9a03-beb8638ffd21 timestamp anySimpleType <null> 33
-hexBinary false false hexBinary java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:d9998500-ebba-1e2a-9319-8eaa9b2276c7 string anySimpleType <null> 35
-int false false int java.lang.Integer 0 0 No Nulls false false false 0 0 Searchable mmuuid:33add3c0-b98d-1e21-b812-969c8fc8b016 integer long <null> 37
-integer false false integer java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:45da3500-e78f-1e20-8c26-a038c6ed7576 biginteger decimal <null> 36
-language false false language java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:d4d980c0-e623-1e20-8c26-a038c6ed7576 string token <null> 38
-long false false long java.lang.Long 0 0 No Nulls false false false 0 0 Searchable mmuuid:8cdee840-b900-1e21-b812-969c8fc8b016 long integer <null> 39
-negativeInteger false false negativeInteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:86d29280-b8d3-1e21-b812-969c8fc8b016 biginteger nonPositiveInteger <null> 40
-nonNegativeInteger false false nonNegativeInteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:0e081200-b8a4-1e21-b812-969c8fc8b016 biginteger integer <null> 41
-nonPositiveInteger false false nonPositiveInteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:cbdd6e40-b9d2-1e21-8c26-a038c6ed7576 biginteger integer <null> 42
-normalizedString false false normalizedString java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:4df43700-3b13-1e20-921b-eeee28353879 string string <null> 43
-object false false object java.lang.Object 0 0 No Nulls false false false 0 0 Searchable mmuuid:051a0640-b4e8-1e26-9f33-b76fd9d5fa79 object base64Binary <null> 7
-positiveInteger false false positiveInteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:1cbbd380-b9ea-1e21-b812-969c8fc8b016 biginteger nonNegativeInteger <null> 44
-short false false short java.lang.Short 0 0 No Nulls false false false 0 0 Searchable mmuuid:5bbcf140-b9ae-1e21-b812-969c8fc8b016 short int <null> 45
-string false false string java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:bf6c34c0-c442-1e24-9b01-c8207cd53eb7 string anySimpleType <null> 46
-time false false time java.sql.Time 0 0 No Nulls false false false 0 0 Searchable mmuuid:3b892180-c4a7-1e24-9b01-c8207cd53eb7 time anySimpleType <null> 47
-timestamp false false timestamp java.sql.Timestamp 0 0 No Nulls false false false 0 0 Searchable mmuuid:6d9809c0-a07e-1e26-9b08-d6079ebe1f0d timestamp string <null> 8
+ENTITIES false false ENTITIES java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:20360100-e742-1e20-8c26-a038c6ed7576 string ENTITY <null> 1
+ENTITY false false ENTITY java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:9fece300-e71a-1e20-8c26-a038c6ed7576 string NCName <null> 2
+ID false false ID java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:88b13dc0-e702-1e20-8c26-a038c6ed7576 string NCName <null> 3
+IDREF false false IDREF java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:dd33ff40-e6df-1e20-8c26-a038c6ed7576 string NCName <null> 4
+IDREFS false false IDREFS java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:3c99f780-e72d-1e20-8c26-a038c6ed7576 string IDREF <null> 5
+NCName false false NCName java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:ac00e000-e676-1e20-8c26-a038c6ed7576 string Name <null> 6
+NMTOKEN false false NMTOKEN java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:4ca2ae00-3a95-1e20-921b-eeee28353879 string token <null> 7
+NMTOKENS false false NMTOKENS java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:4b0f8500-e6a6-1e20-8c26-a038c6ed7576 string NMTOKEN <null> 8
+NOTATION false false NOTATION java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:3dcaf900-e8dc-1e2a-b433-fb67ea35c07e string anySimpleType <null> 9
+Name false false Name java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:e66c4600-e65b-1e20-8c26-a038c6ed7576 string token <null> 10
+QName false false QName java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:eeb5d780-e8c3-1e2a-b433-fb67ea35c07e string anySimpleType <null> 11
+XMLLiteral false false XMLLiteral org.teiid.core.types.XMLType 0 0 No Nulls false false false 0 0 Searchable mmuuid:43f5274e-55e1-1f87-ba1c-eea49143eb32 xml string <null> 12
+anyURI false false anyURI java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:6247ec80-e8a4-1e2a-b433-fb67ea35c07e string anySimpleType <null> 13
+base64Binary false false base64Binary java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:b4c99380-ebc6-1e2a-9319-8eaa9b2276c7 string anySimpleType <null> 14
+bigdecimal false false bigdecimal java.math.BigDecimal 0 0 No Nulls false false false 0 0 Searchable mmuuid:f2249740-a078-1e26-9b08-d6079ebe1f0d bigdecimal decimal <null> 15
+biginteger false false biginteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:822b9a40-a066-1e26-9b08-d6079ebe1f0d biginteger decimal <null> 16
+blob false false blob org.teiid.core.types.BlobType 0 0 No Nulls false false false 0 0 Searchable mmuuid:5a793100-1836-1ed0-ba0f-f2334f5fbf95 blob base64Binary <null> 17
+boolean false false boolean java.lang.Boolean 0 0 No Nulls false false false 0 0 Searchable mmuuid:dc476100-c483-1e24-9b01-c8207cd53eb7 boolean anySimpleType <null> 18
+byte false false byte java.lang.Byte 0 0 No Nulls false false false 0 0 Searchable mmuuid:26dc1cc0-b9c8-1e21-b812-969c8fc8b016 byte short <null> 19
+char false false char java.lang.Character 0 0 No Nulls false false false 0 0 Searchable mmuuid:62472700-a064-1e26-9b08-d6079ebe1f0d char string <null> 20
+clob false false clob org.teiid.core.types.ClobType 0 0 No Nulls false false false 0 0 Searchable mmuuid:559646c0-4941-1ece-b22b-f49159d22ad3 clob string <null> 21
+date false false date java.sql.Date 0 0 No Nulls false false false 0 0 Searchable mmuuid:65dcde00-c4ab-1e24-9b01-c8207cd53eb7 date anySimpleType <null> 22
+dateTime false false dateTime java.sql.Timestamp 0 0 No Nulls false false false 0 0 Searchable mmuuid:5c69dec0-b3ea-1e2a-9a03-beb8638ffd21 timestamp anySimpleType <null> 23
+decimal false false decimal java.math.BigDecimal 0 0 No Nulls false false false 0 0 Searchable mmuuid:569dfa00-c456-1e24-9b01-c8207cd53eb7 bigdecimal anySimpleType <null> 24
+double false false double java.lang.Double 0 0 No Nulls false false false 0 0 Searchable mmuuid:1f18b140-c4a3-1e24-9b01-c8207cd53eb7 double anySimpleType <null> 25
+duration false false duration java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:28d98540-b3e7-1e2a-9a03-beb8638ffd21 string anySimpleType <null> 26
+float false false float java.lang.Float 0 0 No Nulls false false false 0 0 Searchable mmuuid:d86b0d00-c48a-1e24-9b01-c8207cd53eb7 float anySimpleType <null> 27
+gDay false false gDay java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:860b7dc0-b3f8-1e2a-9a03-beb8638ffd21 biginteger anySimpleType <null> 28
+gMonth false false gMonth java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:187f5580-b3fb-1e2a-9a03-beb8638ffd21 biginteger anySimpleType <null> 29
+gMonthDay false false gMonthDay java.sql.Timestamp 0 0 No Nulls false false false 0 0 Searchable mmuuid:6e604140-b3f5-1e2a-9a03-beb8638ffd21 timestamp anySimpleType <null> 30
+gYear false false gYear java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:b02c7600-b3f2-1e2a-9a03-beb8638ffd21 biginteger anySimpleType <null> 31
+gYearMonth false false gYearMonth java.sql.Timestamp 0 0 No Nulls false false false 0 0 Searchable mmuuid:17d08040-b3ed-1e2a-9a03-beb8638ffd21 timestamp anySimpleType <null> 32
+hexBinary false false hexBinary java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:d9998500-ebba-1e2a-9319-8eaa9b2276c7 string anySimpleType <null> 33
+int false false int java.lang.Integer 0 0 No Nulls false false false 0 0 Searchable mmuuid:33add3c0-b98d-1e21-b812-969c8fc8b016 integer long <null> 34
+integer false false integer java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:45da3500-e78f-1e20-8c26-a038c6ed7576 biginteger decimal <null> 35
+language false false language java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:d4d980c0-e623-1e20-8c26-a038c6ed7576 string token <null> 36
+long false false long java.lang.Long 0 0 No Nulls false false false 0 0 Searchable mmuuid:8cdee840-b900-1e21-b812-969c8fc8b016 long integer <null> 37
+negativeInteger false false negativeInteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:86d29280-b8d3-1e21-b812-969c8fc8b016 biginteger nonPositiveInteger <null> 38
+nonNegativeInteger false false nonNegativeInteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:0e081200-b8a4-1e21-b812-969c8fc8b016 biginteger integer <null> 39
+nonPositiveInteger false false nonPositiveInteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:cbdd6e40-b9d2-1e21-8c26-a038c6ed7576 biginteger integer <null> 40
+normalizedString false false normalizedString java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:4df43700-3b13-1e20-921b-eeee28353879 string string <null> 41
+object false false object java.lang.Object 0 0 No Nulls false false false 0 0 Searchable mmuuid:051a0640-b4e8-1e26-9f33-b76fd9d5fa79 object base64Binary <null> 42
+positiveInteger false false positiveInteger java.math.BigInteger 0 0 No Nulls false false false 0 0 Searchable mmuuid:1cbbd380-b9ea-1e21-b812-969c8fc8b016 biginteger nonNegativeInteger <null> 43
+short false false short java.lang.Short 0 0 No Nulls false false false 0 0 Searchable mmuuid:5bbcf140-b9ae-1e21-b812-969c8fc8b016 short int <null> 44
+string false false string java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:bf6c34c0-c442-1e24-9b01-c8207cd53eb7 string anySimpleType <null> 45
+time false false time java.sql.Time 0 0 No Nulls false false false 0 0 Searchable mmuuid:3b892180-c4a7-1e24-9b01-c8207cd53eb7 time anySimpleType <null> 46
+timestamp false false timestamp java.sql.Timestamp 0 0 No Nulls false false false 0 0 Searchable mmuuid:6d9809c0-a07e-1e26-9b08-d6079ebe1f0d timestamp string <null> 47
token false false token java.lang.String 0 0 No Nulls false false false 0 0 Searchable mmuuid:3425cb80-d844-1e20-9027-be6d2c3b8b3a string normalizedString <null> 48
unsignedByte false false unsignedByte java.lang.Short 0 0 No Nulls false false false 0 0 Searchable mmuuid:cff745c0-baa2-1e21-b812-969c8fc8b016 short unsignedShort <null> 49
unsignedInt false false unsignedInt java.lang.Long 0 0 No Nulls false false false 0 0 Searchable mmuuid:badcbd80-ba63-1e21-b812-969c8fc8b016 long unsignedLong <null> 50
12 years, 8 months
teiid SVN: r3976 - branches/7.7.x/client/src/main/java/org/teiid/jdbc.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-04-05 14:55:12 -0400 (Thu, 05 Apr 2012)
New Revision: 3976
Modified:
branches/7.7.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java
Log:
TEIID-1980 resetting the timeout to the property setting
Modified: branches/7.7.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- branches/7.7.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2012-04-05 18:31:17 UTC (rev 3975)
+++ branches/7.7.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2012-04-05 18:55:12 UTC (rev 3976)
@@ -188,7 +188,11 @@
// silently failover to default
}
}
- String queryTimeoutStr = this.execProps.getProperty(ExecutionProperties.QUERYTIMEOUT);
+ setTimeoutFromProperties();
+ }
+
+ private void setTimeoutFromProperties() {
+ String queryTimeoutStr = this.execProps.getProperty(ExecutionProperties.QUERYTIMEOUT);
if(queryTimeoutStr != null) {
try {
this.queryTimeoutMS = Integer.parseInt(queryTimeoutStr)*1000;
@@ -196,7 +200,7 @@
// silently failover to default
}
}
- }
+ }
protected DQP getDQP() {
return this.driverConnection.getDQP();
@@ -861,6 +865,7 @@
cancel();
commandStatus = State.TIMED_OUT;
queryTimeoutMS = NO_TIMEOUT;
+ setTimeoutFromProperties();
currentRequestID = -1;
if (this.resultSet != null) {
this.resultSet.close();
12 years, 8 months
teiid SVN: r3975 - in branches/7.7.x: client/src/main/java/org/teiid/adminapi/impl and 6 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-04-05 14:31:17 -0400 (Thu, 05 Apr 2012)
New Revision: 3975
Modified:
branches/7.7.x/api/src/main/java/org/teiid/logging/CommandLogMessage.java
branches/7.7.x/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java
branches/7.7.x/documentation/developer-guide/src/main/docbook/en-US/content/logging.xml
branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
branches/7.7.x/engine/src/main/java/org/teiid/query/analysis/AnalysisRecord.java
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/DdlPlan.java
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java
branches/7.7.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
Log:
TEIID-1985 adding an admin method to get plans and adding plan information to the comand log at a trace level
Modified: branches/7.7.x/api/src/main/java/org/teiid/logging/CommandLogMessage.java
===================================================================
--- branches/7.7.x/api/src/main/java/org/teiid/logging/CommandLogMessage.java 2012-04-05 14:47:26 UTC (rev 3974)
+++ branches/7.7.x/api/src/main/java/org/teiid/logging/CommandLogMessage.java 2012-04-05 18:31:17 UTC (rev 3975)
@@ -24,6 +24,7 @@
import java.sql.Timestamp;
+import org.teiid.client.plan.PlanNode;
import org.teiid.translator.ExecutionContext;
/**
@@ -33,6 +34,7 @@
public enum Event {
NEW,
+ PLAN,
END,
CANCEL,
ERROR
@@ -60,6 +62,7 @@
private String modelName;
private String translatorName;
private ExecutionContext executionContext;
+ private PlanNode plan;
public CommandLogMessage(long timestamp,
String requestID,
@@ -71,7 +74,7 @@
int vdbVersion,
String sql) {
// userCommandStart
- this(timestamp, requestID, transactionID, sessionID, principal, vdbName, vdbVersion, null, Event.NEW);
+ this(timestamp, requestID, transactionID, sessionID, principal, vdbName, vdbVersion, null, Event.NEW, null);
this.applicationName = applicationName;
this.sql = sql;
}
@@ -83,7 +86,7 @@
String vdbName,
int vdbVersion,
Integer finalRowCount,
- Event event) {
+ Event event, PlanNode plan) {
// userCommandEnd
this.event = event;
this.timestamp = timestamp;
@@ -94,6 +97,7 @@
this.vdbName = vdbName;
this.vdbVersion = vdbVersion;
this.rowCount = finalRowCount;
+ this.plan = plan;
}
public CommandLogMessage(long timestamp,
String requestID,
@@ -136,16 +140,16 @@
}
public String toString() {
- if (!source && event == Event.NEW) {
- return "\tSTART USER COMMAND:\tstartTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\ttxID=" + transactionID + "\tsessionID=" + sessionID + "\tapplicationName=" + applicationName + "\tprincipal=" + principal + "\tvdbName=" + vdbName + "\tvdbVersion=" + vdbVersion + "\tsql=" + sql; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
- }
if (!source) {
+ if (event == Event.NEW) {
+ return "\tSTART USER COMMAND:\tstartTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\ttxID=" + transactionID + "\tsessionID=" + sessionID + "\tapplicationName=" + applicationName + "\tprincipal=" + principal + "\tvdbName=" + vdbName + "\tvdbVersion=" + vdbVersion + "\tsql=" + sql; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+ }
return "\t"+ event +" USER COMMAND:\tendTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\ttxID=" + transactionID + "\tsessionID=" + sessionID + "\tprincipal=" + principal + "\tvdbName=" + vdbName + "\tvdbVersion=" + vdbVersion + "\tfinalRowCount=" + rowCount; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
}
if (event == Event.NEW) {
return "\tSTART DATA SRC COMMAND:\tstartTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\tsourceCommandID="+ sourceCommandID + "\ttxID=" + transactionID + "\tmodelName="+ modelName + "\ttranslatorName=" + translatorName + "\tsessionID=" + sessionID + "\tprincipal=" + principal + "\tsql=" + sql; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
}
- return "\t"+ event +" SRC COMMAND:\tendTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\tsourceCommandID="+ sourceCommandID + "\ttxID=" + transactionID + "\tmodelName="+ modelName + "\ttranslatorName=" + translatorName + "\tsessionID=" + sessionID + "\tprincipal=" + principal + "\tfinalRowCount=" + rowCount; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ return "\t"+ event +" SRC COMMAND:\tendTime=" + new Timestamp(timestamp) + "\trequestID=" + requestID + "\tsourceCommandID="+ sourceCommandID + "\ttxID=" + transactionID + "\tmodelName="+ modelName + "\ttranslatorName=" + translatorName + "\tsessionID=" + sessionID + "\tprincipal=" + principal + "\tfinalRowCount=" + rowCount + (plan!=null?"\tplan=" + plan:""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$//$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$
}
public long getTimestamp() {
@@ -216,5 +220,12 @@
*/
public ExecutionContext getExecutionContext() {
return executionContext;
- }
+ }
+ /**
+ * Only available for user commands after the NEW event
+ * @return
+ */
+ public PlanNode getPlan() {
+ return plan;
+ }
}
Modified: branches/7.7.x/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java
===================================================================
--- branches/7.7.x/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java 2012-04-05 14:47:26 UTC (rev 3974)
+++ branches/7.7.x/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java 2012-04-05 18:31:17 UTC (rev 3975)
@@ -25,6 +25,7 @@
import java.util.List;
import org.teiid.adminapi.AdminException;
+import org.teiid.client.plan.PlanNode;
public interface DQPManagement {
@@ -45,4 +46,12 @@
List<RequestMetadata> getRequestsUsingVDB(String vdbName, int vdbVersion) throws AdminException;
CacheStatisticsMetadata getCacheStatistics(String cacheType);
List<List> executeQuery(String vdbName, int version, String command, long timoutInMilli) throws AdminException;
+ /**
+ *
+ * @param sessionId
+ * @param requestId
+ * @return the plan or null if the request does not exist
+ * @throws AdminException
+ */
+ PlanNode getPlan(String sessionId, long requestId) throws AdminException;
}
Modified: branches/7.7.x/documentation/developer-guide/src/main/docbook/en-US/content/logging.xml
===================================================================
--- branches/7.7.x/documentation/developer-guide/src/main/docbook/en-US/content/logging.xml 2012-04-05 14:47:26 UTC (rev 3974)
+++ branches/7.7.x/documentation/developer-guide/src/main/docbook/en-US/content/logging.xml 2012-04-05 18:31:17 UTC (rev 3975)
@@ -35,7 +35,9 @@
If you want to build a custom appender for command logging that will have access to
log4j "LoggingEvents" to the "COMMAND_LOG" context, the appender will receive a message that is an instance of
<code>org.teiid.logging.CommandLogMessage</code>. The relevant Teiid classes are defined in the <code>teiid-api-&versionNumber;.jar</code>.
- The CommmdLogMessage includes information about vdb, session, command sql, etc. CommandLogMessages are logged at the DEBUG level.
+ The CommmdLogMessage includes information about vdb, session, command sql, etc. CommandLogMessages are logged at the DEBUG level. If the COMMAND_LOG is at the TRACE level,
+ then CommandLogMessages will also contain the query plan for user queries after the NEW event. A typical event sequence is user query NEW, optional user query PLAN, some number of source query NEW/END, then the user query END.
+ CANCEL and ERROR events are also captured.
</para>
<example>
<title>Sample CommandLogMessage Usage</title>
Modified: branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2012-04-05 14:47:26 UTC (rev 3974)
+++ branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2012-04-05 18:31:17 UTC (rev 3975)
@@ -54,6 +54,7 @@
import org.teiid.client.ResultsMessage;
import org.teiid.client.lob.LobChunk;
import org.teiid.client.metadata.MetadataResult;
+import org.teiid.client.plan.PlanNode;
import org.teiid.client.util.ResultsFuture;
import org.teiid.client.util.ResultsReceiver;
import org.teiid.client.xa.XATransactionException;
@@ -80,6 +81,7 @@
import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.metadata.MetadataRepository;
import org.teiid.query.QueryPlugin;
+import org.teiid.query.processor.QueryProcessor;
import org.teiid.query.tempdata.TempTableDataManager;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.tempdata.TempTableStore.TransactionMode;
@@ -545,6 +547,22 @@
return cancelRequest(requestID);
}
+ public PlanNode getPlan(String sessionId, long executionId) {
+ RequestID requestID = new RequestID(sessionId, executionId);
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_DQP, "getPlan for requestID=" + requestID); //$NON-NLS-1$
+ }
+ RequestWorkItem workItem = safeGetWorkItem(requestID);
+ if (workItem == null) {
+ return null;
+ }
+ QueryProcessor qp = workItem.getProcessor();
+ if (qp == null) {
+ return null;
+ }
+ return qp.getProcessorPlan().getDescriptionProperties();
+ }
+
private boolean cancelRequest(RequestID requestID) throws TeiidComponentException {
if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
LogManager.logDetail(LogConstants.CTX_DQP, "cancelQuery for requestID=" + requestID); //$NON-NLS-1$
@@ -672,13 +690,14 @@
}
void logMMCommand(RequestWorkItem workItem, Event status, Integer rowCount) {
- if (!LogManager.isMessageToBeRecorded(LogConstants.CTX_COMMANDLOGGING, MessageLevel.DETAIL)) {
+ if ((status != Event.PLAN && !LogManager.isMessageToBeRecorded(LogConstants.CTX_COMMANDLOGGING, MessageLevel.DETAIL))
+ || !LogManager.isMessageToBeRecorded(LogConstants.CTX_COMMANDLOGGING, MessageLevel.TRACE)) {
return;
}
RequestMessage msg = workItem.requestMsg;
DQPWorkContext workContext = DQPWorkContext.getWorkContext();
- RequestID rID = new RequestID(workContext.getSessionId(), msg.getExecutionId());
+ RequestID rID = workItem.requestID;
String txnID = null;
TransactionContext tc = workItem.getTransactionContext();
if (tc != null && tc.getTransactionType() != Scope.NONE) {
@@ -690,7 +709,12 @@
if (status == Event.NEW) {
message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), appName, workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), msg.getCommandString());
} else {
- message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), rowCount, status);
+ QueryProcessor qp = workItem.getProcessor();
+ PlanNode plan = null;
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_COMMANDLOGGING, MessageLevel.TRACE) && qp != null) {
+ plan = qp.getProcessorPlan().getDescriptionProperties();
+ }
+ message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), rowCount, status, plan);
}
LogManager.log(MessageLevel.DETAIL, LogConstants.CTX_COMMANDLOGGING, message);
}
Modified: branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2012-04-05 14:47:26 UTC (rev 3974)
+++ branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2012-04-05 18:31:17 UTC (rev 3975)
@@ -521,6 +521,7 @@
request.processor.getContext().setDataObjects(new HashSet<Object>(4));
}
processor = request.processor;
+ this.dqpCore.logMMCommand(this, Event.PLAN, null);
collector = new BatchCollector(processor, processor.getBufferManager(), this.request.context, isForwardOnly()) {
protected void flushBatchDirect(TupleBatch batch, boolean add) throws TeiidComponentException,TeiidProcessingException {
resultsBuffer = getTupleBuffer();
@@ -709,11 +710,12 @@
}
response.setPlanDescription(analysisRecord.getQueryPlan());
response.setAnnotations(analysisRecord.getAnnotations());
+ analysisRecord.getAnnotations().clear();
}
if (requestMsg.getShowPlan() == ShowPlan.DEBUG) {
response.setDebugLog(analysisRecord.getDebugLog());
+ analysisRecord.stopDebugLog();
}
- this.analysisRecord = null;
}
}
@@ -974,5 +976,9 @@
public void setCancelTask(Task cancelTask) {
this.cancelTask = cancelTask;
}
+
+ public QueryProcessor getProcessor() {
+ return processor;
+ }
}
\ No newline at end of file
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/analysis/AnalysisRecord.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/analysis/AnalysisRecord.java 2012-04-05 14:47:26 UTC (rev 3974)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/analysis/AnalysisRecord.java 2012-04-05 18:31:17 UTC (rev 3975)
@@ -201,6 +201,11 @@
}
return null;
}
+
+ public void stopDebugLog() {
+ this.stringWriter = null;
+ this.recordDebug = false;
+ }
/**
* Helper method to turn a list of projected symbols into a suitable list of
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/processor/DdlPlan.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/processor/DdlPlan.java 2012-04-05 14:47:26 UTC (rev 3974)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/processor/DdlPlan.java 2012-04-05 18:31:17 UTC (rev 3975)
@@ -225,4 +225,9 @@
return props;
}
+ @Override
+ public String toString() {
+ return command.toString();
+ }
+
}
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java 2012-04-05 14:47:26 UTC (rev 3974)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java 2012-04-05 18:31:17 UTC (rev 3975)
@@ -162,4 +162,13 @@
return true;
}
+ @Override
+ public String toString() {
+ StringBuilder val = new StringBuilder("ForEach "); //$NON-NLS-1$
+ val.append(this.queryPlan).append("\n{\n"); //$NON-NLS-1$
+ val.append(this.rowProcedure);
+ val.append("}\n"); //$NON-NLS-1$
+ return val.toString();
+ }
+
}
Modified: branches/7.7.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- branches/7.7.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2012-04-05 14:47:26 UTC (rev 3974)
+++ branches/7.7.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2012-04-05 18:31:17 UTC (rev 3975)
@@ -75,6 +75,7 @@
import org.teiid.client.DQP;
import org.teiid.client.RequestMessage;
import org.teiid.client.ResultsMessage;
+import org.teiid.client.plan.PlanNode;
import org.teiid.client.security.ILogon;
import org.teiid.client.security.InvalidSessionException;
import org.teiid.client.util.ExceptionUtil;
@@ -512,6 +513,12 @@
throw new AdminComponentException(e);
}
}
+
+ @Override
+ @ManagementOperation(description="Get a plan for the request",params={@ManagementParameter(name="sessionId",description="The session Identifier"), @ManagementParameter(name="executionId",description="The Execution Identifier")})
+ public PlanNode getPlan(String sessionId, long executionId) throws AdminException {
+ return this.dqpCore.getPlan(sessionId, executionId);
+ }
@Override
@ManagementOperation(description="Get Cache types in the system", impact=Impact.ReadOnly)
12 years, 8 months
teiid SVN: r3974 - branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-04-05 10:47:26 -0400 (Thu, 05 Apr 2012)
New Revision: 3974
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java
branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushLimit.java
branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
Log:
TEIID-1990 ensuring greater detail for planning decisions
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2012-04-04 19:54:58 UTC (rev 3973)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2012-04-05 14:47:26 UTC (rev 3974)
@@ -632,7 +632,11 @@
this.valid = false;
setAbort(true);
if (analysisRecord != null && analysisRecord.recordDebug()) {
- analysisRecord.println(reason + " " + object); //$NON-NLS-1$
+ try {
+ analysisRecord.println(reason + " " + this.metadata.getName(this.modelID) + ": " + object); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (QueryMetadataException e) {
+ } catch (TeiidComponentException e) {
+ }
}
}
@@ -658,6 +662,7 @@
}
CriteriaCapabilityValidatorVisitor visitor = new CriteriaCapabilityValidatorVisitor(modelID, metadata, capFinder, caps);
+ visitor.analysisRecord = analysisRecord;
PostOrderNavigator.doVisit(obj, visitor);
if(visitor.getException() != null) {
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java 2012-04-04 19:54:58 UTC (rev 3973)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java 2012-04-05 14:47:26 UTC (rev 3974)
@@ -292,7 +292,7 @@
if (newRoot != null) {
root = newRoot;
if (accessNode.getParent().getType() == NodeConstants.Types.TUPLE_LIMIT) {
- newRoot = RulePushLimit.raiseAccessOverLimit(root, accessNode, metadata, capFinder, accessNode.getParent());
+ newRoot = RulePushLimit.raiseAccessOverLimit(root, accessNode, metadata, capFinder, accessNode.getParent(), record);
}
if (newRoot != null) {
root = newRoot;
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushLimit.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushLimit.java 2012-04-04 19:54:58 UTC (rev 3973)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushLimit.java 2012-04-05 14:47:26 UTC (rev 3974)
@@ -105,7 +105,7 @@
continue;
}
- while (canPushLimit(plan, limitNode, limitNodes, metadata, capabilitiesFinder)) {
+ while (canPushLimit(plan, limitNode, limitNodes, metadata, capabilitiesFinder, analysisRecord)) {
plan = RuleRaiseAccess.performRaise(plan, limitNode.getFirstChild(), limitNode);
}
@@ -119,7 +119,7 @@
return plan;
}
- boolean canPushLimit(PlanNode rootNode, PlanNode limitNode, List<PlanNode> limitNodes, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) throws QueryMetadataException, TeiidComponentException {
+ boolean canPushLimit(PlanNode rootNode, PlanNode limitNode, List<PlanNode> limitNodes, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, AnalysisRecord record) throws QueryMetadataException, TeiidComponentException {
PlanNode child = limitNode.getFirstChild();
if (child == null || child.getChildCount() == 0) {
return false;
@@ -142,7 +142,7 @@
NodeEditor.removeChildNode(limitNode, child);
limitNodes.remove(child);
- return canPushLimit(rootNode, limitNode, limitNodes, metadata, capFinder);
+ return canPushLimit(rootNode, limitNode, limitNodes, metadata, capFinder, record);
}
case NodeConstants.Types.SET_OP:
{
@@ -165,7 +165,7 @@
}
case NodeConstants.Types.ACCESS:
{
- raiseAccessOverLimit(rootNode, child, metadata, capFinder, limitNode);
+ raiseAccessOverLimit(rootNode, child, metadata, capFinder, limitNode, record);
return false;
}
case NodeConstants.Types.PROJECT:
@@ -219,7 +219,7 @@
PlanNode accessNode,
QueryMetadataInterface metadata,
CapabilitiesFinder capFinder,
- PlanNode parentNode) throws QueryMetadataException,
+ PlanNode parentNode, AnalysisRecord analysisRecord) throws QueryMetadataException,
TeiidComponentException {
Object modelID = RuleRaiseAccess.getModelIDFromAccess(accessNode, metadata);
if (modelID == null) {
@@ -229,6 +229,9 @@
Expression limit = (Expression)parentNode.getProperty(NodeConstants.Info.MAX_TUPLE_LIMIT);
if (limit != null && !CapabilitiesUtil.supportsRowLimit(modelID, metadata, capFinder)) {
+ if (analysisRecord != null && analysisRecord.recordDebug()) {
+ analysisRecord.println("limit not supported by source " + metadata.getName(modelID)); //$NON-NLS-1$
+ }
return null;
}
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2012-04-04 19:54:58 UTC (rev 3973)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2012-04-05 14:47:26 UTC (rev 3974)
@@ -290,7 +290,7 @@
}
case NodeConstants.Types.TUPLE_LIMIT:
{
- return RulePushLimit.raiseAccessOverLimit(rootNode, accessNode, metadata, capFinder, parentNode);
+ return RulePushLimit.raiseAccessOverLimit(rootNode, accessNode, metadata, capFinder, parentNode, record);
}
default:
{
12 years, 8 months
teiid SVN: r3973 - in trunk: engine/src/main/java/org/teiid/dqp/internal/datamgr and 16 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-04-04 15:54:58 -0400 (Wed, 04 Apr 2012)
New Revision: 3973
Added:
trunk/engine/src/main/java/org/teiid/query/function/aggregate/UserDefined.java
Modified:
trunk/api/src/main/java/org/teiid/UserDefinedAggregate.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java
trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java
trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/RankingFunction.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/SingleArgumentAggregateFunction.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Sum.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java
trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/Query.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/AggregateSymbolCollectorVisitor.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.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/function/TestFunctionLibrary.java
trunk/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java
trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestDuplicateFilter.java
Log:
TEIID-1560 adding parsing/validation/processing logic for aggregates. more to come
Modified: trunk/api/src/main/java/org/teiid/UserDefinedAggregate.java
===================================================================
--- trunk/api/src/main/java/org/teiid/UserDefinedAggregate.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/api/src/main/java/org/teiid/UserDefinedAggregate.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -27,8 +27,16 @@
* @param <T>
*/
public interface UserDefinedAggregate<T> {
-
- void init(CommandContext commandContext);
- T getResult();
+ /**
+ * Called when state from the current partition can be forgotten
+ */
+ void reset();
+ /**
+ * Called to get the current value. May be called multiple times in the same
+ * partition for windowed aggregates.
+ * @param commandContext
+ * @return
+ */
+ T getResult(CommandContext commandContext);
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -33,6 +33,7 @@
import org.teiid.adminapi.Session;
import org.teiid.common.buffer.BufferManager;
+import org.teiid.core.util.EquivalenceUtil;
import org.teiid.core.util.HashCodeUtil;
import org.teiid.dqp.internal.process.RequestWorkItem;
import org.teiid.dqp.message.RequestID;
@@ -145,23 +146,10 @@
return false;
}
ExecutionContext other = (ExecutionContext) obj;
- return compareWithNull(this.getRequestId(), other.getRequestId()) &&
- compareWithNull(this.getPartIdentifier(), other.getPartIdentifier());
+ return EquivalenceUtil.areEqual(this.getRequestId(), other.getRequestId()) &&
+ EquivalenceUtil.areEqual(this.getPartIdentifier(), other.getPartIdentifier());
}
- private boolean compareWithNull(Object obj1, Object obj2) {
- if(obj1 == null) {
- if(obj2 == null) {
- return true;
- }
- return false;
- }
- if(obj2 == null) {
- return false;
- }
- return obj1.equals(obj2);
- }
-
public int hashCode() {
return HashCodeUtil.hashCode(HashCodeUtil.hashCode(0, getRequestId()), partID);
}
Modified: trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -612,7 +612,7 @@
TEIID30581,
TEIID30590,
TEIID30591,
- TEIID30600, TEIID30601, //User defined aggregate errors
+ TEIID30600, TEIID30601, TEIID30602, //User defined aggregate errors
TEIID31069,
TEIID31070,
Modified: trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -59,8 +59,6 @@
import org.teiid.core.types.basic.StringToSQLXMLTransform;
import org.teiid.core.util.EquivalenceUtil;
import org.teiid.language.Like.MatchMode;
-import org.teiid.metadata.FunctionMethod.Determinism;
-import org.teiid.metadata.FunctionMethod.PushDown;
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.FunctionDescriptor;
import org.teiid.query.function.FunctionLibrary;
@@ -970,11 +968,8 @@
values[i+start] = internalEvaluate(args[i], tuple);
}
- // Check for function we can't evaluate
- if(fd.getPushdown() == PushDown.MUST_PUSHDOWN) {
- throw new TeiidComponentException(QueryPlugin.Event.TEIID30341, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30341, fd.getName()));
- }
-
+ fd.checkNotPushdown();
+
// Check for special lookup function
if(fd.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP)) {
if(dataMgr == null) {
@@ -993,13 +988,7 @@
}
// Execute function
- Object result = fd.invokeFunction(values);
-
- if (context != null && fd.getDeterministic().ordinal() <= Determinism.USER_DETERMINISTIC.ordinal()) {
- context.setDeterminismLevel(fd.getDeterministic());
- }
-
- return result;
+ return fd.invokeFunction(values, context, null);
}
private Object evaluate(ScalarSubquery scalarSubquery, List<?> tuple)
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -37,6 +37,7 @@
import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.metadata.FunctionMethod.PushDown;
import org.teiid.query.QueryPlugin;
+import org.teiid.query.util.CommandContext;
/**
@@ -74,6 +75,16 @@
this.method = method;
}
+ public Object newInstance() {
+ try {
+ return invocationMethod.getDeclaringClass().newInstance();
+ } catch (InstantiationException e) {
+ throw new TeiidRuntimeException(QueryPlugin.Event.TEIID30602, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30602, method.getName(), method.getInvocationClass()));
+ } catch (IllegalAccessException e) {
+ throw new TeiidRuntimeException(QueryPlugin.Event.TEIID30602, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30602, method.getName(), method.getInvocationClass()));
+ }
+ }
+
public void setHasWrappedArgs(boolean hasWrappedArgs) {
this.hasWrappedArgs = hasWrappedArgs;
}
@@ -165,17 +176,25 @@
public void setMetadataID(Object metadataID) {
this.metadataID = metadataID;
}
+
+ public void checkNotPushdown() throws FunctionExecutionException {
+ // Check for function we can't evaluate
+ if(getPushdown() == PushDown.MUST_PUSHDOWN) {
+ throw new FunctionExecutionException(QueryPlugin.Event.TEIID30341, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30341, getName()));
+ }
+ }
/**
* Invoke the function described in the function descriptor, using the
* values provided. Return the result of the function.
- * @param fd Function descriptor describing the name and types of the arguments
* @param values Values that should match 1-to-1 with the types described in the
* function descriptor
+ * @param context
+ * @param functionTarget TODO
+ * @param fd Function descriptor describing the name and types of the arguments
* @return Result of invoking the function
*/
- public Object invokeFunction(Object[] values) throws FunctionExecutionException {
-
+ public Object invokeFunction(Object[] values, CommandContext context, Object functionTarget) throws FunctionExecutionException {
if (!isNullDependent()) {
for (int i = requiresContext?1:0; i < values.length; i++) {
if (values[i] == null) {
@@ -206,7 +225,10 @@
newValues[i - 1] = Arrays.copyOfRange(values, i - 1, values.length);
values = newValues;
}
- Object result = invocationMethod.invoke(null, values);
+ Object result = invocationMethod.invoke(functionTarget, values);
+ if (context != null && getDeterministic().ordinal() <= Determinism.USER_DETERMINISTIC.ordinal()) {
+ context.setDeterminismLevel(getDeterministic());
+ }
return importValue(result, getReturnType());
} catch(ArithmeticException e) {
throw new FunctionExecutionException(QueryPlugin.Event.TEIID30383, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30383, getName()));
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -327,7 +327,7 @@
if (invocationMethod != null) {
// Check return type is non void
Class<?> methodReturn = invocationMethod.getReturnType();
- if(methodReturn.equals(Void.TYPE)) {
+ if(method.getAggregateAttributes() == null && methodReturn.equals(Void.TYPE)) {
throw new TeiidRuntimeException(QueryPlugin.Event.TEIID30390, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30390, method.getName(), invocationMethod));
}
@@ -347,12 +347,15 @@
}
if (method.getAggregateAttributes() != null && !(UserDefinedAggregate.class.isAssignableFrom(method.getClass()))) {
- throw new TeiidRuntimeException(QueryPlugin.Event.TEIID30601, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30601, method.getName(), method.getInvocationClass(), UserDefinedAggregate.class.getName()));
+ throw new TeiidRuntimeException(QueryPlugin.Event.TEIID30601, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30601, method.getName(), method.getInvocationClass(), UserDefinedAggregate.class.getName()));
}
}
}
FunctionDescriptor result = new FunctionDescriptor(method, types, outputType, invocationMethod, requiresContext);
+ if (method.getAggregateAttributes() != null) {
+ result.newInstance();
+ }
result.setHasWrappedArgs(hasWrappedArg);
return result;
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -28,6 +28,7 @@
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.util.CommandContext;
/**
@@ -66,7 +67,7 @@
*/
public abstract void reset();
- public void addInput(List<?> tuple) throws TeiidComponentException, TeiidProcessingException {
+ public void addInput(List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException {
if (conditionIndex != -1 && !Boolean.TRUE.equals(tuple.get(conditionIndex))) {
return;
}
@@ -77,7 +78,7 @@
}
}
}
- addInputDirect(tuple);
+ addInputDirect(tuple, commandContext);
}
public boolean respectsNull() {
@@ -87,16 +88,18 @@
/**
* Called for the element value in every row of a group.
* @param tuple
+ * @param commandContext
* @throws TeiidProcessingException
*/
- public abstract void addInputDirect(List<?> tuple) throws TeiidComponentException, TeiidProcessingException;
+ public abstract void addInputDirect(List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException;
/**
* Called after all values have been processed to get the result.
+ * @param commandContext
* @return Result value
* @throws TeiidProcessingException
*/
- public abstract Object getResult()
+ public abstract Object getResult(CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException, TeiidProcessingException;
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -33,14 +33,9 @@
public class ArrayAgg extends SingleArgumentAggregateFunction {
private ArrayList<Object> result;
- private CommandContext context;
- public ArrayAgg(CommandContext context) {
- this.context = context;
- }
-
@Override
- public void addInputDirect(Object input, List<?> tuple) throws TeiidComponentException, TeiidProcessingException {
+ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException {
if (this.result == null) {
this.result = new ArrayList<Object>();
}
@@ -51,7 +46,7 @@
}
@Override
- public Object getResult() throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException,TeiidProcessingException {
+ public Object getResult(CommandContext commandContext) throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException,TeiidProcessingException {
if (this.result == null) {
return null;
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -31,6 +31,7 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.FunctionMethods;
+import org.teiid.query.util.CommandContext;
/**
@@ -60,22 +61,22 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext)
*/
- public void addInputDirect(Object input, List<?> tuple)
+ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
- super.addInputDirect(input, tuple);
+ super.addInputDirect(input, tuple, commandContext);
count++;
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
+ * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext)
*/
- public Object getResult()
+ public Object getResult(CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
- Object sum = super.getResult();
+ Object sum = super.getResult(commandContext);
if (count == 0 || sum == null) {
return null;
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -27,6 +27,7 @@
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
+import org.teiid.query.util.CommandContext;
/**
@@ -45,18 +46,18 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext)
*/
- public void addInputDirect(Object input, List<?> tuple)
+ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
value = input;
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
+ * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext)
*/
- public Object getResult()
+ public Object getResult(CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
return this.value;
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -26,6 +26,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.util.CommandContext;
/**
* Just a simple COUNT() implementation that counts every non-null row it sees.
@@ -39,15 +40,15 @@
}
@Override
- public void addInputDirect(List<?> tuple)
+ public void addInputDirect(List<?> tuple, CommandContext commandContext)
throws TeiidComponentException, TeiidProcessingException {
count++;
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
+ * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext)
*/
- public Object getResult() {
+ public Object getResult(CommandContext commandContext) {
return Integer.valueOf(count);
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -28,6 +28,7 @@
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.sql.symbol.Constant;
+import org.teiid.query.util.CommandContext;
/**
@@ -41,9 +42,9 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext)
*/
- public void addInputDirect(Object value, List<?> tuple)
+ public void addInputDirect(Object value, List<?> tuple, CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
if(maxValue == null) {
@@ -58,9 +59,9 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
+ * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext)
*/
- public Object getResult() {
+ public Object getResult(CommandContext commandContext) {
return this.maxValue;
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -28,6 +28,7 @@
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.sql.symbol.Constant;
+import org.teiid.query.util.CommandContext;
/**
@@ -41,9 +42,9 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext)
*/
- public void addInputDirect(Object value, List<?> tuple)
+ public void addInputDirect(Object value, List<?> tuple, CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
if(minValue == null) {
@@ -58,9 +59,9 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
+ * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext)
*/
- public Object getResult() {
+ public Object getResult(CommandContext commandContext) {
return this.minValue;
}
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 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/RankingFunction.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -28,6 +28,7 @@
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.sql.symbol.AggregateSymbol.Type;
+import org.teiid.query.util.CommandContext;
/**
* computes rank/dense_rank
@@ -49,7 +50,7 @@
}
@Override
- public void addInputDirect(List<?> tuple)
+ public void addInputDirect(List<?> tuple, CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException,
TeiidComponentException {
if (type == Type.RANK) {
@@ -58,7 +59,7 @@
}
@Override
- public Object getResult() throws FunctionExecutionException,
+ public Object getResult(CommandContext commandContext) throws FunctionExecutionException,
ExpressionEvaluationException, TeiidComponentException {
if (type == Type.DENSE_RANK) {
count++;
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/SingleArgumentAggregateFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/SingleArgumentAggregateFunction.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/SingleArgumentAggregateFunction.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -26,13 +26,14 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.util.CommandContext;
public abstract class SingleArgumentAggregateFunction extends AggregateFunction {
@Override
- public void addInputDirect(List<?> tuple)
+ public void addInputDirect(List<?> tuple, CommandContext commandContext)
throws TeiidComponentException, TeiidProcessingException {
- addInputDirect(tuple.get(argIndexes[0]), tuple);
+ addInputDirect(tuple.get(argIndexes[0]), tuple, commandContext);
}
public void initialize(java.lang.Class<?> dataType, java.lang.Class<?>[] inputTypes) {
@@ -47,6 +48,6 @@
}
- public abstract void addInputDirect(Object input, List<?> tuple)
+ public abstract void addInputDirect(Object input, List<?> tuple, CommandContext commandContext)
throws TeiidProcessingException, TeiidComponentException;
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -28,6 +28,7 @@
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.sql.symbol.AggregateSymbol.Type;
+import org.teiid.query.util.CommandContext;
public class StatsFunction extends SingleArgumentAggregateFunction {
@@ -48,7 +49,7 @@
}
@Override
- public void addInputDirect(Object input, List<?> tuple)
+ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException,
TeiidComponentException {
sum += ((Number)input).doubleValue();
@@ -57,7 +58,7 @@
}
@Override
- public Object getResult() throws FunctionExecutionException,
+ public Object getResult(CommandContext commandContext) throws FunctionExecutionException,
ExpressionEvaluationException, TeiidComponentException {
double result = 0;
switch (type) {
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Sum.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Sum.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Sum.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -30,6 +30,7 @@
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.query.util.CommandContext;
/**
@@ -85,9 +86,9 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext)
*/
- public void addInputDirect(Object input, List<?> tuple)
+ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
isNull = false;
@@ -117,9 +118,9 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
+ * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext)
*/
- public Object getResult()
+ public Object getResult(CommandContext commandContext)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
if (isNull){
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -50,15 +50,13 @@
public class TextAgg extends SingleArgumentAggregateFunction {
private FileStoreInputStreamFactory result;
- private CommandContext context;
private TextLine textLine;
- public TextAgg(CommandContext context, TextLine textLine) {
- this.context = context;
+ public TextAgg(TextLine textLine) {
this.textLine = textLine;
}
- private FileStoreInputStreamFactory buildResult() throws TeiidProcessingException {
+ private FileStoreInputStreamFactory buildResult(CommandContext context) throws TeiidProcessingException {
try {
FileStore fs = context.getBufferManager().createFileStore("textagg"); //$NON-NLS-1$
FileStoreInputStreamFactory fisf = new FileStoreInputStreamFactory(fs, textLine.getEncoding()==null?Streamable.ENCODING:textLine.getEncoding());
@@ -87,12 +85,12 @@
/**
* @throws TeiidProcessingException
* @throws TeiidComponentException
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext)
*/
- public void addInputDirect(Object input, List<?> tuple) throws TeiidComponentException, TeiidProcessingException {
+ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException {
try {
if (this.result == null) {
- this.result = buildResult();
+ this.result = buildResult(commandContext);
}
String in = (String)input;
Writer w = result.getWriter();
@@ -104,11 +102,11 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
+ * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext)
*/
- public Object getResult() throws TeiidProcessingException{
+ public Object getResult(CommandContext commandContext) throws TeiidProcessingException{
if (this.result == null) {
- this.result = buildResult();
+ this.result = buildResult(commandContext);
}
try {
Added: trunk/engine/src/main/java/org/teiid/query/function/aggregate/UserDefined.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/UserDefined.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/UserDefined.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.query.function.aggregate;
+
+import java.util.List;
+
+import org.teiid.UserDefinedAggregate;
+import org.teiid.api.exception.query.ExpressionEvaluationException;
+import org.teiid.api.exception.query.FunctionExecutionException;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.function.FunctionDescriptor;
+import org.teiid.query.util.CommandContext;
+
+public class UserDefined extends AggregateFunction {
+
+ private FunctionDescriptor fd;
+ private UserDefinedAggregate<?> instance;
+ private Object[] values;
+
+ public UserDefined(FunctionDescriptor functionDescriptor) {
+ this.fd = functionDescriptor;
+ this.instance = (UserDefinedAggregate<?>) fd.newInstance();
+ }
+
+ @Override
+ public void addInputDirect(List<?> tuple, CommandContext commandContext) throws TeiidComponentException,
+ TeiidProcessingException {
+ if (values == null) {
+ values = new Object[argIndexes.length + (fd.requiresContext()?1:0)];
+ }
+ if (fd.requiresContext()) {
+ values[0] = commandContext;
+ }
+ for (int i = 0; i < argIndexes.length; i++) {
+ values[i + (fd.requiresContext()?1:0)] = tuple.get(argIndexes[i]);
+ }
+ fd.invokeFunction(values, commandContext, instance);
+ }
+
+ @Override
+ public void reset() {
+ instance.reset();
+ }
+
+ @Override
+ public Object getResult(CommandContext commandContext) throws FunctionExecutionException,
+ ExpressionEvaluationException, TeiidComponentException,
+ TeiidProcessingException {
+ return instance.getResult(commandContext);
+ }
+
+}
Property changes on: trunk/engine/src/main/java/org/teiid/query/function/aggregate/UserDefined.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -37,10 +37,8 @@
private XMLType result;
private XmlConcat concat;
- private CommandContext context;
- public XMLAgg(CommandContext context) {
- this.context = context;
+ public XMLAgg() {
}
public void reset() {
@@ -51,11 +49,11 @@
/**
* @throws TeiidProcessingException
* @throws TeiidComponentException
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List, CommandContext, CommandContext)
*/
- public void addInputDirect(Object input, List<?> tuple) throws TeiidComponentException, TeiidProcessingException {
+ public void addInputDirect(Object input, List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException {
if (concat == null) {
- concat = new XmlConcat(context.getBufferManager());
+ concat = new XmlConcat(commandContext.getBufferManager());
}
concat.addValue(input);
}
@@ -63,9 +61,9 @@
/**
* @throws TeiidProcessingException
* @throws TeiidComponentException
- * @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
+ * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext)
*/
- public Object getResult() throws TeiidComponentException, TeiidProcessingException {
+ public Object getResult(CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException {
if (result == null) {
if (concat == null) {
return null;
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -178,7 +178,7 @@
int i = 0;
int j = 0;
for (Iterator<Expression> iter = symbols.iterator(); iter.hasNext(); ) {
- Expression ss = (Expression) iter.next();
+ Expression ss = iter.next();
Expression ex = SymbolMap.getExpression(ss);
if (ex instanceof Constant) {
projection[i] = ex;
@@ -208,7 +208,7 @@
Integer index = uniqueSymbols.get(SymbolMap.getExpression(item.getSymbol()));
if (index != null) {
item.setExpressionPosition(index);
- item.setSymbol((Expression) select.getSymbols().get(index));
+ item.setSymbol(select.getSymbols().get(index));
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -184,7 +184,7 @@
Class<?> outputType = symbol.getType();
if(symbol instanceof AggregateSymbol) {
AggregateSymbol aggSymbol = (AggregateSymbol) symbol;
- functions[i] = initAccumulator(context, aggSymbol, this, this.collectedExpressions);
+ functions[i] = initAccumulator(aggSymbol, this, this.collectedExpressions);
} else {
functions[i] = new ConstantFunction();
functions[i].setArgIndexes(new int[] {this.collectedExpressions.get(symbol)});
@@ -202,8 +202,8 @@
return index;
}
- static AggregateFunction initAccumulator(CommandContext context,
- AggregateSymbol aggSymbol, RelationalNode node, LinkedHashMap<Expression, Integer> expressionIndexes) {
+ static AggregateFunction initAccumulator(AggregateSymbol aggSymbol,
+ RelationalNode node, LinkedHashMap<Expression, Integer> expressionIndexes) {
int[] argIndexes = new int[aggSymbol.getArgs().length];
AggregateFunction result = null;
Expression[] args = aggSymbol.getArgs();
@@ -235,14 +235,16 @@
result = new Max();
break;
case XMLAGG:
- result = new XMLAgg(context);
+ result = new XMLAgg();
break;
case ARRAY_AGG:
- result = new ArrayAgg(context);
+ result = new ArrayAgg();
break;
case TEXTAGG:
- result = new TextAgg(context, (TextLine)args[0]);
- break;
+ result = new TextAgg((TextLine)args[0]);
+ break;
+ case USER_DEFINED:
+ result = new UserDefined(aggSymbol.getFunctionDescriptor());
default:
result = new StatsFunction(function);
}
@@ -382,7 +384,7 @@
// Close old group
List<Object> row = new ArrayList<Object>(functions.length);
for(int i=0; i<functions.length; i++) {
- row.add( functions[i].getResult() );
+ row.add( functions[i].getResult(getContext()) );
functions[i].reset();
}
@@ -404,7 +406,7 @@
// Close last group
List<Object> row = new ArrayList<Object>(functions.length);
for(int i=0; i<functions.length; i++) {
- row.add( functions[i].getResult() );
+ row.add( functions[i].getResult(getContext()) );
}
addBatchRow(row);
@@ -425,7 +427,7 @@
throws TeiidComponentException, TeiidProcessingException {
for(int i=0; i<functions.length; i++) {
- functions[i].addInput(tuple);
+ functions[i].addInput(tuple, getContext());
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -35,6 +35,7 @@
import org.teiid.query.processor.relational.SortUtility.Mode;
import org.teiid.query.sql.lang.OrderByItem;
import org.teiid.query.sql.symbol.ElementSymbol;
+import org.teiid.query.util.CommandContext;
/**
*/
@@ -97,7 +98,7 @@
}
@Override
- public void addInputDirect(List<?> tuple)
+ public void addInputDirect(List<?> tuple, CommandContext commandContext)
throws TeiidComponentException, TeiidProcessingException {
if(collectionBuffer == null) {
collectionBuffer = mgr.createTupleBuffer(elements, groupName, TupleSourceType.PROCESSOR);
@@ -113,9 +114,9 @@
/**
* @throws TeiidProcessingException
- * @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
+ * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext)
*/
- public Object getResult()
+ public Object getResult(CommandContext commandContext)
throws TeiidComponentException, TeiidProcessingException {
if(collectionBuffer != null) {
@@ -136,7 +137,7 @@
break;
}
//TODO should possibly remove the order by columns from this tuple
- this.proxy.addInputDirect(tuple);
+ this.proxy.addInputDirect(tuple, commandContext);
}
} finally {
sorted.remove();
@@ -146,7 +147,7 @@
}
// Return
- return this.proxy.getResult();
+ return this.proxy.getResult(commandContext);
}
@Override
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 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -350,10 +350,10 @@
}
}
for (AggregateFunction function : aggs) {
- function.addInput(tuple);
+ function.addInput(tuple, getContext());
}
for (AggregateFunction function : rowValueAggs) {
- function.addInput(tuple);
+ function.addInput(tuple, getContext());
}
lastRow = tuple;
}
@@ -375,7 +375,7 @@
List<Object> row = new ArrayList<Object>(aggs.size() + 1);
row.add(id);
for (AggregateFunction function : aggs) {
- row.add(function.getResult());
+ row.add(function.getResult(getContext()));
if (!samePartition) {
function.reset();
}
@@ -400,7 +400,7 @@
}
List<ElementSymbol> elements = new ArrayList<ElementSymbol>(functions.size());
for (WindowFunctionInfo wfi : functions) {
- aggs.add(GroupingNode.initAccumulator(this.getContext(), wfi.function.getFunction(), this, expressionIndexes));
+ aggs.add(GroupingNode.initAccumulator(wfi.function.getFunction(), this, expressionIndexes));
Class<?> outputType = wfi.function.getType();
ElementSymbol value = new ElementSymbol("val"); //$NON-NLS-1$
value.setType(outputType);
@@ -466,8 +466,10 @@
public void initialize(CommandContext context, BufferManager bufferManager,
ProcessorDataManager dataMgr) {
super.initialize(context, bufferManager, dataMgr);
- List<? extends Expression> sourceElements = this.getChildren()[0].getElements();
- this.elementMap = createLookupMap(sourceElements);
+ if (this.elementMap == null) {
+ List<? extends Expression> sourceElements = this.getChildren()[0].getElements();
+ this.elementMap = createLookupMap(sourceElements);
+ }
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -51,6 +51,7 @@
import org.teiid.query.sql.lang.*;
import org.teiid.query.sql.navigator.PostOrderNavigator;
import org.teiid.query.sql.symbol.*;
+import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.symbol.ElementSymbol.DisplayMode;
@@ -395,6 +396,9 @@
handleException(e);
}
}
+ if (obj.getAggregateFunction() == Type.USER_DEFINED) {
+ visit((Function)obj);
+ }
}
public TeiidComponentException getComponentException() {
Modified: trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -1352,7 +1352,7 @@
if (rightExpr instanceof Constant) {
Constant const2 = (Constant)rightExpr;
try {
- Object result = descriptor.invokeFunction(new Object[] { const2.getValue(), const1.getValue() } );
+ Object result = descriptor.invokeFunction(new Object[] { const2.getValue(), const1.getValue() }, null, this.context );
combinedConst = new Constant(result, descriptor.getReturnType());
} catch(FunctionExecutionException e) {
throw new QueryValidatorException(QueryPlugin.Event.TEIID30373, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30373, e.getMessage()));
@@ -1590,9 +1590,9 @@
}
Object value = ((Constant)rightExpr).getValue();
try {
- Object result = descriptor.invokeFunction(new Object[] {context, ((Constant)rightExpr).getValue(), format});
- result = leftFunction.getFunctionDescriptor().invokeFunction(new Object[] {context, result, format } );
- if (((Comparable)value).compareTo(result) != 0) {
+ Object result = descriptor.invokeFunction(new Object[] {context, ((Constant)rightExpr).getValue(), format}, null, this.context );
+ result = leftFunction.getFunctionDescriptor().invokeFunction(new Object[] {context, result, format }, null, this.context );
+ if (Constant.COMPARATOR.compare(value, result) != 0) {
return getSimpliedCriteria(crit, leftExpr, crit.getOperator() != CompareCriteria.EQ, true);
}
} catch(FunctionExecutionException e) {
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/Query.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/Query.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/Query.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -454,6 +454,6 @@
public boolean hasAggregates() {
return getGroupBy() != null
|| getHaving() != null
- || !AggregateSymbolCollectorVisitor.getAllAggregates(getSelect()).isEmpty();
+ || !AggregateSymbolCollectorVisitor.getAggregates(getSelect(), false).isEmpty();
}
} // END CLASS
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 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -132,12 +132,17 @@
* @param expression Contained expression
*/
public AggregateSymbol(String aggregateFunction, boolean isDistinct, Expression expression) {
- super(aggregateFunction, expression == null?EMPTY_ARGS:new Expression[] {expression});
+ this(aggregateFunction, isDistinct, expression == null?EMPTY_ARGS:new Expression[] {expression}, null);
+ }
+
+ public AggregateSymbol(String aggregateFunction, boolean isDistinct, Expression[] args, OrderBy orderBy) {
+ super(aggregateFunction, args);
this.aggregate = nameMap.get(aggregateFunction);
if (this.aggregate == null) {
this.aggregate = Type.USER_DEFINED;
}
this.distinct = isDistinct;
+ this.orderBy = orderBy;
}
/**
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/AggregateSymbolCollectorVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/AggregateSymbolCollectorVisitor.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/AggregateSymbolCollectorVisitor.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -33,7 +33,6 @@
import org.teiid.query.sql.symbol.AggregateSymbol;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.WindowFunction;
@@ -72,7 +71,6 @@
private Collection<? super AggregateSymbol> aggregates;
private Collection<? super ElementSymbol> otherElements;
private Collection<? super WindowFunction> windowFunctions;
- private Collection<? super Function> aggregateFunctions;
public AggregateSymbolCollectorVisitor(Collection<? super AggregateSymbol> aggregates, Collection<? super ElementSymbol> elements) {
this.aggregates = aggregates;
@@ -85,13 +83,6 @@
}
}
- @Override
- public void visit(Function obj) {
- if (aggregateFunctions != null && obj.isAggregate()) {
- this.aggregateFunctions.add(obj);
- }
- }
-
public void visit(WindowFunction windowFunction) {
if (this.windowFunctions != null) {
this.windowFunctions.add(windowFunction);
@@ -116,18 +107,6 @@
asn.visitNode(obj);
}
- public static final Collection<Function> getAllAggregates(LanguageObject obj) {
- if (obj == null) {
- return Collections.emptyList();
- }
- Collection<Function> aggregates = new ArrayList<Function>();
- AggregateSymbolCollectorVisitor visitor = new AggregateSymbolCollectorVisitor(aggregates, null);
- visitor.aggregateFunctions = aggregates;
- AggregateStopNavigator asn = new AggregateStopNavigator(visitor, null, null);
- obj.acceptVisitor(asn);
- return aggregates;
- }
-
public static final Collection<AggregateSymbol> getAggregates(LanguageObject obj, boolean removeDuplicates) {
if (obj == null) {
return Collections.emptyList();
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -1074,12 +1074,15 @@
// ############ Visitor methods for symbol objects ####################
public void visit( AggregateSymbol obj ) {
- append(obj.getAggregateFunction().name());
+ append(obj.getName());
append("("); //$NON-NLS-1$
if (obj.isDistinct()) {
append(DISTINCT);
append(" "); //$NON-NLS-1$
+ } else if (obj.getAggregateFunction() == Type.USER_DEFINED) {
+ append(ALL);
+ append(" "); //$NON-NLS-1$
}
if (obj.getArgs().length == 0) {
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -44,6 +44,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.EquivalenceUtil;
+import org.teiid.metadata.AggregateAttributes;
import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.FunctionLibrary;
@@ -324,6 +325,8 @@
} catch (IllegalArgumentException e) {
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_encoding", obj.getArg(1)), obj); //$NON-NLS-1$
}
+ } else if (obj.isAggregate()) {
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.user_defined_aggregate_as_function", obj, obj.getName()), obj); //$NON-NLS-1$
}
}
@@ -983,6 +986,18 @@
handleValidationError(QueryPlugin.Util.getString("SQLParser.Aggregate_only_top_level", obj), obj); //$NON-NLS-1$
return;
}
+ if (obj.getAggregateFunction() == AggregateSymbol.Type.USER_DEFINED) {
+ AggregateAttributes aa = obj.getFunctionDescriptor().getMethod().getAggregateAttributes();
+ if (!aa.allowsDistinct() && obj.isDistinct()) {
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.uda_not_allowed", "DISTINCT", obj), obj); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ if (!aa.allowsOrderBy() && obj.getOrderBy() != null) {
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.uda_not_allowed", "ORDER BY", obj), obj); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ if (!aa.isWindowable() && obj.isWindowed()) {
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.uda_not_allowed", "windowing", obj), obj); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
if (obj.getCondition() != null) {
Expression condition = obj.getCondition();
validateNoSubqueriesOrOuterReferences(condition);
Modified: trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2012-04-04 19:54:58 UTC (rev 3973)
@@ -3326,7 +3326,7 @@
(expression=aggregateSymbol(info) expression = windowSpecification(expression, info))
|
// Function
- LOOKAHEAD(2) (expression=function(info))
+ LOOKAHEAD(2) (expression=function(info) [expression = windowSpecification(expression, info)])
|
// ElementSymbol
(symbol=<ID>
@@ -3389,6 +3389,9 @@
{
WindowFunction result = new WindowFunction();
WindowSpecification ws = new WindowSpecification();
+ if (!(agg instanceof AggregateSymbol)) {
+ throw new ParseException(QueryPlugin.Util.getString("SQLParser.invalid_window", agg)); //$NON-NLS-1$
+ }
result.setFunction((AggregateSymbol)agg);
ws.setPartition(partitionList);
ws.setOrderBy(orderBy);
@@ -3477,6 +3480,9 @@
ArrayList args = new ArrayList(2);
ArrayList otherArgs = null;
Token funcToken = null;
+ Boolean distinct = null;
+ OrderBy orderBy = null;
+ Expression condition = null;
}
{
(( funcToken = <CONVERT>
@@ -3681,14 +3687,21 @@
|
( funcName = id()
<LPAREN>
+ [<ALL> { distinct = false; } | <DISTINCT> {distinct = true;} ]
[ args = expressionList(info) ]
+ [ orderBy = orderby(info) ]
<RPAREN>
+ condition = filterClause(info)
))
{
if(funcName == null) {
funcName = funcToken.image;
}
-
+ if (distinct != null || orderBy != null || condition != null) {
+ AggregateSymbol as = new AggregateSymbol(funcName, distinct, (Expression[])args.toArray(new Expression[args.size()]), orderBy);
+ as.setCondition(condition);
+ return as;
+ }
return new Function(funcName, (Expression[])args.toArray(new Expression[args.size()]));
}
}
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2012-04-04 19:54:58 UTC (rev 3973)
@@ -274,6 +274,7 @@
SQLParser.Invalid_short_name=Invalid simple identifier format: [{0}]
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}.
SystemSource.array_length_desc=Get the length of the given array value
SystemSource.array_param1=Array
SystemSource.array_length_result=The array length
@@ -673,6 +674,8 @@
ValidationVisitor.badlimit2=The row limit in the LIMIT clause must be >= 0
ValidationVisitor.invalid_scalar_group_reference=Cannot reference a scalar group as a table: {0}
ValidationVisitor.select_into_wrong_elements=Wrong number of elements being SELECTed INTO the target table. Expected {0} elements, but was {1}.
+ValidationVisitor.user_defined_aggregate_as_function=Cannot call user defined aggregate function {0} as a function. To disambiguate, please include an ALL keyword - {1}(ALL ...)
+ValidationVisitor.uda_not_allowed=User defined aggregate function does not allow {0}: {1}
SimpleQueryResolver.Query_was_redirected_to_Mat_table=The query against {0} was redirected to the materialization table {1}.
SimpleQueryResolver.ambiguous_all_in_group=The symbol {0} refers to more than one group defined in the FROM clause.
TEIID30114=Cannot access procedure {0} using table semantics since the parameter and result set column names are not all unique.
@@ -1060,4 +1063,5 @@
TEIID30600=User defined aggregate function "{0}" method "{1}" must not be static.
TEIID30601=User defined aggregate function "{0}" class "{1}" does not implement {2}
+TEIID30602=User defined aggregate function "{0}" class "{1}" does not provide a public no-arg constructor.
Modified: trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -227,11 +227,11 @@
for (int i = 0; i < inputs.length; i++) {
in[i+1] = inputs[i];
}
- actualOutput = descriptor.invokeFunction(in);
+ actualOutput = descriptor.invokeFunction(in, null, null);
}
else {
// Invoke function with inputs
- actualOutput = descriptor.invokeFunction(inputs);
+ actualOutput = descriptor.invokeFunction(inputs, null, null);
}
return actualOutput;
}
Modified: trunk/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -162,7 +162,7 @@
FunctionLibrary fl = new FunctionLibrary(sys, new FunctionTree("foo", new UDFSource(Arrays.asList(method)), true));
FunctionDescriptor fd = fl.findFunction("dummy", new Class<?>[] {DataTypeManager.DefaultDataClasses.VARBINARY});
String hello = "hello";
- assertEquals(hello, fd.invokeFunction(new Object[] {new BinaryType(hello.getBytes())}));
+ assertEquals(hello, fd.invokeFunction(new Object[] {new BinaryType(hello.getBytes())}, null, null));
}
/*
Modified: trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -5213,5 +5213,19 @@
assertEquals(DataTypeManager.DefaultDataClasses.VARBINARY, actualCommand.getSelect().getSymbol(0).getType());
assertEquals("SELECT X'AABBCC0A'", actualCommand.toString());
}
+
+ @Test public void testUserDefinedAggregateParsing() throws QueryParserException {
+ Query actualCommand = (Query)QueryParser.getQueryParser().parseCommand("SELECT foo(ALL x, y)", new ParseInfo());
+ assertEquals("SELECT foo(ALL x, y)", actualCommand.toString());
+ }
+ @Test(expected=QueryParserException.class) public void testWindowedExpression() throws QueryParserException {
+ QueryParser.getQueryParser().parseCommand("SELECT foo(x, y) over ()", new ParseInfo());
+ }
+
+ @Test public void testWindowedExpression1() throws QueryParserException {
+ Query actualCommand = (Query)QueryParser.getQueryParser().parseCommand("SELECT foo(distinct x, y) over ()", new ParseInfo());
+ assertEquals("SELECT foo(DISTINCT x, y) OVER ()", actualCommand.toString());
+ }
+
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestDuplicateFilter.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestDuplicateFilter.java 2012-04-04 19:49:28 UTC (rev 3972)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestDuplicateFilter.java 2012-04-04 19:54:58 UTC (rev 3973)
@@ -52,10 +52,10 @@
// Add inputs
for(int i=0; i<input.length; i++) {
- filter.addInputDirect(Arrays.asList(input[i]));
+ filter.addInputDirect(Arrays.asList(input[i]), null);
}
- Integer actual = (Integer) filter.getResult();
+ Integer actual = (Integer) filter.getResult(null);
assertEquals("Did not get expected number of results", expected, actual.intValue()); //$NON-NLS-1$
}
12 years, 8 months
teiid SVN: r3972 - in branches/7.4.x/engine/src: test/java/org/teiid/query/processor and 1 other directory.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2012-04-04 15:49:28 -0400 (Wed, 04 Apr 2012)
New Revision: 3972
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java
branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestDependentJoins.java
Log:
TEIID-1868 TEIID-1533 refining the backoff logic to not be used unless the ndv is known.
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java 2012-04-04 19:49:13 UTC (rev 3971)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java 2012-04-04 19:49:28 UTC (rev 3972)
@@ -1161,7 +1161,12 @@
for (int i = 0; i < independentExpressions.size(); i++) {
Expression indExpr = (Expression)independentExpressions.get(i);
Collection<ElementSymbol> indElements = ElementCollectorVisitor.getElements(indExpr, true);
- float indSymbolNDV = getNDVEstimate(independentNode, metadata, independentCardinality, indElements, true);
+ float indSymbolNDV = getNDVEstimate(independentNode, metadata, independentCardinality, indElements, false);
+ boolean unknownNDV = false;
+ if (indSymbolNDV == UNKNOWN_VALUE) {
+ unknownNDV = true;
+ indSymbolNDV = independentCardinality/2;
+ }
Expression depExpr = (Expression)dependentExpressions.get(i);
LinkedList<Expression> depExpressions = new LinkedList<Expression>();
@@ -1220,6 +1225,7 @@
}
}
depSymbolNDV = Math.max((float)Math.pow(depTargetCardinality, .75), Math.min(indSymbolOrigNDV, depTargetCardinality));
+ unknownNDV = true;
} else {
depSymbolNDV = depTargetCardinality;
}
@@ -1236,6 +1242,10 @@
dca.expectedCardinality = Math.min(dca.expectedCardinality, estimates[0]);
}
}
+ //don't use the ndv if it is unknown
+ if (unknownNDV) {
+ continue;
+ }
dca.expectedNdv[i] = indSymbolNDV;
//use a quick binary search to find the max ndv
float min = 0;
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestDependentJoins.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestDependentJoins.java 2012-04-04 19:49:13 UTC (rev 3971)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestDependentJoins.java 2012-04-04 19:49:28 UTC (rev 3972)
@@ -29,9 +29,11 @@
import java.util.List;
import org.junit.Test;
+import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.metadata.TransformationMetadata;
import org.teiid.query.optimizer.TestOptimizer;
import org.teiid.query.optimizer.TestOptimizer.ComparisonMode;
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
@@ -832,17 +834,40 @@
}
@Test public void testDependentJoinBackoff() throws Exception {
- // Create query
+ FakeDataManager dataManager = helpTestBackoff(true);
+
+ //note that the dependent join was not actually performed
+ assertEquals(new HashSet<String>(Arrays.asList("SELECT pm1.g1.e1 FROM pm1.g1", "SELECT pm6.g1.e1 FROM pm6.g1 ORDER BY pm6.g1.e1")),
+ new HashSet<String>(dataManager.getQueries()));
+ }
+
+ @Test public void testDependentJoinBackoff1() throws Exception {
+ FakeDataManager dataManager = helpTestBackoff(false);
+
+ //note that the dependent join was performed
+ assertEquals(4, new HashSet<String>(dataManager.getQueries()).size());
+ }
+
+ private FakeDataManager helpTestBackoff(boolean setNdv) throws Exception,
+ QueryMetadataException, TeiidComponentException,
+ TeiidProcessingException {
+ // Create query
String sql = "SELECT pm1.g1.e1 FROM pm1.g1, pm6.g1 WHERE pm1.g1.e1=pm6.g1.e1"; //$NON-NLS-1$
// Construct data manager with data
FakeDataManager dataManager = new FakeDataManager();
sampleData4(dataManager);
- QueryMetadataInterface fakeMetadata = RealMetadataFactory.example1();
+ TransformationMetadata fakeMetadata = RealMetadataFactory.example1();
RealMetadataFactory.setCardinality("pm1.g1", 1, fakeMetadata);
+ if (setNdv) {
+ fakeMetadata.getElementID("pm1.g1.e1").setDistinctValues(1);
+ }
RealMetadataFactory.setCardinality("pm6.g1", 1000, fakeMetadata);
+ if (setNdv) {
+ fakeMetadata.getElementID("pm6.g1.e1").setDistinctValues(1000);
+ }
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities depcaps = new BasicSourceCapabilities();
@@ -867,11 +892,8 @@
// Run query
TestProcessor.helpProcess(plan, dataManager, expected);
-
- //note that the dependent join was not actually performed
- assertEquals(new HashSet<String>(Arrays.asList("SELECT pm1.g1.e1 FROM pm1.g1", "SELECT pm6.g1.e1 FROM pm6.g1 ORDER BY pm6.g1.e1")),
- new HashSet<String>(dataManager.getQueries()));
- }
+ return dataManager;
+ }
@Test public void testDjHint() {
// Create query
12 years, 8 months
teiid SVN: r3971 - branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2012-04-04 15:49:13 -0400 (Wed, 04 Apr 2012)
New Revision: 3971
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java
Log:
TEIID-1899 fixing assertion error during join
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java 2012-04-04 02:29:57 UTC (rev 3970)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java 2012-04-04 19:49:13 UTC (rev 3971)
@@ -82,6 +82,7 @@
private DependentValueSource dvs;
private List<SetState> dependentSetStates = new LinkedList<SetState>();
private String valueSource;
+ private DependentValueSource originalVs;
public TupleState(String source) {
this.valueSource = source;
@@ -90,7 +91,7 @@
public void sort() throws BlockedException,
TeiidComponentException, TeiidProcessingException {
if (dvs == null) {
- DependentValueSource originalVs = (DependentValueSource)dependentNode.getContext().getVariableContext().getGlobalValue(valueSource);
+ originalVs = (DependentValueSource)dependentNode.getContext().getVariableContext().getGlobalValue(valueSource);
if (!originalVs.isDistinct()) {
if (sortUtility == null) {
List<Expression> sortSymbols = new ArrayList<Expression>(dependentSetStates.size());
@@ -130,7 +131,9 @@
public void close() {
if (dvs != null) {
sortUtility = null;
- dvs.getTupleBuffer().remove();
+ if (dvs != originalVs) {
+ dvs.getTupleBuffer().remove();
+ }
dvs = null;
}
}
@@ -364,6 +367,11 @@
}
hasNextCommand = !restartIndexes.isEmpty();
+ if (hasNextCommand && dependentState.size() > 1) {
+ for (TupleState state : dependentState.values()) {
+ state.originalVs.setUnused(true);
+ }
+ }
}
protected boolean hasNextCommand() {
12 years, 8 months
teiid SVN: r3970 - in trunk/engine/src: test/java/org/teiid/query/metadata and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-04-03 22:29:57 -0400 (Tue, 03 Apr 2012)
New Revision: 3970
Modified:
trunk/engine/src/main/java/org/teiid/query/metadata/MetadataValidator.java
trunk/engine/src/test/java/org/teiid/query/metadata/TestMetadataValidator.java
trunk/engine/src/test/java/org/teiid/query/parser/TestDDLParser.java
Log:
TEIID-1280 adding a tempmetadatawrapper for view validation
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/MetadataValidator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/MetadataValidator.java 2012-04-03 17:03:31 UTC (rev 3969)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/MetadataValidator.java 2012-04-04 02:29:57 UTC (rev 3970)
@@ -34,16 +34,7 @@
import org.teiid.language.SQLConstants;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.metadata.AbstractMetadataRecord;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.Datatype;
-import org.teiid.metadata.ForeignKey;
-import org.teiid.metadata.FunctionMethod;
-import org.teiid.metadata.KeyRecord;
-import org.teiid.metadata.MetadataStore;
-import org.teiid.metadata.Procedure;
-import org.teiid.metadata.Schema;
-import org.teiid.metadata.Table;
+import org.teiid.metadata.*;
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.metadata.FunctionMetadataValidator;
import org.teiid.query.mapping.relational.QueryNode;
@@ -186,6 +177,7 @@
private static void validate(VDBMetaData vdb, ModelMetaData model, AbstractMetadataRecord record, MetadataStore store, ValidatorReport report) {
QueryMetadataInterface metadata = vdb.getAttachment(QueryMetadataInterface.class);
+ metadata = new TempMetadataAdapter(metadata, new TempMetadataStore()); //TODO: optimize this
ValidatorReport resolverReport = null;
try {
if (record instanceof Procedure) {
@@ -193,8 +185,7 @@
Command command = QueryParser.getQueryParser().parseCommand(p.getQueryPlan());
QueryResolver.resolveCommand(command, new GroupSymbol(p.getFullName()), Command.TYPE_STORED_PROCEDURE, metadata);
resolverReport = Validator.validate(command, metadata);
- }
- if (record instanceof Table) {
+ } else if (record instanceof Table) {
Table t = (Table)record;
if (t.isVirtual() && (t.getColumns() == null || t.getColumns().isEmpty())) {
Modified: trunk/engine/src/test/java/org/teiid/query/metadata/TestMetadataValidator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/metadata/TestMetadataValidator.java 2012-04-03 17:03:31 UTC (rev 3969)
+++ trunk/engine/src/test/java/org/teiid/query/metadata/TestMetadataValidator.java 2012-04-04 02:29:57 UTC (rev 3970)
@@ -63,6 +63,7 @@
DDLMetadataRepository repo = new DDLMetadataRepository();
MetadataFactory mf = new MetadataFactory("myVDB",1, modelName, TestDDLParser.getDataTypes(), new Properties(), ddl);
+ mf.setPhysical(physical);
repo.loadMetadata(mf, null, null);
mf.mergeInto(store);
return model;
@@ -128,6 +129,26 @@
assertTrue(printError(report), report.hasItems());
}
+ @Test public void testProcMetadata() throws Exception {
+ String ddl = "create virtual procedure proc1(IN e1 varchar) RETURNS (e1 integer, e2 varchar(12)) AS begin create local temporary table x (e1 integer, e2 varchar); select * from x; end;" +
+ "create virtual procedure proc2(IN e1 varchar) RETURNS (e1 integer, e2 varchar(12)) AS select x.* from (exec proc1('a')) as X; ";
+ buildModel("vm1", false, this.vdb, this.store, ddl);
+ buildTransformationMetadata();
+ ValidatorReport report = new ValidatorReport();
+ new MetadataValidator.ResolveQueryPlans().execute(vdb, store, report);
+ assertFalse(printError(report), report.hasItems());
+ }
+
+ @Test public void testResolveTempMetadata() throws Exception {
+ String ddl = "create virtual procedure proc1() RETURNS (e1 integer, e2 varchar(12)) AS begin create local temporary table x (e1 integer, e2 varchar); select * from x; end;" +
+ "create view z (e1 integer, e2 varchar(12)) AS select x.* from (exec proc1()) as X, (exec proc1()) as Y; ";
+ buildModel("vm1", false, this.vdb, this.store, ddl);
+ buildTransformationMetadata();
+ ValidatorReport report = new ValidatorReport();
+ new MetadataValidator.ResolveQueryPlans().execute(vdb, store, report);
+ assertFalse(printError(report), report.hasItems());
+ }
+
@Test
public void testResolveMetadataError() throws Exception {
buildModel("vm1", false, this.vdb, this.store, "create view g1 (e1 integer, e2 varchar(12)) AS select * from pm1.g1; create view g2 AS select * from pm1.g1;");
Modified: trunk/engine/src/test/java/org/teiid/query/parser/TestDDLParser.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestDDLParser.java 2012-04-03 17:03:31 UTC (rev 3969)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestDDLParser.java 2012-04-04 02:29:57 UTC (rev 3970)
@@ -20,13 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*/
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
-import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -36,18 +31,8 @@
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.metadata.*;
import org.teiid.metadata.BaseColumn.NullType;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.ColumnSet;
-import org.teiid.metadata.Datatype;
-import org.teiid.metadata.ForeignKey;
-import org.teiid.metadata.FunctionMethod;
-import org.teiid.metadata.MetadataFactory;
-import org.teiid.metadata.MetadataStore;
-import org.teiid.metadata.Procedure;
-import org.teiid.metadata.ProcedureParameter;
-import org.teiid.metadata.Schema;
-import org.teiid.metadata.Table;
import org.teiid.query.metadata.MetadataValidator;
import org.teiid.query.validator.ValidatorReport;
@@ -101,7 +86,7 @@
assertEquals("primary key not same", e1, table.getPrimaryKey().getColumns().get(0));
assertEquals("e2", e2.getName());
- assertEquals("varchar", e2.getDatatype().getName());
+ assertEquals("string", e2.getDatatype().getName());
assertEquals("unique", e2, table.getUniqueKeys().get(0).getColumns().get(0));
assertEquals(NullType.Nullable, e2.getNullType());
assertEquals(10, e2.getLength());
@@ -113,7 +98,7 @@
assertEquals(NullType.No_Nulls, e3.getNullType());
assertEquals("e4", e4.getName());
- assertEquals("decimal", e4.getDatatype().getName());
+ assertEquals("bigdecimal", e4.getDatatype().getName());
assertEquals(false, e4.isAutoIncremented());
assertEquals(12, e4.getPrecision());
assertEquals(3, e4.getScale());
@@ -127,22 +112,18 @@
assertEquals("index", e5, table.getIndexes().get(0).getColumns().get(0));
assertEquals("e6", e6.getName());
- assertEquals("varchar", e6.getDatatype().getName());
+ assertEquals("string", e6.getDatatype().getName());
assertEquals("index", e6, table.getIndexes().get(1).getColumns().get(0));
assertEquals("hello", e6.getDefaultValue());
}
- @Test
+ @Test(expected=ParseException.class)
public void testDuplicatePrimarykey() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1( e1 integer primary key, e2 varchar primary key)";
- try {
- MetadataStore mds = new MetadataStore();
- MetadataFactory mf = new MetadataFactory(null, 1, "model", getDataTypes(), new Properties(), null);
- parser.parseDDL(mf, ddl);
- mf.mergeInto(mds);
- fail("two keys can ot be primary keys");
- } catch (Exception e) {
- }
+ MetadataStore mds = new MetadataStore();
+ MetadataFactory mf = new MetadataFactory(null, 1, "model", getDataTypes(), new Properties(), null);
+ parser.parseDDL(mf, ddl);
+ mf.mergeInto(mds);
}
@Test
@@ -429,13 +410,13 @@
FunctionMethod fm = s.getFunction("SourceFunc");
assertNotNull(fm);
- assertEquals("varchar", fm.getOutputParameter().getType());
+ assertEquals("string", fm.getOutputParameter().getType());
assertEquals(FunctionMethod.PushDown.CAN_PUSHDOWN, fm.getPushdown());
assertEquals(2, fm.getInputParameterCount());
assertEquals("flag", fm.getInputParameters().get(0).getName());
assertEquals("boolean", fm.getInputParameters().get(0).getType());
assertEquals("msg", fm.getInputParameters().get(1).getName());
- assertEquals("varchar", fm.getInputParameters().get(1).getType());
+ assertEquals("string", fm.getInputParameters().get(1).getType());
assertFalse( fm.getInputParameters().get(1).isVarArg());
assertEquals(FunctionMethod.Determinism.DETERMINISTIC, fm.getDeterminism());
@@ -477,20 +458,20 @@
assertEquals(ProcedureParameter.Type.Out, proc.getParameters().get(0).getType());
assertEquals("p2", proc.getParameters().get(1).getName());
- assertEquals("varchar", proc.getParameters().get(1).getDatatype().getName());
+ assertEquals("string", proc.getParameters().get(1).getDatatype().getName());
assertEquals(ProcedureParameter.Type.In, proc.getParameters().get(1).getType());
assertEquals("p3", proc.getParameters().get(2).getName());
- assertEquals("decimal", proc.getParameters().get(2).getDatatype().getName());
+ assertEquals("bigdecimal", proc.getParameters().get(2).getDatatype().getName());
assertEquals(ProcedureParameter.Type.InOut, proc.getParameters().get(2).getType());
ColumnSet<Procedure> ret = proc.getResultSet();
assertNotNull(ret);
assertEquals(2, ret.getColumns().size());
assertEquals("r1", ret.getColumns().get(0).getName());
- assertEquals("varchar", ret.getColumns().get(0).getDatatype().getName());
+ assertEquals("string", ret.getColumns().get(0).getDatatype().getName());
assertEquals("r2", ret.getColumns().get(1).getName());
- assertEquals("decimal", ret.getColumns().get(1).getDatatype().getName());
+ assertEquals("bigdecimal", ret.getColumns().get(1).getDatatype().getName());
assertEquals("uuid", proc.getUUID());
assertEquals("nis", proc.getNameInSource());
@@ -540,20 +521,20 @@
assertEquals(ProcedureParameter.Type.Out, proc.getParameters().get(0).getType());
assertEquals("p2", proc.getParameters().get(1).getName());
- assertEquals("varchar", proc.getParameters().get(1).getDatatype().getName());
+ assertEquals("string", proc.getParameters().get(1).getDatatype().getName());
assertEquals(ProcedureParameter.Type.In, proc.getParameters().get(1).getType());
assertEquals("p3", proc.getParameters().get(2).getName());
- assertEquals("decimal", proc.getParameters().get(2).getDatatype().getName());
+ assertEquals("bigdecimal", proc.getParameters().get(2).getDatatype().getName());
assertEquals(ProcedureParameter.Type.InOut, proc.getParameters().get(2).getType());
ColumnSet<Procedure> ret = proc.getResultSet();
assertNotNull(ret);
assertEquals(2, ret.getColumns().size());
assertEquals("r1", ret.getColumns().get(0).getName());
- assertEquals("varchar", ret.getColumns().get(0).getDatatype().getName());
+ assertEquals("string", ret.getColumns().get(0).getDatatype().getName());
assertEquals("r2", ret.getColumns().get(1).getName());
- assertEquals("decimal", ret.getColumns().get(1).getDatatype().getName());
+ assertEquals("bigdecimal", ret.getColumns().get(1).getDatatype().getName());
assertEquals("uuid", proc.getUUID());
assertEquals("nis", proc.getNameInSource());
@@ -581,23 +562,19 @@
return mf;
}
+ //TODO: could elevate type logic out of metadata
public static Map<String, Datatype> getDataTypes() {
Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
for (String name:DataTypeManager.getAllDataTypeNames()) {
Datatype dt = new Datatype();
dt.setName(name);
- dt.setJavaClassName(DataTypeManager.getDataTypeClass(name).getName());
+ Class<?> dataTypeClass = DataTypeManager.getDataTypeClass(name);
+ dt.setJavaClassName(dataTypeClass.getName());
+ dt.setRuntimeTypeName(DataTypeManager.getDataTypeName(dataTypeClass));
datatypes.put(name, dt);
}
- Datatype dt = new Datatype();
- dt.setName("varchar");
- datatypes.put("varchar", dt);
- dt.setJavaClassName(String.class.getName());
-
- dt = new Datatype();
- dt.setName("decimal");
- datatypes.put("decimal", dt);
- dt.setJavaClassName(BigDecimal.class.getName());
+ datatypes.put("varchar", datatypes.get(DataTypeManager.DefaultDataTypes.STRING));
+ datatypes.put("decimal", datatypes.get(DataTypeManager.DefaultDataTypes.BIG_DECIMAL));
return datatypes;
}
}
12 years, 8 months
teiid SVN: r3969 - in trunk: admin and 30 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-04-03 13:03:31 -0400 (Tue, 03 Apr 2012)
New Revision: 3969
Modified:
trunk/admin/pom.xml
trunk/adminshell/pom.xml
trunk/api/pom.xml
trunk/build/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-hive/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/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/admin/pom.xml
===================================================================
--- trunk/admin/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/admin/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-admin</artifactId>
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/adminshell/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/api/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/build/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/client/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/client-jdk15/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/common-core/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/connector-file/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/connector-ldap/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/connector-salesforce/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/connector-ws/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/salesforce-api/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/sandbox/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/translator-file/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Modified: trunk/connectors/translator-hive/pom.xml
===================================================================
--- trunk/connectors/translator-hive/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/translator-hive/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-hive</artifactId>
Modified: trunk/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/translator-jdbc/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/translator-ldap/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/translator-loopback/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/translator-olap/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/translator-salesforce/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/connectors/translator-ws/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/engine/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/hibernate-dialect/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/jboss-integration/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/metadata/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -10,7 +10,7 @@
<artifactId>teiid-parent</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
@@ -37,9 +37,9 @@
<version.junit>4.10</version.junit>
</properties>
<scm>
- <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/tags/teiid-parent-8.0.0.Beta2</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-parent-8.0.0.Beta2</developerConnection>
- <url>http://anonsvn.jboss.org/repos/teiid/tags/teiid-parent-8.0.0.Beta2</url>
+ <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/trunk</developerConnection>
+ <url>http://anonsvn.jboss.org/repos/teiid/trunk</url>
</scm>
<licenses>
<license>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/runtime/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/test-integration/common/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.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 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/test-integration/db/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2012-04-03 17:03:12 UTC (rev 3968)
+++ trunk/test-integration/pom.xml 2012-04-03 17:03:31 UTC (rev 3969)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>8.0.0.Beta2</version>
+ <version>8.0.0.CR1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
12 years, 8 months