Search in sources :

Example 6 with MondrianProperties

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

the class SegmentLoader method useSparse.

/**
 * Decides whether to use a sparse representation for this segment, using
 * the formula described
 * {@link mondrian.olap.MondrianProperties#SparseSegmentCountThreshold
 * here}.
 *
 * @param possibleCount Number of values in the space.
 * @param actualCount   Actual number of values.
 * @return Whether to use a sparse representation.
 */
static boolean useSparse(final double possibleCount, final double actualCount) {
    final MondrianProperties properties = MondrianProperties.instance();
    double densityThreshold = properties.SparseSegmentDensityThreshold.get();
    if (densityThreshold < 0) {
        densityThreshold = 0;
    }
    if (densityThreshold > 1) {
        densityThreshold = 1;
    }
    int countThreshold = properties.SparseSegmentCountThreshold.get();
    if (countThreshold < 0) {
        countThreshold = 0;
    }
    boolean sparse = (possibleCount - countThreshold) * densityThreshold > actualCount;
    if (possibleCount < countThreshold) {
        assert !sparse : "Should never use sparse if count is less " + "than threshold, possibleCount=" + possibleCount + ", actualCount=" + actualCount + ", countThreshold=" + countThreshold + ", densityThreshold=" + densityThreshold;
    }
    if (possibleCount == actualCount) {
        assert !sparse : "Should never use sparse if result is 100% dense: " + "possibleCount=" + possibleCount + ", actualCount=" + actualCount + ", countThreshold=" + countThreshold + ", densityThreshold=" + densityThreshold;
    }
    return sparse;
}
Also used : MondrianProperties(mondrian.olap.MondrianProperties)

Example 7 with MondrianProperties

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

the class NonEmptyTest method testAnalyzerPerformanceIssue.

/**
 * Test case for an issue where mondrian failed to use native evaluation
 * for evaluating crossjoin. With the issue, performance is poor because
 * mondrian is doing crossjoins in memory; and the test case throws because
 * the result limit is exceeded.
 */
