Search in sources :

Example 1 with DummyExp

use of mondrian.calc.DummyExp in project mondrian by pentaho.

the class NumberSqlCompilerTest method testRejectsNonLiteral.

public void testRejectsNonLiteral() {
    Exp exp = new DummyExp(new NullType());
    assertNull(compiler.compile(exp));
}
Also used : DummyExp(mondrian.calc.DummyExp) NullType(mondrian.olap.type.NullType) DummyExp(mondrian.calc.DummyExp) Exp(mondrian.olap.Exp)

Example 2 with DummyExp

use of mondrian.calc.DummyExp in project mondrian by pentaho.

the class TopCountNativeEvaluatorTest method testNonNative_WhenTwoParametersArePassed.

/**
 * For now, prohibit native evaluation of the function if has two
 * parameters. According to the specification, this means
 * the function should behave similarly to {@code HEAD} function.
 * However, native evaluation joins data with the fact table and if there
 * is no data there, then some records are ignored, what is not correct.
 *
 * @see <a href="http://jira.pentaho.com/browse/MONDRIAN-2394">MONDRIAN-2394</a>
 */
public void testNonNative_WhenTwoParametersArePassed() throws Exception {
    RolapNativeTopCount nativeTopCount = createTopCountSpy();
    doReturn(true).when(nativeTopCount).isValidContext(any(RolapEvaluator.class));
    Exp[] arguments = new Exp[] { new DummyExp(new EmptyType()), Literal.create(BigDecimal.ONE) };
    assertNull("Native evaluator should not be created when " + "two parameters are passed", nativeTopCount.createEvaluator(null, mockFunctionDef(), arguments));
}
Also used : DummyExp(mondrian.calc.DummyExp) EmptyType(mondrian.olap.type.EmptyType) DummyExp(mondrian.calc.DummyExp) Exp(mondrian.olap.Exp)

Aggregations

DummyExp (mondrian.calc.DummyExp)2 Exp (mondrian.olap.Exp)2 EmptyType (mondrian.olap.type.EmptyType)1 NullType (mondrian.olap.type.NullType)1