public void QMWith2ConcatsAndOneBurriedLateTake() { var q1 = new QMExtractorQueriable <ntup>(); var q2 = new QMExtractorQueriable <ntup>(); // THis is not allowed as the current infrastructure doesn't know how to do the Take properly (yet). // So this should cause an exception. It will print out, however, a way around this. var r1 = q1.Concat(q2).Where(x => x.run > 10).Take(300).Count(); var qm = QMExtractorExecutor.LastQM; var qmList = ConcatSplitterQueryVisitor.Split(qm) .DumpToConsole(); }
public void QMWith2ConcatsAndOneLateSkipPerSource() { var q1 = new QMExtractorQueriable <ntup>(); var q2 = new QMExtractorQueriable <ntup>(); // THis is not allowed as the current infrastructure doesn't know how to do the Take properly (yet). // So this should cause an exception. var r1 = q1.Concat(q2).SkipPerSource(300).Count(); var qm = QMExtractorExecutor.LastQM; var qmList = ConcatSplitterQueryVisitor.Split(qm) .DumpToConsole(); Assert.AreEqual(2, qmList.Length); CheckForQuery(() => q1.Skip(300).Count(), qmList, 2); // Can't really tell the difference between q1 and q2. }
public void QMWithSelectAfterConcat() { var q1 = new QMExtractorQueriable <ntup>(); var q2 = new QMExtractorQueriable <ntup>(); var r1 = q1 .Concat(q2) .Select(r => r.run) .Select(r => r * 2) .Count(); var qm = QMExtractorExecutor.LastQM; var qmList = ConcatSplitterQueryVisitor.Split(qm) .DumpToConsole(); Assert.AreEqual(2, qmList.Length); CheckForQuery(() => q1.Select(r => r.run).Select(r => r * 2).Count(), qmList, 2, "r"); }
public void QMWith2SimpleConcats() { var q1 = new QMExtractorQueriable <ntup>(); var q2 = new QMExtractorQueriable <ntup>(); var r1 = q1.Concat(q2).Count(); var qm = QMExtractorExecutor.LastQM; var qmList = ConcatSplitterQueryVisitor.Split(qm) .DumpToConsole(); Assert.AreEqual(2, qmList.Length); CheckForQuery(() => q1.Count(), qmList, 2); // Can't really tell the difference between q1 and q2. // Make sure the query providers are correct! Since we don't care about the order. var providersUsed = ExtractProviders <ntup>(qmList); Assert.IsTrue(providersUsed.Contains(q1.Provider)); Assert.IsTrue(providersUsed.Contains(q2.Provider)); Assert.AreEqual(2, providersUsed.Count); }
public void QMWith3EmbededConcat() { var q1 = new QMExtractorQueriable <ntup>(); var q2 = new QMExtractorQueriable <ntup>(); var q3 = new QMExtractorQueriable <ntup>(); var r1 = q1.Concat(q2.Concat(q3)).Count(); var qm = QMExtractorExecutor.LastQM; var qmList = ConcatSplitterQueryVisitor.Split(qm) .DumpToConsole(); Assert.AreEqual(3, qmList.Length); CheckForQuery(() => q1.Count(), qmList, 3); // Make sure the query providers are correct! Since we don't care about the order. var providersUsed = ExtractProviders <ntup>(qmList); Assert.IsTrue(providersUsed.Contains(q1.Provider)); Assert.IsTrue(providersUsed.Contains(q2.Provider)); Assert.IsTrue(providersUsed.Contains(q3.Provider)); Assert.AreEqual(3, providersUsed.Count); }