Search in sources :

Example 1 with EmptyType

use of mondrian.olap.type.EmptyType 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)1 Exp (mondrian.olap.Exp)1 EmptyType (mondrian.olap.type.EmptyType)1