use of org.teiid.dqp.internal.process.multisource.MultiSourceMetadataWrapper in project teiid by teiid.
the class TestValidator method testMultiSourceProcValue.
@Test
public void testMultiSourceProcValue() throws Exception {
Set<String> models = new HashSet<String>();
models.add("MultiModel");
// $NON-NLS-1$
helpValidate("exec MultiModel.proc('a', (select 1))", new String[] {}, new MultiSourceMetadataWrapper(RealMetadataFactory.exampleMultiBinding(), models));
}
use of org.teiid.dqp.internal.process.multisource.MultiSourceMetadataWrapper in project teiid by teiid.
the class TestValidator method testDisallowUpdateOnMultisourceElement.
@Test
public void testDisallowUpdateOnMultisourceElement() throws Exception {
Set<String> models = new HashSet<String>();
models.add("pm1");
// $NON-NLS-1$
ValidatorReport report = helpValidateInModeler("pm1.vsp36", "UPDATE PM1.G1 set SOURCE_NAME='blah'", new MultiSourceMetadataWrapper(RealMetadataFactory.example1(), models));
assertEquals(report.toString(), 1, report.getItems().size());
}
use of org.teiid.dqp.internal.process.multisource.MultiSourceMetadataWrapper in project teiid by teiid.
the class TestValidator method testDisallowProjectIntoMultiSource.
/**
* TODO: this should be allowable
*/
@Test
public void testDisallowProjectIntoMultiSource() throws Exception {
Set<String> models = new HashSet<String>();
models.add("pm1");
// $NON-NLS-1$
helpValidate("insert into pm1.g1 select pm1.g1.*, 1 from pm1.g1", new String[] { "pm1.g1" }, new MultiSourceMetadataWrapper(RealMetadataFactory.example1(), models));
}
use of org.teiid.dqp.internal.process.multisource.MultiSourceMetadataWrapper in project teiid by teiid.
the class TestValidator method testMultiSourceInsert.
@Test
public void testMultiSourceInsert() throws Exception {
Set<String> models = new HashSet<String>();
models.add("pm1");
// $NON-NLS-1$
helpValidate("insert into pm1.g1 (e1) values (1)", new String[] { "pm1.g1", "pm1.g1.SOURCE_NAME" }, new MultiSourceMetadataWrapper(RealMetadataFactory.example1(), models));
}
use of org.teiid.dqp.internal.process.multisource.MultiSourceMetadataWrapper in project teiid by teiid.
the class CompositeVDB method metadataLoadFinished.
public void metadataLoadFinished(boolean allowEnv) {
if (this.metadataloadFinished) {
return;
}
this.metadataloadFinished = true;
MetadataStore mergedStore = getMetadataStore();
// the order of the models is important for resolving ddl
// TODO we might consider not using the intermediate MetadataStore
List<Schema> schemas = mergedStore.getSchemaList();
schemas.clear();
for (ModelMetaData model : this.vdb.getModelMetaDatas().values()) {
Schema s = mergedStore.getSchema(model.getName());
if (s != null) {
schemas.add(s);
} else {
mergedStore.getSchemas().remove(model.getName());
}
}
if (this.children != null && !this.children.isEmpty()) {
for (CompositeVDB child : this.children.values()) {
MetadataStore childStore = child.getMetadataStore();
if (childStore != null) {
mergedStore.merge(childStore);
}
}
}
TransformationMetadata metadata = buildTransformationMetaData(mergedVDB, getVisibilityMap(), mergedStore, getUDF(), systemFunctions, this.additionalStores, allowEnv);
QueryMetadataInterface qmi = metadata;
Map<String, String> multiSourceModels = MultiSourceMetadataWrapper.getMultiSourceModels(mergedVDB);
if (multiSourceModels != null && !multiSourceModels.isEmpty()) {
qmi = new MultiSourceMetadataWrapper(metadata, multiSourceModels);
}
mergedVDB.addAttchment(QueryMetadataInterface.class, qmi);
mergedVDB.addAttchment(TransformationMetadata.class, metadata);
mergedVDB.addAttchment(MetadataStore.class, mergedStore);
}
Aggregations