示例#1
0
        public SupportQueryPlanBuilder AddIndexBtreeSingle(int stream, string indexName, string property)
        {
            QueryPlanIndex index = _queryPlan.IndexSpecs[stream];

            index.Items.Put(new TableLookupIndexReqKey(indexName), new QueryPlanIndexItem(new string[0], null, new string[] { property }, null, false, null));
            return(this);
        }
示例#2
0
        public SupportQueryPlanBuilder SetIndexFullTableScan(int stream, string indexName)
        {
            QueryPlanIndex index = _queryPlan.IndexSpecs[stream];

            index.Items.Put(new TableLookupIndexReqKey(indexName), new QueryPlanIndexItem(null, null, null, null, false, null));
            return(this);
        }
示例#3
0
 private SupportQueryPlanBuilder(int numStreams)
 {
     QueryPlanIndex[] indexes = new QueryPlanIndex[numStreams];
     for (int i = 0; i < indexes.Length; i++)
     {
         indexes[i] = new QueryPlanIndex(new LinkedHashMap <TableLookupIndexReqKey, QueryPlanIndexItem>());
     }
     _queryPlan = new QueryPlan(indexes, new QueryPlanNode[numStreams]);
 }
        public static void AssertJoinOneStreamAndReset(bool unique)
        {
            Assert.IsTrue(Joins.Count == 1);
            QueryPlan              join      = Joins[0];
            QueryPlanIndex         first     = join.IndexSpecs[1];
            TableLookupIndexReqKey firstName = first.Items.Keys.First();
            QueryPlanIndexItem     index     = first.Items.Get(firstName);

            Assert.AreEqual(unique, index.IsUnique);
            Reset();
        }
        private static void CompareIndex(int streamNum, QueryPlanIndex expected, QueryPlanIndex actual, IDictionary <TableLookupIndexReqKey, TableLookupIndexReqKey> indexNameMapping)
        {
            var actualItems   = actual.Items;
            var expectedItems = expected.Items;

            Assert.AreEqual(expectedItems.Count, actualItems.Count, "Number of indexes mismatch for stream " + streamNum);

            var itActual   = actualItems.GetEnumerator();
            var itExpected = expectedItems.GetEnumerator();

            var count = 0;

            while (itActual.MoveNext())
            {
                Assert.IsTrue(itExpected.MoveNext());
                var actualItem   = itActual.Current;
                var expectedItem = itExpected.Current;
                SupportQueryPlanIndexHelper.CompareIndexItem(streamNum, count, expectedItem.Value, actualItem.Value);
                count++;
                indexNameMapping.Put(actualItem.Key, expectedItem.Key);
            }
        }