public void testAnalyzerPerformanceIssue() {
    final MondrianProperties mondrianProperties = MondrianProperties.instance();
    propSaver.set(mondrianProperties.EnableNativeCrossJoin, true);
    propSaver.set(mondrianProperties.EnableNativeTopCount, false);
    propSaver.set(mondrianProperties.EnableNativeFilter, true);
    propSaver.set(mondrianProperties.EnableNativeNonEmpty, false);
    propSaver.set(mondrianProperties.ResultLimit, 5000000);
    assertQueryReturns("with set [*NATIVE_CJ_SET] as 'NonEmptyCrossJoin([*BASE_MEMBERS_Education Level], NonEmptyCrossJoin([*BASE_MEMBERS_Product], NonEmptyCrossJoin([*BASE_MEMBERS_Customers], [*BASE_MEMBERS_Time])))' " + "set [*METRIC_CJ_SET] as 'Filter([*NATIVE_CJ_SET], ([Measures].[*TOP_Unit Sales_SEL~SUM] <= 2.0))' " + "set [*SORTED_ROW_AXIS] as 'Order([*CJ_ROW_AXIS], [Product].CurrentMember.OrderKey, BASC, Ancestor([Product].CurrentMember, [Product].[Brand Name]).OrderKey, BASC, [Customers].CurrentMember.OrderKey, BASC, Ancestor([Customers].CurrentMember, [Customers].[City]).OrderKey, BASC)' " + "set [*SORTED_COL_AXIS] as 'Order([*CJ_COL_AXIS], [Education Level].CurrentMember.OrderKey, BASC)' " + "set [*BASE_MEMBERS_Time] as '{[Time].[1997].[Q1]}' " + "set [*NATIVE_MEMBERS_Customers] as 'Generate([*NATIVE_CJ_SET], {[Customers].CurrentMember})' " + "set [*TOP_SET] as 'Order(Generate([*NATIVE_CJ_SET], {[Product].CurrentMember}), ([Measures].[Unit Sales], [Customers].[*CTX_MEMBER_SEL~SUM], [Education Level].[*CTX_MEMBER_SEL~SUM], [Time].[*CTX_MEMBER_SEL~AGG]), BDESC)' " + "set [*BASE_MEMBERS_Education Level] as '[Education Level].[Education Level].Members' " + "set [*NATIVE_MEMBERS_Education Level] as 'Generate([*NATIVE_CJ_SET], {[Education Level].CurrentMember})' " + "set [*METRIC_MEMBERS_Time] as 'Generate([*METRIC_CJ_SET], {[Time].[Time].CurrentMember})' " + "set [*NATIVE_MEMBERS_Time] as 'Generate([*NATIVE_CJ_SET], {[Time].[Time].CurrentMember})' " + "set [*BASE_MEMBERS_Customers] as '[Customers].[Name].Members' " + "set [*BASE_MEMBERS_Product] as '[Product].[Product Name].Members' " + "set [*BASE_MEMBERS_Measures] as '{[Measures].[*FORMATTED_MEASURE_0]}' " + "set [*CJ_COL_AXIS] as 'Generate([*METRIC_CJ_SET], {[Education Level].CurrentMember})' " + "set [*CJ_ROW_AXIS] as 'Generate([*METRIC_CJ_SET], {([Product].CurrentMember, [Customers].CurrentMember)})' " + "member [Customers].[*DEFAULT_MEMBER] as '[Customers].DefaultMember', SOLVE_ORDER = (- 500.0) " + "member [Product].[*TOTAL_MEMBER_SEL~SUM] as 'Sum(Generate([*METRIC_CJ_SET], {([Product].CurrentMember, [Customers].CurrentMember)}))', SOLVE_ORDER = (- 100.0) " + "member [Customers].[*TOTAL_MEMBER_SEL~SUM] as 'Sum(Generate(Exists([*METRIC_CJ_SET], {[Product].CurrentMember}), {([Product].CurrentMember, [Customers].CurrentMember)}))', SOLVE_ORDER = (- 101.0) " + "member [Measures].[*TOP_Unit Sales_SEL~SUM] as 'Rank([Product].CurrentMember, [*TOP_SET])', SOLVE_ORDER = 300.0 " + "member [Measures].[*FORMATTED_MEASURE_0] as '[Measures].[Unit Sales]', FORMAT_STRING = \"Standard\", SOLVE_ORDER = 400.0 " + "member [Customers].[*CTX_MEMBER_SEL~SUM] as 'Sum({[Customers].[All Customers]})', SOLVE_ORDER = (- 101.0) " + "member [Education Level].[*TOTAL_MEMBER_SEL~SUM] as 'Sum(Generate([*METRIC_CJ_SET], {[Education Level].CurrentMember}))', SOLVE_ORDER = (- 102.0) " + "member [Education Level].[*CTX_MEMBER_SEL~SUM] as 'Sum({[Education Level].[All Education Levels]})', SOLVE_ORDER = (- 102.0) " + "member [Time].[Time].[*CTX_MEMBER_SEL~AGG] as 'Aggregate([*NATIVE_MEMBERS_Time])', SOLVE_ORDER = (- 402.0) " + "member [Time].[Time].[*SLICER_MEMBER] as 'Aggregate([*METRIC_MEMBERS_Time])', SOLVE_ORDER = (- 400.0) " + "select Union(Crossjoin({[Education Level].[*TOTAL_MEMBER_SEL~SUM]}, [*BASE_MEMBERS_Measures]), Crossjoin([*SORTED_COL_AXIS], [*BASE_MEMBERS_Measures])) ON COLUMNS, " + "NON EMPTY Union(Crossjoin({[Product].[*TOTAL_MEMBER_SEL~SUM]}, {[Customers].[*DEFAULT_MEMBER]}), Union(Crossjoin(Generate([*METRIC_CJ_SET], {[Product].CurrentMember}), {[Customers].[*TOTAL_MEMBER_SEL~SUM]}), [*SORTED_ROW_AXIS])) ON ROWS " + "from [Sales] " + "where [Time].[*SLICER_MEMBER] ", "Axis #0:\n" + "{[Time].[*SLICER_MEMBER]}\n" + "Axis #1:\n" + "{[Education Level].[*TOTAL_MEMBER_SEL~SUM], [Measures].[*FORMATTED_MEASURE_0]}\n" + "{[Education Level].[Bachelors Degree], [Measures].[*FORMATTED_MEASURE_0]}\n" + "{[Education Level].[Graduate Degree], [Measures].[*FORMATTED_MEASURE_0]}\n" + "{[Education Level].[High School Degree], [Measures].[*FORMATTED_MEASURE_0]}\n" + "{[Education Level].[Partial College], [Measures].[*FORMATTED_MEASURE_0]}\n" + "{[Education Level].[Partial High School], [Measures].[*FORMATTED_MEASURE_0]}\n" + "Axis #2:\n" + "{[Product].[*TOTAL_MEMBER_SEL~SUM], [Customers].[*DEFAULT_MEMBER]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[*TOTAL_MEMBER_SEL~SUM]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[*TOTAL_MEMBER_SEL~SUM]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Puyallup].[Cheryl Herring]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[OR].[Salem].[Robert Ahlering]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Port Orchard].[Judy Zugelder]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Marysville].[Brian Johnston]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[OR].[Corvallis].[Judy Doolittle]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Spokane].[Greg Morgan]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[CA].[West Covina].[Sandra Young]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[CA].[Long Beach].[Dana Chappell]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[CA].[La Mesa].[Georgia Thompson]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Tacoma].[Jessica Dugan]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[OR].[Milwaukie].[Adrian Torrez]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Spokane].[Grace McLaughlin]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Bremerton].[Julia Stewart]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Port Orchard].[Maureen Overholser]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Yakima].[Mary Craig]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[CA].[Spring Valley].[Deborah Adams]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[CA].[Woodland Hills].[Warren Kaufman]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[OR].[Woodburn].[David Moss]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[CA].[Newport Beach].[Michael Sample]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[OR].[Portland].[Ofelia Trembath]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Bremerton].[Alexander Case]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Bremerton].[Gloria Duncan]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[WA].[Olympia].[Jeanette Foster]}\n" + "{[Product].[Food].[Baking Goods].[Baking Goods].[Spices].[BBB Best].[BBB Best Pepper], [Customers].[USA].[CA].[Lakewood].[Shyla Bettis]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[OR].[Portland].[Tomas Manzanares]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Bremerton].[Kerry Westgaard]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Yakima].[Beatrice Barney]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Seattle].[James La Monica]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Spokane].[Martha Griego]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Bremerton].[Michelle Neri]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Spokane].[Herman Webb]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Spokane].[Bob Alexander]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Issaquah].[Gery Scott]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Spokane].[Grace McLaughlin]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Kirkland].[Brandon Rohlke]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Port Orchard].[Elwood Carter]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[CA].[Beverly Hills].[Samuel Arden]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[OR].[Woodburn].[Ida Cezar]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Olympia].[Barbara Smith]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Spokane].[Matt Bellah]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Sedro Woolley].[William Akin]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[OR].[Albany].[Karie Taylor]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[OR].[Milwaukie].[Bertie Wherrett]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[CA].[Lincoln Acres].[L. Troy Barnes]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Tacoma].[Patricia Martin]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Bremerton].[Martha Clifton]}\n" + "{[Product].[Food].[Produce].[Vegetables].[Fresh Vegetables].[Hermanos].[Hermanos Garlic], [Customers].[USA].[WA].[Bremerton].[Marla Bell]}\n" + "Row #0: 170\n" + "Row #0: 45\n" + "Row #0: 7\n" + "Row #0: 47\n" + "Row #0: 16\n" + "Row #0: 55\n" + "Row #1: 87\n" + "Row #1: 25\n" + "Row #1: 5\n" + "Row #1: 21\n" + "Row #1: 8\n" + "Row #1: 28\n" + "Row #2: 83\n" + "Row #2: 20\n" + "Row #2: 2\n" + "Row #2: 26\n" + "Row #2: 8\n" + "Row #2: 27\n" + "Row #3: 4\n" + "Row #3: \n" + "Row #3: \n" + "Row #3: \n" + "Row #3: 4\n" + "Row #3: \n" + "Row #4: 4\n" + "Row #4: \n" + "Row #4: \n" + "Row #4: \n" + "Row #4: 4\n" + "Row #4: \n" + "Row #5: 3\n" + "Row #5: 3\n" + "Row #5: \n" + "Row #5: \n" + "Row #5: \n" + "Row #5: \n" + "Row #6: 4\n" + "Row #6: 4\n" + "Row #6: \n" + "Row #6: \n" + "Row #6: \n" + "Row #6: \n" + "Row #7: 4\n" + "Row #7: \n" + "Row #7: \n" + "Row #7: \n" + "Row #7: \n" + "Row #7: 4\n" + "Row #8: 4\n" + "Row #8: 4\n" + "Row #8: \n" + "Row #8: \n" + "Row #8: \n" + "Row #8: \n" + "Row #9: 3\n" + "Row #9: \n" + "Row #9: \n" + "Row #9: \n" + "Row #9: \n" + "Row #9: 3\n" + "Row #10: 2\n" + "Row #10: 2\n" + "Row #10: \n" + "Row #10: \n" + "Row #10: \n" + "Row #10: \n" + "Row #11: 3\n" + "Row #11: \n" + "Row #11: \n" + "Row #11: \n" + "Row #11: \n" + "Row #11: 3\n" + "Row #12: 3\n" + "Row #12: \n" + "Row #12: \n" + "Row #12: 3\n" + "Row #12: \n" + "Row #12: \n" + "Row #13: 4\n" + "Row #13: 4\n" + "Row #13: \n" + "Row #13: \n" + "Row #13: \n" + "Row #13: \n" + "Row #14: 4\n" + "Row #14: \n" + "Row #14: \n" + "Row #14: 4\n" + "Row #14: \n" + "Row #14: \n" + "Row #15: 3\n" + "Row #15: \n" + "Row #15: \n" + "Row #15: \n" + "Row #15: \n" + "Row #15: 3\n" + "Row #16: 4\n" + "Row #16: \n" + "Row #16: \n" + "Row #16: 4\n" + "Row #16: \n" + "Row #16: \n" + "Row #17: 5\n" + "Row #17: \n" + "Row #17: 5\n" + "Row #17: \n" + "Row #17: \n" + "Row #17: \n" + "Row #18: 4\n" + "Row #18: \n" + "Row #18: \n" + "Row #18: \n" + "Row #18: \n" + "Row #18: 4\n" + "Row #19: 3\n" + "Row #19: \n" + "Row #19: \n" + "Row #19: 3\n" + "Row #19: \n" + "Row #19: \n" + "Row #20: 3\n" + "Row #20: \n" + "Row #20: \n" + "Row #20: 3\n" + "Row #20: \n" + "Row #20: \n" + "Row #21: 4\n" + "Row #21: \n" + "Row #21: \n" + "Row #21: 4\n" + "Row #21: \n" + "Row #21: \n" + "Row #22: 4\n" + "Row #22: 4\n" + "Row #22: \n" + "Row #22: \n" + "Row #22: \n" + "Row #22: \n" + "Row #23: 4\n" + "Row #23: \n" + "Row #23: \n" + "Row #23: \n" + "Row #23: \n" + "Row #23: 4\n" + "Row #24: 4\n" + "Row #24: \n" + "Row #24: \n" + "Row #24: \n" + "Row #24: \n" + "Row #24: 4\n" + "Row #25: 3\n" + "Row #25: \n" + "Row #25: \n" + "Row #25: \n" + "Row #25: \n" + "Row #25: 3\n" + "Row #26: 4\n" + "Row #26: 4\n" + "Row #26: \n" + "Row #26: \n" + "Row #26: \n" + "Row #26: \n" + "Row #27: 4\n" + "Row #27: 4\n" + "Row #27: \n" + "Row #27: \n" + "Row #27: \n" + "Row #27: \n" + "Row #28: 4\n" + "Row #28: 4\n" + "Row #28: \n" + "Row #28: \n" + "Row #28: \n" + "Row #28: \n" + "Row #29: 3\n" + "Row #29: \n" + "Row #29: \n" + "Row #29: 3\n" + "Row #29: \n" + "Row #29: \n" + "Row #30: 2\n" + "Row #30: \n" + "Row #30: \n" + "Row #30: \n" + "Row #30: \n" + "Row #30: 2\n" + "Row #31: 4\n" + "Row #31: \n" + "Row #31: \n" + "Row #31: \n" + "Row #31: 4\n" + "Row #31: \n" + "Row #32: 5\n" + "Row #32: \n" + "Row #32: \n" + "Row #32: 5\n" + "Row #32: \n" + "Row #32: \n" + "Row #33: 3\n" + "Row #33: \n" + "Row #33: \n" + "Row #33: \n" + "Row #33: \n" + "Row #33: 3\n" + "Row #34: 4\n" + "Row #34: 4\n" + "Row #34: \n" + "Row #34: \n" + "Row #34: \n" + "Row #34: \n" + "Row #35: 3\n" + "Row #35: 3\n" + "Row #35: \n" + "Row #35: \n" + "Row #35: \n" + "Row #35: \n" + "Row #36: 4\n" + "Row #36: \n" + "Row #36: \n" + "Row #36: 4\n" + "Row #36: \n" + "Row #36: \n" + "Row #37: 4\n" + "Row #37: \n" + "Row #37: \n" + "Row #37: 4\n" + "Row #37: \n" + "Row #37: \n" + "Row #38: 3\n" + "Row #38: \n" + "Row #38: \n" + "Row #38: 3\n" + "Row #38: \n" + "Row #38: \n" + "Row #39: 3\n" + "Row #39: 3\n" + "Row #39: \n" + "Row #39: \n" + "Row #39: \n" + "Row #39: \n" + "Row #40: 2\n" + "Row #40: \n" + "Row #40: 2\n" + "Row #40: \n" + "Row #40: \n" + "Row #40: \n" + "Row #41: 4\n" + "Row #41: \n" + "Row #41: \n" + "Row #41: \n" + "Row #41: 4\n" + "Row #41: \n" + "Row #42: 4\n" + "Row #42: \n" + "Row #42: \n" + "Row #42: \n" + "Row #42: \n" + "Row #42: 4\n" + "Row #43: 2\n" + "Row #43: 2\n" + "Row #43: \n" + "Row #43: \n" + "Row #43: \n" + "Row #43: \n" + "Row #44: 3\n" + "Row #44: \n" + "Row #44: \n" + "Row #44: 3\n" + "Row #44: \n" + "Row #44: \n" + "Row #45: 4\n" + "Row #45: \n" + "Row #45: \n" + "Row #45: 4\n" + "Row #45: \n" + "Row #45: \n" + "Row #46: 4\n" + "Row #46: \n" + "Row #46: \n" + "Row #46: \n" + "Row #46: \n" + "Row #46: 4\n" + "Row #47: 3\n" + "Row #47: \n" + "Row #47: \n" + "Row #47: \n" + "Row #47: \n" + "Row #47: 3\n" + "Row #48: 4\n" + "Row #48: \n" + "Row #48: \n" + "Row #48: \n" + "Row #48: \n" + "Row #48: 4\n" + "Row #49: 7\n" + "Row #49: \n" + "Row #49: \n" + "Row #49: \n" + "Row #49: \n" + "Row #49: 7\n");
}
Also used : MondrianProperties(mondrian.olap.MondrianProperties)

