Search in sources :

Example 46 with AggregateSymbol

use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.

the class TestAggregateSymbol method testParser2.

public void testParser2() {
    // $NON-NLS-1$
    AggregateSymbol as = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
    // $NON-NLS-1$
    helpParser(as, "COUNT(DISTINCT m.g.c)");
}
Also used : AggregateSymbol(org.teiid.query.sql.symbol.AggregateSymbol)

Example 47 with AggregateSymbol

use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.

the class TestAggregateSymbol method testEquivalence.

public void testEquivalence() {
    // $NON-NLS-1$
    AggregateSymbol test1 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
    // $NON-NLS-1$
    AggregateSymbol test2 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, test1, test2);
}
Also used : AggregateSymbol(org.teiid.query.sql.symbol.AggregateSymbol)

Example 48 with AggregateSymbol

use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.

the class TestAggregateSymbol method testEquivalenceCountStar.

public void testEquivalenceCountStar() {
    // $NON-NLS-1$
    AggregateSymbol test1 = new AggregateSymbol(NonReserved.COUNT, false, null);
    // $NON-NLS-1$
    AggregateSymbol test2 = new AggregateSymbol(NonReserved.COUNT, false, null);
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, test1, test2);
}
Also used : AggregateSymbol(org.teiid.query.sql.symbol.AggregateSymbol)

Example 49 with AggregateSymbol

use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.

the class TestAggregateSymbol method testEquals1.

public void testEquals1() {
    // $NON-NLS-1$
    AggregateSymbol as = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
    helpEquals(as, as, true);
}
Also used : AggregateSymbol(org.teiid.query.sql.symbol.AggregateSymbol)

Example 50 with AggregateSymbol

use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.

the class TestAggregateSymbol method testNonEquivalence.

public void testNonEquivalence() {
    // $NON-NLS-1$
    AggregateSymbol test1 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
    // $NON-NLS-1$
    AggregateSymbol test2 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement2());
    int equals = -1;
    UnitTestUtil.helpTestEquivalence(equals, test1, test2);
}
Also used : AggregateSymbol(org.teiid.query.sql.symbol.AggregateSymbol)

Aggregations

AggregateSymbol (org.teiid.query.sql.symbol.AggregateSymbol)53 ElementSymbol (org.teiid.query.sql.symbol.ElementSymbol)27 Test (org.junit.Test)21 BasicSourceCapabilities (org.teiid.query.optimizer.capabilities.BasicSourceCapabilities)16 ArrayList (java.util.ArrayList)12 List (java.util.List)11 Expression (org.teiid.query.sql.symbol.Expression)9 OrderBy (org.teiid.query.sql.lang.OrderBy)8 CommandContext (org.teiid.query.util.CommandContext)6 BufferManager (org.teiid.common.buffer.BufferManager)5 SymbolMap (org.teiid.query.sql.util.SymbolMap)5 BigDecimal (java.math.BigDecimal)4 FakeTupleSource (org.teiid.query.processor.FakeTupleSource)4 Constant (org.teiid.query.sql.symbol.Constant)4 TeiidRuntimeException (org.teiid.core.TeiidRuntimeException)3 PlanNode (org.teiid.query.optimizer.relational.plantree.PlanNode)3 AliasSymbol (org.teiid.query.sql.symbol.AliasSymbol)3 ExpressionSymbol (org.teiid.query.sql.symbol.ExpressionSymbol)3 Map (java.util.Map)2 AggregateFunction (org.teiid.query.function.aggregate.AggregateFunction)2