try {
QueryResolverVisitor qrv = new QueryResolverVisitor(query, metadata);
qrv.visit(query);
ResolverVisitor visitor = (ResolverVisitor)qrv.getVisitor();
visitor.throwException(true);
} catch (TeiidRuntimeException e) {
if (e.getChild() instanceof QueryMetadataException) {
throw (QueryMetadataException)e.getChild();
}
if (e.getChild() instanceof QueryResolverException) {