Example 8 with MondrianProperties

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

the class NonEmptyTest method testExpandNonNativeWithEnableNativeCrossJoin.

/**
 * Test case for <a href="http://jira.pentaho.com/browse/MONDRIAN-734">
 * MONDRIAN-734, "Exception thrown when creating a "New Analysis View" with
 * JPivot"</a>.
 */
public void testExpandNonNativeWithEnableNativeCrossJoin() {
    final MondrianProperties mondrianProperties = MondrianProperties.instance();
    propSaver.set(mondrianProperties.EnableNativeCrossJoin, true);
    propSaver.set(mondrianProperties.ExpandNonNative, true);
    String mdx = "select NON EMPTY {[Measures].[Unit Sales]} ON COLUMNS," + " NON EMPTY Crossjoin(Hierarchize(Crossjoin({[Store].[All Stores]}, Crossjoin({[Store Size in SQFT].[All Store Size in SQFTs]}, Crossjoin({[Store Type].[All Store Types]}, Union(Crossjoin({[Time].[1997]}, {[Product].[All Products]}), Crossjoin({[Time].[1997]}, [Product].[All Products].Children)))))), {([Promotion Media].[All Media], [Promotions].[All Promotions], [Customers].[All Customers], [Education Level].[All Education Levels], [Gender].[All Gender], [Marital Status].[All Marital Status], [Yearly Income].[All Yearly Incomes])}) ON ROWS" + " from [Sales]";
    assertQueryReturns(mdx, "Axis #0:\n" + "{}\n" + "Axis #1:\n" + "{[Measures].[Unit Sales]}\n" + "Axis #2:\n" + "{[Store].[All Stores], [Store Size in SQFT].[All Store Size in SQFTs], [Store Type].[All Store Types], [Time].[1997], [Product].[All Products], [Promotion Media].[All Media], [Promotions].[All Promotions], [Customers].[All Customers], [Education Level].[All Education Levels], [Gender].[All Gender], [Marital Status].[All Marital Status], [Yearly Income].[All Yearly Incomes]}\n" + "{[Store].[All Stores], [Store Size in SQFT].[All Store Size in SQFTs], [Store Type].[All Store Types], [Time].[1997], [Product].[Drink], [Promotion Media].[All Media], [Promotions].[All Promotions], [Customers].[All Customers], [Education Level].[All Education Levels], [Gender].[All Gender], [Marital Status].[All Marital Status], [Yearly Income].[All Yearly Incomes]}\n" + "{[Store].[All Stores], [Store Size in SQFT].[All Store Size in SQFTs], [Store Type].[All Store Types], [Time].[1997], [Product].[Food], [Promotion Media].[All Media], [Promotions].[All Promotions], [Customers].[All Customers], [Education Level].[All Education Levels], [Gender].[All Gender], [Marital Status].[All Marital Status], [Yearly Income].[All Yearly Incomes]}\n" + "{[Store].[All Stores], [Store Size in SQFT].[All Store Size in SQFTs], [Store Type].[All Store Types], [Time].[1997], [Product].[Non-Consumable], [Promotion Media].[All Media], [Promotions].[All Promotions], [Customers].[All Customers], [Education Level].[All Education Levels], [Gender].[All Gender], [Marital Status].[All Marital Status], [Yearly Income].[All Yearly Incomes]}\n" + "Row #0: 266,773\n" + "Row #1: 24,597\n" + "Row #2: 191,940\n" + "Row #3: 50,236\n");
}
Also used : MondrianProperties(mondrian.olap.MondrianProperties)

