Search in sources :

Example 26 with Axis

use of mondrian.olap.Axis in project mondrian by pentaho.

the class BasicQueryTest method testNonEmptyNonEmptyCrossJoin4.

public void testNonEmptyNonEmptyCrossJoin4() {
    TestContext.instance().flushSchemaCache();
    Result result = executeQuery("select {[Education Level].[All Education Levels].[Graduate Degree]} on columns,\n" + "   Non Empty NonEmptyCrossJoin(\n" + "      {[Store Type].[Store Type].members},\n" + "      {[Promotions].[Promotion Name].members})\n" + "   on rows\n" + "from Sales\n" + "where ([Customers].[All Customers].[USA].[WA].[Anacortes])\n");
    Axis a = result.getAxes()[1];
    assertEquals(1, a.getPositions().size());
}
Also used : Axis(mondrian.olap.Axis)

Example 27 with Axis

use of mondrian.olap.Axis in project mondrian by pentaho.

the class BasicQueryTest method testNonEmptyNonEmptyCrossJoin1.

/**
 * NonEmptyCrossJoin() is not the same as NON EMPTY CrossJoin()
 * because it's evaluated independently of the other axes.
 * (see http://blogs.msdn.com/bi_systems/articles/162841.aspx)
 */
public void testNonEmptyNonEmptyCrossJoin1() {
    TestContext.instance().flushSchemaCache();
    Result result = executeQuery("select {[Education Level].[All Education Levels].[Graduate Degree]} on columns,\n" + "   CrossJoin(\n" + "      {[Store Type].[Store Type].members},\n" + "      {[Promotions].[Promotion Name].members})\n" + "   on rows\n" + "from Sales\n" + "where ([Customers].[All Customers].[USA].[WA].[Anacortes])\n");
    Axis a = result.getAxes()[1];
    assertEquals(306, a.getPositions().size());
}
Also used : Axis(mondrian.olap.Axis)

Example 28 with Axis

use of mondrian.olap.Axis in project mondrian by pentaho.

the class BasicQueryTest method _testProduct2.

public void _testProduct2() {
    final Axis axis = getTestContext().executeAxis("{[Product2].members}");
    System.out.println(TestContext.toString(axis.getPositions()));
}
Also used : Axis(mondrian.olap.Axis)

Example 29 with Axis

use of mondrian.olap.Axis in project mondrian by pentaho.

the class BasicQueryTest method testNonEmptyNonEmptyCrossJoin2.

public void testNonEmptyNonEmptyCrossJoin2() {
    TestContext.instance().flushSchemaCache();
    Result result = executeQuery("select {[Education Level].[All Education Levels].[Graduate Degree]} on columns,\n" + "   NonEmptyCrossJoin(\n" + "      {[Store Type].[Store Type].members},\n" + "      {[Promotions].[Promotion Name].members})\n" + "   on rows\n" + "from Sales\n" + "where ([Customers].[All Customers].[USA].[WA].[Anacortes])\n");
    Axis a = result.getAxes()[1];
    assertEquals(10, a.getPositions().size());
}
Also used : Axis(mondrian.olap.Axis)

Example 30 with Axis

use of mondrian.olap.Axis in project mondrian by pentaho.

the class BasicQueryTest method testFilteredCrossJoin.

/**
 * This resulted in {@link OutOfMemoryError} when the
 * BatchingCellReader did not know the values for the tuples that
 * were used in filters.
 */
public void testFilteredCrossJoin() {
    TestContext.instance().flushSchemaCache();
    Result result = executeQuery("select {[Measures].[Store Sales]} on columns,\n" + "  NON EMPTY Crossjoin(\n" + "    Filter([Customers].[Name].Members,\n" + "      (([Measures].[Store Sales],\n" + "        [Store].[All Stores].[USA].[CA].[San Francisco].[Store 14],\n" + "        [Time].[1997].[Q1].[1]) > 5.0)),\n" + "    Filter([Product].[Product Name].Members,\n" + "      (([Measures].[Store Sales],\n" + "        [Store].[All Stores].[USA].[CA].[San Francisco].[Store 14],\n" + "        [Time].[1997].[Q1].[1]) > 5.0))\n" + " ) ON rows\n" + "from [Sales]\n" + "where (\n" + "  [Store].[All Stores].[USA].[CA].[San Francisco].[Store 14],\n" + "  [Time].[1997].[Q1].[1]\n" + ")\n");
    // ok if no OutOfMemoryError occurs
    Axis a = result.getAxes()[1];
    assertEquals(12, a.getPositions().size());
}
Also used : Axis(mondrian.olap.Axis)

Aggregations

Axis (mondrian.olap.Axis)38 Result (mondrian.olap.Result)9 Position (mondrian.olap.Position)8 List (java.util.List)7 Member (mondrian.olap.Member)7 Test (org.junit.Test)7 Cell (mondrian.olap.Cell)6 ArrayList (java.util.ArrayList)5 TupleList (mondrian.calc.TupleList)4 UnaryTupleList (mondrian.calc.impl.UnaryTupleList)4 BigDecimal (java.math.BigDecimal)2 Date (java.util.Date)2 Hierarchy (mondrian.olap.Hierarchy)2 RolapAxis (mondrian.rolap.RolapAxis)2 DBCacheEntry (org.pentaho.di.core.DBCacheEntry)2 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)2 RowMeta (org.pentaho.di.core.row.RowMeta)2 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)2 ValueMetaBoolean (org.pentaho.di.core.row.value.ValueMetaBoolean)2 ValueMetaDate (org.pentaho.di.core.row.value.ValueMetaDate)2