Package mondrian.test

Examples of mondrian.test.SqlPattern


                null,
                null,
                null);

        SqlPattern[] patterns = {
            new SqlPattern(
                Dialect.DatabaseProduct.DERBY, necjSqlDerby, necjSqlDerby),
            new SqlPattern(
                Dialect.DatabaseProduct.MYSQL, necjSqlMySql, necjSqlMySql)
        };

        assertQuerySql(testContext, query, patterns);
    }
View Full Code Here


        propSaver.set(propSaver.properties.GenerateFormattedSql, true);
        String mdx = "select "
            + "non empty Crossjoin({[Gender].[Gender].[F]},{[Measures].[Unit Sales]}) on 0,"
            + "non empty Crossjoin({[Time].[1997]},{[Promotions].[All Promotions].[Bag Stuffers],[Promotions].[All Promotions].[Best Savings]}) on 1"
            + " from [Warehouse and Sales]";
        SqlPattern oraclePattern = new SqlPattern(
            Dialect.DatabaseProduct.ORACLE,
            propSaver.properties.UseAggregates.get()
                ? "select\n"
                + "    \"agg_c_14_sales_fact_1997\".\"the_year\" as \"c0\",\n"
                + "    \"promotion\".\"promotion_name\" as \"c1\"\n"
View Full Code Here

        propSaver.set(propSaver.properties.GenerateFormattedSql, true);
        String mdx = "select "
            + "non empty Crossjoin({[Gender].[Gender].[F]},{[Measures].[Unit Sales]}) on 0,"
            + "non empty [Promotions].[Promotions].members on 1"
            + " from [Warehouse and Sales]";
        SqlPattern oraclePattern = new SqlPattern(
            Dialect.DatabaseProduct.ORACLE,
            propSaver.properties.UseAggregates.get()
                ? "select\n"
                + "    \"promotion\".\"promotion_name\" as \"c0\"\n"
                + "from\n"
View Full Code Here

        propSaver.set(propSaver.properties.GenerateFormattedSql, true);
        String mdx = "select "
            + "non empty Crossjoin({[Gender].firstChild,[Gender].lastChild},{[Measures].[Unit Sales]}) on 0,"
            + "non empty Crossjoin({[Time].[1997]},{[Promotions].[All Promotions].[Bag Stuffers],[Promotions].[All Promotions].[Best Savings]}) on 1"
            + " from [Warehouse and Sales]";
        final SqlPattern pattern = new SqlPattern(
            Dialect.DatabaseProduct.ORACLE,
            propSaver.properties.UseAggregates.get()
                ? "select\n"
                + "    \"agg_c_14_sales_fact_1997\".\"the_year\" as \"c0\",\n"
                + "    \"promotion\".\"promotion_name\" as \"c1\"\n"
View Full Code Here

            "with set [blah] as '{[Gender].lastChild.lag(1),[Gender].[M]}' "
            + "select "
            + "non empty Crossjoin([blah],{[Measures].[Unit Sales]}) on 0,"
            + "non empty Crossjoin({[Time].[1997]},{[Promotions].[All Promotions].[Bag Stuffers],[Promotions].[All Promotions].[Best Savings]}) on 1"
            + " from [Warehouse and Sales]";
        final SqlPattern pattern = new SqlPattern(
            Dialect.DatabaseProduct.ORACLE,
            propSaver.properties.UseAggregates.get()
                ? "select\n"
                + "    \"agg_c_14_sales_fact_1997\".\"the_year\" as \"c0\",\n"
                + "    \"promotion\".\"promotion_name\" as \"c1\"\n"
View Full Code Here

                : "select \"customer\".\"country\" as \"c0\","
                    + " \"customer\".\"state_province\" as \"c1\", \"customer\".\"city\" as \"c2\", \"customer\".\"customer_id\" as \"c3\", \"fname\" || ' ' || \"lname\" as \"c4\", \"fname\" || ' ' || \"lname\" as \"c5\", \"customer\".\"gender\" as \"c6\", \"customer\".\"marital_status\" as \"c7\", \"customer\".\"education\" as \"c8\", \"customer\".\"yearly_income\" as \"c9\" from \"customer\" \"customer\", \"sales_fact_1997\" \"sales_fact_1997\" where \"sales_fact_1997\".\"customer_id\" = \"customer\".\"customer_id\" and (\"customer\".\"gender\" in ('M', 'F')) group by \"customer\".\"country\", \"customer\".\"state_province\", \"customer\".\"city\", \"customer\".\"customer_id\", \"fname\" || ' ' || \"lname\", \"customer\".\"gender\", \"customer\".\"marital_status\", \"customer\".\"education\", \"customer\".\"yearly_income\" order by \"customer\".\"country\" ASC NULLS LAST, \"customer\".\"state_province\" ASC NULLS LAST, \"customer\".\"city\" ASC NULLS LAST, \"fname\" || ' ' || \"lname\" ASC NULLS LAST";
        assertQuerySql(
            mdx,
            new SqlPattern[]{
                new SqlPattern(
                    Dialect.DatabaseProduct.ORACLE,
                    sqlOracle,
                    sqlOracle.length())});
    }
View Full Code Here

                + "\"customer\".\"yearly_income\" "
                + "order by \"customer\".\"country\" ASC NULLS LAST, "
                + "\"customer\".\"state_province\" ASC NULLS LAST, "
                + "\"customer\".\"city\" ASC NULLS LAST, "
                + "\"fname\" || \" \" || \"lname\" ASC NULLS LAST";
        SqlPattern pattern = new SqlPattern(
            Dialect.DatabaseProduct.ORACLE,
            sqlOracle,
            sqlOracle.length());
        assertQuerySql(mdx, new SqlPattern[]{pattern});
    }
View Full Code Here

            + "member [Measures].[unit sales Male Married] as '([Measures].[unit sales Male],[Marital Status].[Marital Status].[M])' "
            + "select "
            + "non empty {[Measures].[unit sales Male Married],[Measures].[unit sales Female]} on 0, "
            + "non empty [Customers].[name].members on 1 "
            + "from Sales";
        final SqlPattern pattern = new SqlPattern(
            Dialect.DatabaseProduct.ORACLE,
            "select \"customer\".\"country\" as \"c0\", "
            + "\"customer\".\"state_province\" as \"c1\", "
            + "\"customer\".\"city\" as \"c2\", "
            + "\"customer\".\"customer_id\" as \"c3\", "
View Full Code Here

            + "non empty {[Measures].[unit sales Male], [Measures].[unit sales Married]} on 0, "
            + "non empty [Customers].[name].members on 1 "
            + "from Sales";
        final String sqlOracle =
            "select \"customer\".\"country\" as \"c0\", \"customer\".\"state_province\" as \"c1\", \"customer\".\"city\" as \"c2\", \"customer\".\"customer_id\" as \"c3\", \"fname\" || ' ' || \"lname\" as \"c4\", \"fname\" || ' ' || \"lname\" as \"c5\", \"customer\".\"gender\" as \"c6\", \"customer\".\"marital_status\" as \"c7\", \"customer\".\"education\" as \"c8\", \"customer\".\"yearly_income\" as \"c9\" from \"customer\" \"customer\", \"sales_fact_1997\" \"sales_fact_1997\" where \"sales_fact_1997\".\"customer_id\" = \"customer\".\"customer_id\" and (\"customer\".\"gender\" in ('M', 'F')) group by \"customer\".\"country\", \"customer\".\"state_province\", \"customer\".\"city\", \"customer\".\"customer_id\", \"fname\" || ' ' || \"lname\", \"customer\".\"gender\", \"customer\".\"marital_status\", \"customer\".\"education\", \"customer\".\"yearly_income\" order by \"customer\".\"country\" ASC NULLS LAST, \"customer\".\"state_province\" ASC NULLS LAST, \"customer\".\"city\" ASC NULLS LAST, \"fname\" || ' ' || \"lname\" ASC NULLS LAST";
        final SqlPattern pattern = new SqlPattern(
            Dialect.DatabaseProduct.ORACLE,
            sqlOracle,
            sqlOracle.length());
        assertQuerySqlOrNot(
            getTestContext(), mdx, new SqlPattern[]{pattern},true, false, true);
View Full Code Here

    public void testFilterChildlessSnowflakeMembers() {
        propSaver.set(
            MondrianProperties.instance().FilterChildlessSnowflakeMembers,
            false);
        SqlPattern[] patterns = {
            new SqlPattern(
                Dialect.DatabaseProduct.MYSQL,
                "select `product_class`.`product_family` as `c0` "
                + "from `product_class` as `product_class` "
                + "group by `product_class`.`product_family` "
                + "order by ISNULL(`product_class`.`product_family`) ASC,"
View Full Code Here

TOP

Related Classes of mondrian.test.SqlPattern

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.