use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class EvaluatorIterator method init.
@Override
public void init(SortedKeyValueIterator<Key, Value> source, Map<String, String> options, IteratorEnvironment env) throws IOException {
super.init(source, options, env);
try {
GroupSymbol gs = null;
String query = options.get(QUERYSTRING);
TransformationMetadata tm = createTransformationMetadata(options.get(DDL));
this.criteria = QueryParser.getQueryParser().parseCriteria(query);
this.elementsInExpression = ElementCollectorVisitor.getElements(this.criteria, false);
for (ElementSymbol es : this.elementsInExpression) {
gs = es.getGroupSymbol();
ResolverUtil.resolveGroup(gs, tm);
}
ResolverVisitor.resolveLanguageObject(this.criteria, tm);
this.evaluatorUtil = new EvaluatorUtil(gs);
} catch (QueryParserException e) {
throw new IOException(e);
} catch (ClassNotFoundException e) {
throw new IOException(e);
} catch (QueryResolverException e) {
throw new IOException(e);
} catch (TeiidComponentException e) {
throw new IOException(e);
}
CommandContext cc = new CommandContext();
this.evaluator = new Evaluator(this.evaluatorUtil.getElementMap(), null, cc);
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestElementImpl method helpIntExample.
public static ElementSymbol helpIntExample(String groupName, String elementName) {
ElementSymbol symbol = new ElementSymbol(elementName);
symbol.setType(Integer.class);
symbol.setGroupSymbol(TestGroupImpl.helpExample(groupName));
return symbol;
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestElementImpl method helpExample.
public static ElementSymbol helpExample(String groupName, String elementName) {
ElementSymbol symbol = new ElementSymbol(elementName);
symbol.setType(String.class);
symbol.setGroupSymbol(TestGroupImpl.helpExample(groupName));
return symbol;
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestSubqueryCompareCriteriaImpl method helpExample.
public static SubqueryCompareCriteria helpExample() {
// $NON-NLS-1$ //$NON-NLS-2$
ElementSymbol element = TestElementImpl.helpExample("g1", "e1");
Query query = TestQueryImpl.helpExample(true);
SubqueryCompareCriteria scc = new SubqueryCompareCriteria(element, query, AbstractCompareCriteria.GT, SubqueryCompareCriteria.ANY);
return scc;
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestSubqueryInCriteriaImpl method helpExample.
public static SubquerySetCriteria helpExample() {
// $NON-NLS-1$ //$NON-NLS-2$
ElementSymbol element = TestElementImpl.helpExample("g1", "e1");
Query query = TestQueryImpl.helpExample(true);
SubquerySetCriteria ssc = new SubquerySetCriteria(element, query);
ssc.setNegated(true);
return ssc;
}
Aggregations