1 Sample OLAP cube

Let's consider the following OLAP cube. It allows basic queries on the TPC-H struture. The cube definition forces acceleration so all queries should be solved by the IWA engine (otherwise will fail).

Copy
<!-- ================================================================================== -->
<!-- TPCH #1                                                                            -->
<!-- ================================================================================== -->
<Schema name='tpch_1'>
    
    <!-- ================================================================================== -->
    <!-- Line items                                                                         -->
    <!-- ================================================================================== -->
    <Cube name='Line items' defaultMeasure='x' useLeftJoins='true' acceleration="FALLBACK_OFF">
        <Table name='lineitem' approxRowCount='1' />
        
        <Dimension name='Order' foreignKey='l_orderkey'>
            <Hierarchy hasAll='true' primaryKey='o_orderkey'>
                <Table name="orders" approxRowCount='1' />
                <Level name='o_orderkey'        column='o_orderkey'         uniqueMembers='false' approxRowCount="1" />
                <!--
                <Level name='o_comment'         column='o_comment'          uniqueMembers='false' approxRowCount="1" />
                -->
            </Hierarchy>
            <Hierarchy name='Order date' hasAll='true' primaryKey='o_orderkey'>
                <Table name="orders" approxRowCount='1' />
                <Level name='o_orderdate'       column='o_orderdate'        uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            <!--
            <Hierarchy name='Order customer' hasAll='true' primaryKey='o_orderkey'>
                <Table name="orders" approxRowCount='1' />
                <Level name='o_custkey'         column='o_custkey'          uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            -->
            <Hierarchy name='Order status' hasAll='true' primaryKey='o_orderkey'>
                <Table name="orders" approxRowCount='1' />
                <Level name='o_orderstatus'     column='o_orderstatus'      uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Order priority' hasAll='true' primaryKey='o_orderkey'>
                <Table name="orders" approxRowCount='1' />
                <Level name='o_orderpriority'   column='o_orderpriority'    uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Order shippment priority' hasAll='true' primaryKey='o_orderkey'>
                <Table name="orders" approxRowCount='1' />
                <Level name='o_shippriority'    column='o_shippriority'     uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Order clerk' hasAll='true' primaryKey='o_orderkey'>
                <Table name="orders" approxRowCount='1' />
                <Level name='o_clerk'           column='o_clerk'            uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
        </Dimension>

        <Dimension name='Line'>
            <Hierarchy hasAll='true'>
                <Level name='l_orderkey'        column='l_orderkey'     uniqueMembers='true' approxRowCount="1" />
                <Level name='l_linenumber'      column='l_linenumber'   uniqueMembers='true' approxRowCount="1" />
                <!--
                <Level name='l_comment' column='l_comment' uniqueMembers='false' approxRowCount="1" />
                -->
            </Hierarchy>
            <Hierarchy name='Part' hasAll='true'>
                <Level name='l_partkey'         column='l_partkey'      uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Supplier' hasAll='true'>
                <Level name='l_suppkey'         column='l_suppkey'      uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Return' hasAll='true'>
                <Level name='l_returnflag'      column='l_returnflag'   uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Status' hasAll='true'>
                <Level name='l_linestatus'      column='l_linestatus'   uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Date' hasAll='true'>
                <Level name='l_shipdate'        column='l_shipdate'     uniqueMembers='true' approxRowCount="1" />
                <Level name='l_commitdate'      column='l_commitdate'   uniqueMembers='true' approxRowCount="1" />
                <Level name='l_receipdate'      column='l_receipdate'   uniqueMembers='true' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Ship in struct' hasAll='true'>
                <Level name='l_shipinstruct'    column='l_shipinstruct' uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Ship mode' hasAll='true'>
                <Level name='l_shipmode'        column='l_shipmode'     uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
        </Dimension>

        <Dimension name='Customer' foreignKey='l_orderkey'>
            <Hierarchy hasAll='true' primaryKey='o_orderkey'>
                <Join leftKey="o_custkey" rightKey="c_custkey">
                    <Table name="orders" approxRowCount='1' />
                    <Table name="customer" approxRowCount='1' />
                </Join>
                <Level name='c_custkey'       table='customer'   column='c_custkey'       uniqueMembers='true' approxRowCount="1" />
                <Level name='c_name'          table='customer'   column='c_name'          uniqueMembers='true' approxRowCount="1" />
                <Level name='c_address'       table='customer'   column='c_address'       uniqueMembers='true' approxRowCount="1" />
                <Level name='c_phone'         table='customer'   column='c_phone'         uniqueMembers='true' approxRowCount="1" />
                <Level name='c_comment'       table='customer'   column='c_comment'       uniqueMembers='true' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Market segment' hasAll='true' primaryKey='o_orderkey'>
                <Join leftKey="o_custkey" rightKey="c_custkey">
                    <Table name="orders" approxRowCount='1' />
                    <Table name="customer" approxRowCount='1' />
                </Join>
                <Level name='c_mktsegment'    table='customer'   column='c_mktsegment'    uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
            <Hierarchy name='Nation' hasAll='true' primaryKey='o_orderkey'>
                <Join leftKey="o_custkey" rightKey="c_custkey">
                    <Table name="orders" approxRowCount='1' />
                    <Join leftKey="c_nationkey" rightKey="n_nationkey">
                        <Table name="customer" approxRowCount='1' />
                        <Table name="nation" approxRowCount='1' />
                    </Join>
                </Join>
                <Level name='c_nationkey'   table='customer'    column='c_nationkey'    uniqueMembers='false' approxRowCount="1" />
                <Level name='n_name'        table='nation'      column='n_name'         uniqueMembers='false' approxRowCount="1" />
            </Hierarchy>
        </Dimension> 

        <Measure name='l_quantity'      column='l_quantity'         aggregator='sum' formatString='#,###.00'/>
        <Measure name='o_totalprice'    column='o_totalprice'       aggregator='sum' formatString='#,###.00'/>
        <Measure name='c_actbalance'    column='c_actbalance'       aggregator='sum' formatString='#,###.00'/>

    </Cube>
 </Schema>

The following image shows a sample query made with the OLAP client.