use of org.teiid.query.metadata.BasicQueryMetadataWrapper in project teiid by teiid.
the class TranslationUtility method initWrapper.
private void initWrapper(QueryMetadataInterface acutalMetadata) {
functionLibrary = acutalMetadata.getFunctionLibrary();
this.functions.addAll(Arrays.asList(this.functionLibrary.getUserFunctions()));
metadata = new BasicQueryMetadataWrapper(acutalMetadata) {
@Override
public FunctionLibrary getFunctionLibrary() {
return functionLibrary;
}
};
}
use of org.teiid.query.metadata.BasicQueryMetadataWrapper in project teiid by teiid.
the class TestElementSymbolOptimizer method helpTestOptimize.
public void helpTestOptimize(String sql, QueryMetadataInterface metadata, String expected) throws QueryMetadataException, TeiidComponentException, QueryParserException, QueryResolverException {
Command command = helpResolve(sql, new BasicQueryMetadataWrapper(metadata) {
@Override
public boolean findShortName() {
return true;
}
});
String actual = command.toString();
// $NON-NLS-1$
assertEquals("Expected different optimized string", expected, actual);
}
use of org.teiid.query.metadata.BasicQueryMetadataWrapper in project teiid by teiid.
the class TestElementSymbolOptimizer method testOutputNames.
@Test
public void testOutputNames() throws Exception {
String sql = "select PM1.g1.e1, e2 FROM Pm1.G1";
Command command = QueryParser.getQueryParser().parseCommand(sql);
QueryMetadataInterface metadata = new BasicQueryMetadataWrapper(RealMetadataFactory.example1Cached()) {
public boolean useOutputName() {
return false;
}
};
QueryResolver.resolveCommand(command, metadata);
assertEquals("SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1", command.toString());
}
Aggregations