Example 9 with MondrianProperties

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

the class BUG_1541077 method testBug1541077.

public void testBug1541077() throws Exception {
    if (!isApplicable()) {
        return;
    }
    MondrianProperties props = MondrianProperties.instance();
    // get value without aggregates
    propSaver.set(props.UseAggregates, false);
    String mdx = "select {[Measures].[Avg Amount]} on columns from Cheques";
    Result result = getTestContext().executeQuery(mdx);
    Object v = result.getCell(new int[] { 0 }).getFormattedValue();
    // get value with aggregates
    propSaver.set(props.UseAggregates, true);
    Result result1 = getTestContext().executeQuery(mdx);
    Object v1 = result1.getCell(new int[] { 0 }).getFormattedValue();
    assertTrue(v.equals(v1));
}
Also used : MondrianProperties(mondrian.olap.MondrianProperties) Result(mondrian.olap.Result)

Example 10 with MondrianProperties

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

the class BUG_1541077 method testSalesCount.

public void testSalesCount() throws Exception {
    if (!isApplicable()) {
        return;
    }
    MondrianProperties props = MondrianProperties.instance();
    // get value without aggregates
    propSaver.set(props.UseAggregates, false);
    String mdx = "select {[Measures].[Sales Count]} on columns from Cheques";
    Result result = getTestContext().executeQuery(mdx);
    Object v = result.getCell(new int[] { 0 }).getValue();
    propSaver.set(props.UseAggregates, true);
    Result result1 = getTestContext().executeQuery(mdx);
    Object v1 = result1.getCell(new int[] { 0 }).getValue();
    assertTrue(v.equals(v1));
}
Also used : MondrianProperties(mondrian.olap.MondrianProperties) Result(mondrian.olap.Result)

Aggregations

MondrianProperties (mondrian.olap.MondrianProperties)12 Result (mondrian.olap.Result)5