00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef Fennel_Test_ExecStreamTestSuite_Included
00025 #define Fennel_Test_ExecStreamTestSuite_Included
00026
00027 #include "fennel/test/ExecStreamUnitTestBase.h"
00028 #include <boost/test/test_tools.hpp>
00029 #include <hash_set>
00030
00031 using namespace fennel;
00032
00039 class FENNEL_TEST_EXPORT ExecStreamTestSuite
00040 : public ExecStreamUnitTestBase
00041 {
00042 protected:
00043 void testCartesianJoinExecStream(uint nRowsLeft,uint nRowsRight);
00044 void testGroupAggExecStreamNrows(uint nrows);
00045 void testReshapeExecStream(
00046 bool cast, bool filter, uint expectedNRows, int expectedStart,
00047 bool compareParam,
00048 std::hash_set<int64_t> const &outputParams);
00049 void testBTreeInsertExecStream(bool useDynamicBTree, uint nRows);
00050 void testNestedLoopJoinExecStream(uint nRowsLeft, uint nRowsRight);
00051 virtual uint getDegreeOfParallelism();
00052 void testSegBufferReaderWriterExecStream(
00053 bool restartable, bool earlyClose);
00054
00055 public:
00063 explicit ExecStreamTestSuite(bool initTestCases = true)
00064 {
00065 if (initTestCases) {
00066 FENNEL_UNIT_TEST_CASE(
00067 ExecStreamTestSuite,testScratchBufferExecStream);
00068 FENNEL_UNIT_TEST_CASE(
00069 ExecStreamTestSuite,testDoubleBufferExecStream);
00070 FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testCopyExecStream);
00071 FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testMergeExecStream);
00072 FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testSegBufferExecStream);
00073 FENNEL_UNIT_TEST_CASE(
00074 ExecStreamTestSuite,testCartesianJoinExecStreamOuter);
00075 FENNEL_UNIT_TEST_CASE(
00076 ExecStreamTestSuite,testCartesianJoinExecStreamInner);
00077 FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testCountAggExecStream);
00078 FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testSumAggExecStream);
00079 FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testGroupAggExecStream1);
00080 FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testGroupAggExecStream2);
00081 FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testGroupAggExecStream3);
00082 FENNEL_UNIT_TEST_CASE(ExecStreamTestSuite,testGroupAggExecStream4);
00083 FENNEL_UNIT_TEST_CASE(
00084 ExecStreamTestSuite,testReshapeExecStreamCastFilter);
00085 FENNEL_UNIT_TEST_CASE(
00086 ExecStreamTestSuite,testReshapeExecStreamNoCastFilter);
00087 FENNEL_UNIT_TEST_CASE(
00088 ExecStreamTestSuite,testReshapeExecStreamDynamicParams);
00089 FENNEL_UNIT_TEST_CASE(
00090 ExecStreamTestSuite,
00091 testSingleValueAggExecStream);
00092 FENNEL_UNIT_TEST_CASE(
00093 ExecStreamTestSuite,
00094 testMergeImplicitPullInputs);
00095 FENNEL_UNIT_TEST_CASE(
00096 ExecStreamTestSuite,
00097 testBTreeInsertExecStreamStaticBTree);
00098 FENNEL_UNIT_TEST_CASE(
00099 ExecStreamTestSuite,
00100 testBTreeInsertExecStreamDynamicBTree);
00101 FENNEL_UNIT_TEST_CASE(
00102 ExecStreamTestSuite,
00103 testNestedLoopJoinExecStream1);
00104 FENNEL_UNIT_TEST_CASE(
00105 ExecStreamTestSuite,
00106 testNestedLoopJoinExecStream2);
00107 FENNEL_UNIT_TEST_CASE(
00108 ExecStreamTestSuite,
00109 testSplitterPlusBarrier);
00110 FENNEL_UNIT_TEST_CASE(
00111 ExecStreamTestSuite,
00112 testSegBufferReaderWriterExecStream1);
00113 FENNEL_UNIT_TEST_CASE(
00114 ExecStreamTestSuite,
00115 testSegBufferReaderWriterExecStream2);
00116 FENNEL_UNIT_TEST_CASE(
00117 ExecStreamTestSuite,
00118 testSegBufferReaderWriterExecStream3);
00119 FENNEL_UNIT_TEST_CASE(
00120 ExecStreamTestSuite,
00121 testSegBufferReaderWriterExecStream4);
00122 }
00123 }
00124
00125 void testScratchBufferExecStream();
00126 void testDoubleBufferExecStream();
00127 void testCopyExecStream();
00128 void testMergeExecStream();
00129 void testSegBufferExecStream();
00130 void testCountAggExecStream();
00131 void testSumAggExecStream();
00132 void testReshapeExecStream();
00133 void testSingleValueAggExecStream();
00134 void testMergeImplicitPullInputs();
00135 void testSplitterPlusBarrier();
00136
00137 void testCartesianJoinExecStreamOuter()
00138 {
00139
00140 testCartesianJoinExecStream(10000,5);
00141 }
00142
00143 void testCartesianJoinExecStreamInner()
00144 {
00145
00146 testCartesianJoinExecStream(5,10000);
00147 }
00148
00149 void testGroupAggExecStream1()
00150 {
00151 testGroupAggExecStreamNrows(10000);
00152 }
00153
00154
00155
00156
00157 void testGroupAggExecStream2()
00158 {
00159 testGroupAggExecStreamNrows(257*2);
00160 }
00161
00162 void testGroupAggExecStream3()
00163 {
00164 testGroupAggExecStreamNrows(258*2);
00165 }
00166
00167 void testGroupAggExecStream4()
00168 {
00169 testGroupAggExecStreamNrows(259*2);
00170 }
00171
00172 void testReshapeExecStreamCastFilter()
00173 {
00174 std::hash_set<int64_t> outputParams;
00175 testReshapeExecStream(true, true, 10, 500, false, outputParams);
00176 }
00177
00178 void testReshapeExecStreamNoCastFilter()
00179 {
00180 std::hash_set<int64_t> outputParams;
00181 testReshapeExecStream(false, false, 1000, 0, false, outputParams);
00182 }
00183
00184 void testReshapeExecStreamDynamicParams()
00185 {
00186 std::hash_set<int64_t> outputParams;
00187 outputParams.insert(0);
00188 outputParams.insert(2);
00189 testReshapeExecStream(true, false, 10, 500, true, outputParams);
00190 }
00191
00192 void testBTreeInsertExecStreamStaticBTree()
00193 {
00194 testBTreeInsertExecStream(false, 1000);
00195 }
00196
00197 void testBTreeInsertExecStreamDynamicBTree()
00198 {
00199 testBTreeInsertExecStream(true, 1000);
00200 }
00201
00202 void testNestedLoopJoinExecStream1()
00203 {
00204 testNestedLoopJoinExecStream(10000, 5);
00205 }
00206
00207 void testNestedLoopJoinExecStream2()
00208 {
00209 testNestedLoopJoinExecStream(5, 10000);
00210 }
00211
00212 void testSegBufferReaderWriterExecStream1()
00213 {
00214 testSegBufferReaderWriterExecStream(false, false);
00215 }
00216
00217 void testSegBufferReaderWriterExecStream2()
00218 {
00219 testSegBufferReaderWriterExecStream(true, false);
00220 }
00221
00222 void testSegBufferReaderWriterExecStream3()
00223 {
00224 testSegBufferReaderWriterExecStream(false, true);
00225 }
00226
00227 void testSegBufferReaderWriterExecStream4()
00228 {
00229 testSegBufferReaderWriterExecStream(true, true);
00230 }
00231 };
00232
00233 #endif
00234