private void RunAssertionDocSample(EPServiceProvider epService)
        {
            epService.EPAdministrator.Configuration.AddEventType(typeof(AEvent));
            epService.EPAdministrator.Configuration.AddEventType(typeof(BEvent));

            var hints = new string[] {
                "@Hint('Exclude_plan(true)')",
                "@Hint('Exclude_plan(opname=\"equals\")')",
                "@Hint('Exclude_plan(opname=\"equals\" and from_streamname=\"a\")')",
                "@Hint('Exclude_plan(opname=\"equals\" and from_streamname=\"b\")')",
                "@Hint('Exclude_plan(exprs[0]=\"aprop\")')"
            };

            foreach (string hint in hints)
            {
                epService.EPAdministrator.CreateEPL("@Audit " + hint +
                                                    "select * from AEvent#keepall as a, BEvent#keepall as b where aprop = bprop");
            }

            // test subquery
            SupportQueryPlanIndexHook.Reset();
            epService.EPAdministrator.CreateEPL(INDEX_CALLBACK_HOOK + "@Hint('Exclude_plan(true)') select (select * from S0#unique(p00) as s0 where s1.p10 = p00) from S1 as s1");
            QueryPlanIndexDescSubquery subq = SupportQueryPlanIndexHook.GetAndResetSubqueries()[0];

            Assert.AreEqual(typeof(SubordFullTableScanLookupStrategyFactory).Name, subq.TableLookupStrategy);

            // test named window
            epService.EPAdministrator.CreateEPL("create window S0Window#keepall as S0");
            epService.EPAdministrator.CreateEPL(INDEX_CALLBACK_HOOK + "@Hint('Exclude_plan(true)') on S1 as s1 select * from S0Window as s0 where s1.p10 = s0.p00");
            QueryPlanIndexDescOnExpr onExpr = SupportQueryPlanIndexHook.GetAndResetOnExpr();

            Assert.AreEqual(typeof(SubordWMatchExprLookupStrategyFactoryAllFiltered).Name, onExpr.StrategyName);

            epService.EPAdministrator.DestroyAllStatements();
        }
示例#2
0
            public void Run(RegressionEnvironment env)
            {
                var schema =
                    "create schema AEvent as " +
                    typeof(AEvent).MaskTypeName() +
                    ";\n" +
                    "create schema BEvent as " +
                    typeof(BEvent).MaskTypeName() +
                    ";\n";
                var path = new RegressionPath();
                env.CompileDeploy(schema, path);

                string[] hints = {
                    "@Hint('exclude_plan(true)')",
                    "@Hint('exclude_plan(opname=\"equals\")')",
                    "@Hint('exclude_plan(opname=\"equals\" and from_streamname=\"a\")')",
                    "@Hint('exclude_plan(opname=\"equals\" and from_streamname=\"b\")')",
                    "@Hint('exclude_plan(exprs[0]=\"aprop\")')"
                };
                foreach (var hint in hints) {
                    env.CompileDeploy(
                        "@Audit " +
                        hint +
                        "select * from AEvent#keepall as a, BEvent#keepall as b where aprop = bprop",
                        path);
                }

                // test subquery
                SupportQueryPlanIndexHook.Reset();
                env.CompileDeploy(
                    INDEX_CALLBACK_HOOK +
                    "@Hint('exclude_plan(true)') select (select * from SupportBean_S0#unique(P00) as S0 where S1.P10 = P00) from SupportBean_S1 as S1",
                    path);
                var subq = SupportQueryPlanIndexHook.GetAndResetSubqueries()[0];
                Assert.AreEqual(typeof(SubordFullTableScanLookupStrategyFactoryForge).Name, subq.TableLookupStrategy);

                // test named window
                env.CompileDeploy("create window S0Window#keepall as SupportBean_S0", path);
                env.CompileDeploy(
                    INDEX_CALLBACK_HOOK +
                    "@Hint('exclude_plan(true)') on SupportBean_S1 as S1 select * from S0Window as S0 where S1.P10 = S0.P00",
                    path);
                var onExpr = SupportQueryPlanIndexHook.GetAndResetOnExpr();
                Assert.AreEqual(typeof(SubordWMatchExprLookupStrategyAllFilteredForge).Name, onExpr.StrategyName);

                env.UndeployAll();
            }