Search in sources :

Example 1 with CollectionValueIterator

use of org.teiid.query.sql.lang.CollectionValueIterator in project teiid by teiid.

the class TestExpressionEvaluator method helpTestWithValueIterator.

private void helpTestWithValueIterator(ScalarSubquery expr, List<?> values, Object expected) throws BlockedException, TeiidComponentException, ExpressionEvaluationException {
    final CollectionValueIterator valueIter = new CollectionValueIterator(values);
    CommandContext cc = new CommandContext();
    assertEquals(expected, new Evaluator(Collections.emptyMap(), null, cc) {

        @Override
        protected ValueIterator evaluateSubquery(SubqueryContainer container, List tuple) throws TeiidProcessingException, BlockedException, TeiidComponentException {
            return valueIter;
        }
    }.evaluate(expr, null));
}
Also used : SubqueryContainer(org.teiid.query.sql.lang.SubqueryContainer) CommandContext(org.teiid.query.util.CommandContext) ArrayList(java.util.ArrayList) List(java.util.List) CollectionValueIterator(org.teiid.query.sql.lang.CollectionValueIterator) Evaluator(org.teiid.query.eval.Evaluator)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Evaluator (org.teiid.query.eval.Evaluator)1 CollectionValueIterator (org.teiid.query.sql.lang.CollectionValueIterator)1 SubqueryContainer (org.teiid.query.sql.lang.SubqueryContainer)1 CommandContext (org.teiid.query.util.CommandContext)1