diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 58e731a3..13d24902 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,5 +2,7 @@ add_executable(s3select_test s3select_test.cpp) target_include_directories(s3select_test PUBLIC ../include) target_link_libraries(s3select_test gtest gtest_main boost_date_time boost_thread boost_system pthread) +add_subdirectory(queries_generator) + include(GoogleTest) gtest_discover_tests(s3select_test) diff --git a/test/queries_generator/CMakeLists.txt b/test/queries_generator/CMakeLists.txt new file mode 100644 index 00000000..9a73784c --- /dev/null +++ b/test/queries_generator/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(queries_generator queries_generator.cpp) +add_executable(generate_aws_cmds generate_aws_cmds.cpp) diff --git a/test/queries_generator/aws_results/output1.csv b/test/queries_generator/aws_results/output1.csv new file mode 100644 index 00000000..8b4ef9e9 --- /dev/null +++ b/test/queries_generator/aws_results/output1.csv @@ -0,0 +1,10 @@ +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 diff --git a/test/queries_generator/aws_results/output10.csv b/test/queries_generator/aws_results/output10.csv new file mode 100644 index 00000000..e2c37672 --- /dev/null +++ b/test/queries_generator/aws_results/output10.csv @@ -0,0 +1,10 @@ +7306 +3600 +9023 +7257 +6356 +5735 +7517 +360 +5457 +7079 diff --git a/test/queries_generator/aws_results/output100.csv b/test/queries_generator/aws_results/output100.csv new file mode 100644 index 00000000..31f348e1 --- /dev/null +++ b/test/queries_generator/aws_results/output100.csv @@ -0,0 +1,10 @@ +1940-02-01T15:30:44.640810Z +1940-02-01T15:30:44.640810Z +1940-02-01T15:30:44.640810Z +1940-02-01T15:30:44.640810Z +1940-02-01T15:30:44.640810Z +1940-02-01T15:30:44.640810Z +1940-02-01T15:30:44.640810Z +1940-02-01T15:30:44.640810Z +1940-02-01T15:30:44.640810Z +1940-02-01T15:30:44.640810Z diff --git a/test/queries_generator/aws_results/output11.csv b/test/queries_generator/aws_results/output11.csv new file mode 100644 index 00000000..6b986e37 --- /dev/null +++ b/test/queries_generator/aws_results/output11.csv @@ -0,0 +1,10 @@ +worker +worker +doctor +firefighter +worker +police officer +doctor +developer +doctor +police officer diff --git a/test/queries_generator/aws_results/output12.csv b/test/queries_generator/aws_results/output12.csv new file mode 100644 index 00000000..789ae63c --- /dev/null +++ b/test/queries_generator/aws_results/output12.csv @@ -0,0 +1,10 @@ +am 17 z 8 am +am 17 z 8 am +am 17 z 8 am +am 17 z 8 am +am 17 z 8 am +am 17 z 8 am +am 17 z 8 am +am 17 z 8 am +am 17 z 8 am +am 17 z 8 am diff --git a/test/queries_generator/aws_results/output13.csv b/test/queries_generator/aws_results/output13.csv new file mode 100644 index 00000000..7d38ab68 --- /dev/null +++ b/test/queries_generator/aws_results/output13.csv @@ -0,0 +1,10 @@ +24 8 08 44 +24 8 08 44 +24 8 08 44 +24 8 08 44 +24 8 08 44 +24 8 08 44 +24 8 08 44 +24 8 08 44 +24 8 08 44 +24 8 08 44 diff --git a/test/queries_generator/aws_results/output14.csv b/test/queries_generator/aws_results/output14.csv new file mode 100644 index 00000000..d0ab89db --- /dev/null +++ b/test/queries_generator/aws_results/output14.csv @@ -0,0 +1,10 @@ +42190 +20802 +34669 +37651 +42153 +44993 +7779 +22578 +37872 +5880 diff --git a/test/queries_generator/aws_results/output15.csv b/test/queries_generator/aws_results/output15.csv new file mode 100644 index 00000000..09c4661d --- /dev/null +++ b/test/queries_generator/aws_results/output15.csv @@ -0,0 +1,10 @@ +7325 +3639 +9082 +7336 +6455 +5854 +7656 +520 +5637 +7279 diff --git a/test/queries_generator/aws_results/output16.csv b/test/queries_generator/aws_results/output16.csv new file mode 100644 index 00000000..345a9f63 --- /dev/null +++ b/test/queries_generator/aws_results/output16.csv @@ -0,0 +1,10 @@ +-257556 +-127015 +-213488 +-230331 +-256816 +-273497 +-51294 +-135805 +-230642 +-39676 diff --git a/test/queries_generator/aws_results/output17.csv b/test/queries_generator/aws_results/output17.csv new file mode 100644 index 00000000..248f4ce7 --- /dev/null +++ b/test/queries_generator/aws_results/output17.csv @@ -0,0 +1,10 @@ +1926-10-01T02:11:24.471167Z +1926-10-01T02:11:24.471167Z +1926-10-01T02:11:24.471167Z +1926-10-01T02:11:24.471167Z +1926-10-01T02:11:24.471167Z +1926-10-01T02:11:24.471167Z +1926-10-01T02:11:24.471167Z +1926-10-01T02:11:24.471167Z +1926-10-01T02:11:24.471167Z +1926-10-01T02:11:24.471167Z diff --git a/test/queries_generator/aws_results/output18.csv b/test/queries_generator/aws_results/output18.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output18.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/aws_results/output19.csv b/test/queries_generator/aws_results/output19.csv new file mode 100644 index 00000000..832b83f9 --- /dev/null +++ b/test/queries_generator/aws_results/output19.csv @@ -0,0 +1,10 @@ +25 +00 29 +25 +00 29 +25 +00 29 +25 +00 29 +25 +00 29 +25 +00 29 +25 +00 29 +25 +00 29 +25 +00 29 +25 +00 29 diff --git a/test/queries_generator/aws_results/output2.csv b/test/queries_generator/aws_results/output2.csv new file mode 100644 index 00000000..80e62dfc --- /dev/null +++ b/test/queries_generator/aws_results/output2.csv @@ -0,0 +1,10 @@ +1935-09-17T01:37:17.162313Z +1935-09-17T01:37:17.162313Z +1935-09-17T01:37:17.162313Z +1935-09-17T01:37:17.162313Z +1935-09-17T01:37:17.162313Z +1935-09-17T01:37:17.162313Z +1935-09-17T01:37:17.162313Z +1935-09-17T01:37:17.162313Z +1935-09-17T01:37:17.162313Z +1935-09-17T01:37:17.162313Z diff --git a/test/queries_generator/aws_results/output20.csv b/test/queries_generator/aws_results/output20.csv new file mode 100644 index 00000000..fa7c35a5 --- /dev/null +++ b/test/queries_generator/aws_results/output20.csv @@ -0,0 +1,10 @@ +88884 +43859 +76683 +80270 +87774 +92454 +23891 +43514 +78662 +19829 diff --git a/test/queries_generator/aws_results/output21.csv b/test/queries_generator/aws_results/output21.csv new file mode 100644 index 00000000..972ef591 --- /dev/null +++ b/test/queries_generator/aws_results/output21.csv @@ -0,0 +1,10 @@ +1901-10-21T11:53:51.849814Z +1901-10-21T11:53:51.849814Z +1901-10-21T11:53:51.849814Z +1901-10-21T11:53:51.849814Z +1901-10-21T11:53:51.849814Z +1901-10-21T11:53:51.849814Z +1901-10-21T11:53:51.849814Z +1901-10-21T11:53:51.849814Z +1901-10-21T11:53:51.849814Z +1901-10-21T11:53:51.849814Z diff --git a/test/queries_generator/aws_results/output22.csv b/test/queries_generator/aws_results/output22.csv new file mode 100644 index 00000000..3431a271 --- /dev/null +++ b/test/queries_generator/aws_results/output22.csv @@ -0,0 +1,10 @@ +658155 +658155 +658155 +658155 +658155 +658155 +658155 +658155 +658155 +658155 diff --git a/test/queries_generator/aws_results/output23.csv b/test/queries_generator/aws_results/output23.csv new file mode 100644 index 00000000..0e3272db --- /dev/null +++ b/test/queries_generator/aws_results/output23.csv @@ -0,0 +1,10 @@ +Z : +Z : +Z : +Z : +Z : +Z : +Z : +Z : +Z : +Z : diff --git a/test/queries_generator/aws_results/output24.csv b/test/queries_generator/aws_results/output24.csv new file mode 100644 index 00000000..2ad8dd7d --- /dev/null +++ b/test/queries_generator/aws_results/output24.csv @@ -0,0 +1,10 @@ +38498 +19147 +47722 +38556 +33931 +30775 +40236 +2767 +29631 +38251 diff --git a/test/queries_generator/aws_results/output25.csv b/test/queries_generator/aws_results/output25.csv new file mode 100644 index 00000000..36bdc29e --- /dev/null +++ b/test/queries_generator/aws_results/output25.csv @@ -0,0 +1,10 @@ +z 04 307516 307516 +z 04 307516 307516 +z 04 307516 307516 +z 04 307516 307516 +z 04 307516 307516 +z 04 307516 307516 +z 04 307516 307516 +z 04 307516 307516 +z 04 307516 307516 +z 04 307516 307516 diff --git a/test/queries_generator/aws_results/output26.csv b/test/queries_generator/aws_results/output26.csv new file mode 100644 index 00000000..263075cc --- /dev/null +++ b/test/queries_generator/aws_results/output26.csv @@ -0,0 +1,10 @@ +1911-09-24T00:04:03.726161Z +1911-09-24T00:04:03.726161Z +1911-09-24T00:04:03.726161Z +1911-09-24T00:04:03.726161Z +1911-09-24T00:04:03.726161Z +1911-09-24T00:04:03.726161Z +1911-09-24T00:04:03.726161Z +1911-09-24T00:04:03.726161Z +1911-09-24T00:04:03.726161Z +1911-09-24T00:04:03.726161Z diff --git a/test/queries_generator/aws_results/output27.csv b/test/queries_generator/aws_results/output27.csv new file mode 100644 index 00000000..c140edea --- /dev/null +++ b/test/queries_generator/aws_results/output27.csv @@ -0,0 +1,10 @@ +314819455 +77224682 +323467040 +281960028 +276672295 +267247432 +65520585 +11950388 +216988318 +48174519 diff --git a/test/queries_generator/aws_results/output28.csv b/test/queries_generator/aws_results/output28.csv new file mode 100644 index 00000000..95063a14 --- /dev/null +++ b/test/queries_generator/aws_results/output28.csv @@ -0,0 +1,10 @@ +1921-01-19T01:02:46.247190Z +1921-01-19T01:02:46.247190Z +1921-01-19T01:02:46.247190Z +1921-01-19T01:02:46.247190Z +1921-01-19T01:02:46.247190Z +1921-01-19T01:02:46.247190Z +1921-01-19T01:02:46.247190Z +1921-01-19T01:02:46.247190Z +1921-01-19T01:02:46.247190Z +1921-01-19T01:02:46.247190Z diff --git a/test/queries_generator/aws_results/output29.csv b/test/queries_generator/aws_results/output29.csv new file mode 100644 index 00000000..9d9dbf47 --- /dev/null +++ b/test/queries_generator/aws_results/output29.csv @@ -0,0 +1,10 @@ +50259 +24815 +44669 +45729 +49261 +51439 +16206 +23153 +44075 +13888 diff --git a/test/queries_generator/aws_results/output3.csv b/test/queries_generator/aws_results/output3.csv new file mode 100644 index 00000000..6c1401f9 --- /dev/null +++ b/test/queries_generator/aws_results/output3.csv @@ -0,0 +1,10 @@ +1928-05-10T10:02:38.119492Z +1928-05-10T10:02:38.119492Z +1928-05-10T10:02:38.119492Z +1928-05-10T10:02:38.119492Z +1928-05-10T10:02:38.119492Z +1928-05-10T10:02:38.119492Z +1928-05-10T10:02:38.119492Z +1928-05-10T10:02:38.119492Z +1928-05-10T10:02:38.119492Z +1928-05-10T10:02:38.119492Z diff --git a/test/queries_generator/aws_results/output30.csv b/test/queries_generator/aws_results/output30.csv new file mode 100644 index 00000000..f00c965d --- /dev/null +++ b/test/queries_generator/aws_results/output30.csv @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/test/queries_generator/aws_results/output31.csv b/test/queries_generator/aws_results/output31.csv new file mode 100644 index 00000000..c27a9122 --- /dev/null +++ b/test/queries_generator/aws_results/output31.csv @@ -0,0 +1,10 @@ +27067 +27067 +27067 +27067 +27067 +27067 +27067 +27067 +27067 +27067 diff --git a/test/queries_generator/aws_results/output32.csv b/test/queries_generator/aws_results/output32.csv new file mode 100644 index 00000000..04ebe063 --- /dev/null +++ b/test/queries_generator/aws_results/output32.csv @@ -0,0 +1,10 @@ +1970-03-06T01:06:41.606432Z +1970-03-06T01:06:41.606432Z +1970-03-06T01:06:41.606432Z +1970-03-06T01:06:41.606432Z +1970-03-06T01:06:41.606432Z +1970-03-06T01:06:41.606432Z +1970-03-06T01:06:41.606432Z +1970-03-06T01:06:41.606432Z +1970-03-06T01:06:41.606432Z +1970-03-06T01:06:41.606432Z diff --git a/test/queries_generator/aws_results/output33.csv b/test/queries_generator/aws_results/output33.csv new file mode 100644 index 00000000..2d5dd852 --- /dev/null +++ b/test/queries_generator/aws_results/output33.csv @@ -0,0 +1,10 @@ +332 +332 +332 +332 +332 +332 +331 +331 +331 +331 diff --git a/test/queries_generator/aws_results/output34.csv b/test/queries_generator/aws_results/output34.csv new file mode 100644 index 00000000..60d3b2f4 --- /dev/null +++ b/test/queries_generator/aws_results/output34.csv @@ -0,0 +1 @@ +15 diff --git a/test/queries_generator/aws_results/output35.csv b/test/queries_generator/aws_results/output35.csv new file mode 100644 index 00000000..593ec0a9 --- /dev/null +++ b/test/queries_generator/aws_results/output35.csv @@ -0,0 +1,10 @@ +1944-02-22T20:21:23.730763Z +1944-02-22T20:21:23.730763Z +1944-02-22T20:21:23.730763Z +1944-02-22T20:21:23.730763Z +1944-02-22T20:21:23.730763Z +1944-02-22T20:21:23.730763Z +1944-02-22T20:21:23.730763Z +1944-02-22T20:21:23.730763Z +1944-02-22T20:21:23.730763Z +1944-02-22T20:21:23.730763Z diff --git a/test/queries_generator/aws_results/output36.csv b/test/queries_generator/aws_results/output36.csv new file mode 100644 index 00000000..efaa73c7 --- /dev/null +++ b/test/queries_generator/aws_results/output36.csv @@ -0,0 +1,10 @@ +0 +-10585 +-23721 +-28791 +-34242 +-37985 +-7327 +-19804 +-34168 +-5950 diff --git a/test/queries_generator/aws_results/output37.csv b/test/queries_generator/aws_results/output37.csv new file mode 100644 index 00000000..7f510f19 --- /dev/null +++ b/test/queries_generator/aws_results/output37.csv @@ -0,0 +1,10 @@ +3577 +1764 +2965 +3199 +3566 +3798 +712 +1886 +3203 +550 diff --git a/test/queries_generator/aws_results/output38.csv b/test/queries_generator/aws_results/output38.csv new file mode 100644 index 00000000..09e2076e --- /dev/null +++ b/test/queries_generator/aws_results/output38.csv @@ -0,0 +1,10 @@ +1939-08-27T10:46:42.829453Z +1939-08-27T10:46:42.829453Z +1939-08-27T10:46:42.829453Z +1939-08-27T10:46:42.829453Z +1939-08-27T10:46:42.829453Z +1939-08-27T10:46:42.829453Z +1939-08-27T10:46:42.829453Z +1939-08-27T10:46:42.829453Z +1939-08-27T10:46:42.829453Z +1939-08-27T10:46:42.829453Z diff --git a/test/queries_generator/aws_results/output39.csv b/test/queries_generator/aws_results/output39.csv new file mode 100644 index 00000000..4521d575 --- /dev/null +++ b/test/queries_generator/aws_results/output39.csv @@ -0,0 +1,10 @@ +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 diff --git a/test/queries_generator/aws_results/output4.csv b/test/queries_generator/aws_results/output4.csv new file mode 100644 index 00000000..237cb24c --- /dev/null +++ b/test/queries_generator/aws_results/output4.csv @@ -0,0 +1,10 @@ +35591 +17520 +26489 +31042 +36337 +39718 +882 +22104 +32793 +-677 diff --git a/test/queries_generator/aws_results/output40.csv b/test/queries_generator/aws_results/output40.csv new file mode 100644 index 00000000..9e07f728 --- /dev/null +++ b/test/queries_generator/aws_results/output40.csv @@ -0,0 +1,10 @@ +1916-03-19T14:11:08.451358Z +1916-03-19T14:11:08.451358Z +1916-03-19T14:11:08.451358Z +1916-03-19T14:11:08.451358Z +1916-03-19T14:11:08.451358Z +1916-03-19T14:11:08.451358Z +1916-03-19T14:11:08.451358Z +1916-03-19T14:11:08.451358Z +1916-03-19T14:11:08.451358Z +1916-03-19T14:11:08.451358Z diff --git a/test/queries_generator/aws_results/output41.csv b/test/queries_generator/aws_results/output41.csv new file mode 100644 index 00000000..e26e69bc --- /dev/null +++ b/test/queries_generator/aws_results/output41.csv @@ -0,0 +1,10 @@ +1944-04-18T02:26:20.517916Z +1944-04-18T02:26:20.517916Z +1944-04-18T02:26:20.517916Z +1944-04-18T02:26:20.517916Z +1944-04-18T02:26:20.517916Z +1944-04-18T02:26:20.517916Z +1944-04-18T02:26:20.517916Z +1944-04-18T02:26:20.517916Z +1944-04-18T02:26:20.517916Z +1944-04-18T02:26:20.517916Z diff --git a/test/queries_generator/aws_results/output42.csv b/test/queries_generator/aws_results/output42.csv new file mode 100644 index 00000000..fcbc0bd3 --- /dev/null +++ b/test/queries_generator/aws_results/output42.csv @@ -0,0 +1 @@ +-110211175 diff --git a/test/queries_generator/aws_results/output43.csv b/test/queries_generator/aws_results/output43.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output43.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/aws_results/output44.csv b/test/queries_generator/aws_results/output44.csv new file mode 100644 index 00000000..a9651949 --- /dev/null +++ b/test/queries_generator/aws_results/output44.csv @@ -0,0 +1,10 @@ +14319 +7071 +11879 +12819 +14294 +15225 +2884 +7583 +12856 +2250 diff --git a/test/queries_generator/aws_results/output45.csv b/test/queries_generator/aws_results/output45.csv new file mode 100644 index 00000000..93e2db57 --- /dev/null +++ b/test/queries_generator/aws_results/output45.csv @@ -0,0 +1 @@ +24194 diff --git a/test/queries_generator/aws_results/output46.csv b/test/queries_generator/aws_results/output46.csv new file mode 100644 index 00000000..bfb5f017 --- /dev/null +++ b/test/queries_generator/aws_results/output46.csv @@ -0,0 +1,10 @@ +1920-06-01T06:23:21.691783Z +1920-06-01T06:23:21.691783Z +1920-06-01T06:23:21.691783Z +1920-06-01T06:23:21.691783Z +1920-06-01T06:23:21.691783Z +1920-06-01T06:23:21.691783Z +1920-06-01T06:23:21.691783Z +1920-06-01T06:23:21.691783Z +1920-06-01T06:23:21.691783Z +1920-06-01T06:23:21.691783Z diff --git a/test/queries_generator/aws_results/output47.csv b/test/queries_generator/aws_results/output47.csv new file mode 100644 index 00000000..725d6975 --- /dev/null +++ b/test/queries_generator/aws_results/output47.csv @@ -0,0 +1,10 @@ +-7336 +-3660 +-9113 +-7377 +-6506 +-5915 +-7727 +-600 +-5727 +-7379 diff --git a/test/queries_generator/aws_results/output48.csv b/test/queries_generator/aws_results/output48.csv new file mode 100644 index 00000000..4521d575 --- /dev/null +++ b/test/queries_generator/aws_results/output48.csv @@ -0,0 +1,10 @@ +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 diff --git a/test/queries_generator/aws_results/output49.csv b/test/queries_generator/aws_results/output49.csv new file mode 100644 index 00000000..8ad7525e --- /dev/null +++ b/test/queries_generator/aws_results/output49.csv @@ -0,0 +1,10 @@ +314594000 +314594000 +314594000 +314594000 +314594000 +314594000 +314594000 +314594000 +314594000 +314594000 diff --git a/test/queries_generator/aws_results/output5.csv b/test/queries_generator/aws_results/output5.csv new file mode 100644 index 00000000..2a2d25d7 --- /dev/null +++ b/test/queries_generator/aws_results/output5.csv @@ -0,0 +1,10 @@ +1236536058 +301474200 +956943775 +1019175762 +1193026786 +1306423230 +102468482 +268093764 +956052126 +70417210 diff --git a/test/queries_generator/aws_results/output50.csv b/test/queries_generator/aws_results/output50.csv new file mode 100644 index 00000000..ae3f3f08 --- /dev/null +++ b/test/queries_generator/aws_results/output50.csv @@ -0,0 +1,10 @@ ++0000 4 +00 Z 344883 53 344 68 Z ++0000 4 +00 Z 344883 53 344 68 Z ++0000 4 +00 Z 344883 53 344 68 Z ++0000 4 +00 Z 344883 53 344 68 Z ++0000 4 +00 Z 344883 53 344 68 Z ++0000 4 +00 Z 344883 53 344 68 Z ++0000 4 +00 Z 344883 53 344 68 Z ++0000 4 +00 Z 344883 53 344 68 Z ++0000 4 +00 Z 344883 53 344 68 Z ++0000 4 +00 Z 344883 53 344 68 Z diff --git a/test/queries_generator/aws_results/output51.csv b/test/queries_generator/aws_results/output51.csv new file mode 100644 index 00000000..cf6354d4 --- /dev/null +++ b/test/queries_generator/aws_results/output51.csv @@ -0,0 +1,10 @@ +1959-04-26T19:23:27.653319Z +1959-04-26T19:23:27.653319Z +1959-04-26T19:23:27.653319Z +1959-04-26T19:23:27.653319Z +1959-04-26T19:23:27.653319Z +1959-04-26T19:23:27.653319Z +1959-04-26T19:23:27.653319Z +1959-04-26T19:23:27.653319Z +1959-04-26T19:23:27.653319Z +1959-04-26T19:23:27.653319Z diff --git a/test/queries_generator/aws_results/output52.csv b/test/queries_generator/aws_results/output52.csv new file mode 100644 index 00000000..15c332cf --- /dev/null +++ b/test/queries_generator/aws_results/output52.csv @@ -0,0 +1,10 @@ +42945 +21188 +35600 +38407 +42821 +45601 +8567 +22652 +38458 +6630 diff --git a/test/queries_generator/aws_results/output53.csv b/test/queries_generator/aws_results/output53.csv new file mode 100644 index 00000000..023a9cba --- /dev/null +++ b/test/queries_generator/aws_results/output53.csv @@ -0,0 +1,10 @@ +1591476 +791614 +1972745 +1593863 +1402686 +1272269 +1663303 +114574 +1224963 +1581277 diff --git a/test/queries_generator/aws_results/output54.csv b/test/queries_generator/aws_results/output54.csv new file mode 100644 index 00000000..0feee2ae --- /dev/null +++ b/test/queries_generator/aws_results/output54.csv @@ -0,0 +1,10 @@ +1914-05-26T23:17:08.436790Z +1914-05-26T23:17:08.436790Z +1914-05-26T23:17:08.436790Z +1914-05-26T23:17:08.436790Z +1914-05-26T23:17:08.436790Z +1914-05-26T23:17:08.436790Z +1914-05-26T23:17:08.436790Z +1914-05-26T23:17:08.436790Z +1914-05-26T23:17:08.436790Z +1914-05-26T23:17:08.436790Z diff --git a/test/queries_generator/aws_results/output55.csv b/test/queries_generator/aws_results/output55.csv new file mode 100644 index 00000000..b5dd7ba0 --- /dev/null +++ b/test/queries_generator/aws_results/output55.csv @@ -0,0 +1,10 @@ +1921-04-03T08:59:19.330304Z +1921-04-03T08:59:19.330304Z +1921-04-03T08:59:19.330304Z +1921-04-03T08:59:19.330304Z +1921-04-03T08:59:19.330304Z +1921-04-03T08:59:19.330304Z +1921-04-03T08:59:19.330304Z +1921-04-03T08:59:19.330304Z +1921-04-03T08:59:19.330304Z +1921-04-03T08:59:19.330304Z diff --git a/test/queries_generator/aws_results/output56.csv b/test/queries_generator/aws_results/output56.csv new file mode 100644 index 00000000..3401ffdd --- /dev/null +++ b/test/queries_generator/aws_results/output56.csv @@ -0,0 +1,10 @@ +7334 +7297 +27275 +29383 +32324 +35183 +53661 +4231 +50813 +72879 diff --git a/test/queries_generator/aws_results/output57.csv b/test/queries_generator/aws_results/output57.csv new file mode 100644 index 00000000..3613b2c9 --- /dev/null +++ b/test/queries_generator/aws_results/output57.csv @@ -0,0 +1 @@ +-134685 diff --git a/test/queries_generator/aws_results/output58.csv b/test/queries_generator/aws_results/output58.csv new file mode 100644 index 00000000..d2156a35 --- /dev/null +++ b/test/queries_generator/aws_results/output58.csv @@ -0,0 +1,10 @@ +42920 +21163 +35575 +38382 +42796 +45576 +8542 +22627 +38433 +6605 diff --git a/test/queries_generator/aws_results/output59.csv b/test/queries_generator/aws_results/output59.csv new file mode 100644 index 00000000..c1d2f765 --- /dev/null +++ b/test/queries_generator/aws_results/output59.csv @@ -0,0 +1,10 @@ +6 +6 +6 +11 +6 +14 +6 +9 +6 +14 diff --git a/test/queries_generator/aws_results/output6.csv b/test/queries_generator/aws_results/output6.csv new file mode 100644 index 00000000..68c1320f --- /dev/null +++ b/test/queries_generator/aws_results/output6.csv @@ -0,0 +1,10 @@ +36 +36 +36 +36 +36 +36 +36 +36 +36 +36 diff --git a/test/queries_generator/aws_results/output60.csv b/test/queries_generator/aws_results/output60.csv new file mode 100644 index 00000000..21922364 --- /dev/null +++ b/test/queries_generator/aws_results/output60.csv @@ -0,0 +1 @@ +-15 diff --git a/test/queries_generator/aws_results/output61.csv b/test/queries_generator/aws_results/output61.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output61.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/aws_results/output62.csv b/test/queries_generator/aws_results/output62.csv new file mode 100644 index 00000000..bca7db68 --- /dev/null +++ b/test/queries_generator/aws_results/output62.csv @@ -0,0 +1,10 @@ +1929-08-14T13:50:58.15506Z +1929-08-14T13:50:58.15506Z +1929-08-14T13:50:58.15506Z +1929-08-14T13:50:58.15506Z +1929-08-14T13:50:58.15506Z +1929-08-14T13:50:58.15506Z +1929-08-14T13:50:58.15506Z +1929-08-14T13:50:58.15506Z +1929-08-14T13:50:58.15506Z +1929-08-14T13:50:58.15506Z diff --git a/test/queries_generator/aws_results/output63.csv b/test/queries_generator/aws_results/output63.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output63.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/aws_results/output64.csv b/test/queries_generator/aws_results/output64.csv new file mode 100644 index 00000000..c15df136 --- /dev/null +++ b/test/queries_generator/aws_results/output64.csv @@ -0,0 +1,10 @@ +1933 AM 9 33 07 +00:00 Z 10 +1933 AM 9 33 07 +00:00 Z 10 +1933 AM 9 33 07 +00:00 Z 10 +1933 AM 9 33 07 +00:00 Z 10 +1933 AM 9 33 07 +00:00 Z 10 +1933 AM 9 33 07 +00:00 Z 10 +1933 AM 9 33 07 +00:00 Z 10 +1933 AM 9 33 07 +00:00 Z 10 +1933 AM 9 33 07 +00:00 Z 10 +1933 AM 9 33 07 +00:00 Z 10 diff --git a/test/queries_generator/aws_results/output65.csv b/test/queries_generator/aws_results/output65.csv new file mode 100644 index 00000000..5c934841 --- /dev/null +++ b/test/queries_generator/aws_results/output65.csv @@ -0,0 +1 @@ +-41 diff --git a/test/queries_generator/aws_results/output66.csv b/test/queries_generator/aws_results/output66.csv new file mode 100644 index 00000000..a51986a2 --- /dev/null +++ b/test/queries_generator/aws_results/output66.csv @@ -0,0 +1,10 @@ +44010 +43060 +125708 +159231 +209986 +263079 +97266 +161584 +341364 +103200 diff --git a/test/queries_generator/aws_results/output67.csv b/test/queries_generator/aws_results/output67.csv new file mode 100644 index 00000000..139da986 --- /dev/null +++ b/test/queries_generator/aws_results/output67.csv @@ -0,0 +1,10 @@ +1965-01-10T14:07:51.970104Z +1965-01-10T14:07:51.970104Z +1965-01-10T14:07:51.970104Z +1965-01-10T14:07:51.970104Z +1965-01-10T14:07:51.970104Z +1965-01-10T14:07:51.970104Z +1965-01-10T14:07:51.970104Z +1965-01-10T14:07:51.970104Z +1965-01-10T14:07:51.970104Z +1965-01-10T14:07:51.970104Z diff --git a/test/queries_generator/aws_results/output68.csv b/test/queries_generator/aws_results/output68.csv new file mode 100644 index 00000000..13f6ca37 --- /dev/null +++ b/test/queries_generator/aws_results/output68.csv @@ -0,0 +1,10 @@ +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 diff --git a/test/queries_generator/aws_results/output69.csv b/test/queries_generator/aws_results/output69.csv new file mode 100644 index 00000000..b4d95fee --- /dev/null +++ b/test/queries_generator/aws_results/output69.csv @@ -0,0 +1,10 @@ +1911-07-21T12:23:13.78892Z +1911-07-21T12:23:13.78892Z +1911-07-21T12:23:13.78892Z +1911-07-21T12:23:13.78892Z +1911-07-21T12:23:13.78892Z +1911-07-21T12:23:13.78892Z +1911-07-21T12:23:13.78892Z +1911-07-21T12:23:13.78892Z +1911-07-21T12:23:13.78892Z +1911-07-21T12:23:13.78892Z diff --git a/test/queries_generator/aws_results/output7.csv b/test/queries_generator/aws_results/output7.csv new file mode 100644 index 00000000..29e18647 --- /dev/null +++ b/test/queries_generator/aws_results/output7.csv @@ -0,0 +1,10 @@ ++0000 : 68020 ++0000 : 68020 ++0000 : 68020 ++0000 : 68020 ++0000 : 68020 ++0000 : 68020 ++0000 : 68020 ++0000 : 68020 ++0000 : 68020 ++0000 : 68020 diff --git a/test/queries_generator/aws_results/output70.csv b/test/queries_generator/aws_results/output70.csv new file mode 100644 index 00000000..0edfb3fd --- /dev/null +++ b/test/queries_generator/aws_results/output70.csv @@ -0,0 +1,10 @@ +1994-05-17T02:52:46.806937Z +1994-05-17T02:52:46.806937Z +1994-05-17T02:52:46.806937Z +1994-05-17T02:52:46.806937Z +1994-05-17T02:52:46.806937Z +1994-05-17T02:52:46.806937Z +1994-05-17T02:52:46.806937Z +1994-05-17T02:52:46.806937Z +1994-05-17T02:52:46.806937Z +1994-05-17T02:52:46.806937Z diff --git a/test/queries_generator/aws_results/output71.csv b/test/queries_generator/aws_results/output71.csv new file mode 100644 index 00000000..04da1a42 --- /dev/null +++ b/test/queries_generator/aws_results/output71.csv @@ -0,0 +1,10 @@ +8 +0 +0 +0 +0 +0 +0 +0 +0 +0 diff --git a/test/queries_generator/aws_results/output72.csv b/test/queries_generator/aws_results/output72.csv new file mode 100644 index 00000000..7f2d2646 --- /dev/null +++ b/test/queries_generator/aws_results/output72.csv @@ -0,0 +1,10 @@ +1965-02-09T18:58:50.116846Z +1965-02-09T18:58:50.116846Z +1965-02-09T18:58:50.116846Z +1965-02-09T18:58:50.116846Z +1965-02-09T18:58:50.116846Z +1965-02-09T18:58:50.116846Z +1965-02-09T18:58:50.116846Z +1965-02-09T18:58:50.116846Z +1965-02-09T18:58:50.116846Z +1965-02-09T18:58:50.116846Z diff --git a/test/queries_generator/aws_results/output73.csv b/test/queries_generator/aws_results/output73.csv new file mode 100644 index 00000000..f7cb00d0 --- /dev/null +++ b/test/queries_generator/aws_results/output73.csv @@ -0,0 +1,10 @@ +5.5 +9.0 +2.1 +4.7 +7.0 +0.1 +3.6 +5.3 +2.8 +1.0 diff --git a/test/queries_generator/aws_results/output74.csv b/test/queries_generator/aws_results/output74.csv new file mode 100644 index 00000000..13f6ca37 --- /dev/null +++ b/test/queries_generator/aws_results/output74.csv @@ -0,0 +1,10 @@ +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 diff --git a/test/queries_generator/aws_results/output75.csv b/test/queries_generator/aws_results/output75.csv new file mode 100644 index 00000000..c70af3ed --- /dev/null +++ b/test/queries_generator/aws_results/output75.csv @@ -0,0 +1,10 @@ +-8 +-8 +-8 +-8 +-8 +-8 +-8 +-8 +-8 +-8 diff --git a/test/queries_generator/aws_results/output76.csv b/test/queries_generator/aws_results/output76.csv new file mode 100644 index 00000000..e8b406b7 --- /dev/null +++ b/test/queries_generator/aws_results/output76.csv @@ -0,0 +1,10 @@ +14640 +7240 +18098 +14578 +12788 +11558 +15134 +832 +11038 +14294 diff --git a/test/queries_generator/aws_results/output77.csv b/test/queries_generator/aws_results/output77.csv new file mode 100644 index 00000000..d74b8de7 --- /dev/null +++ b/test/queries_generator/aws_results/output77.csv @@ -0,0 +1,10 @@ +264026 +71139 +133327 +93645 +77546 +69380 +91988 +6543 +72760 +98361 diff --git a/test/queries_generator/aws_results/output78.csv b/test/queries_generator/aws_results/output78.csv new file mode 100644 index 00000000..abe805b4 --- /dev/null +++ b/test/queries_generator/aws_results/output78.csv @@ -0,0 +1 @@ +-47823435 diff --git a/test/queries_generator/aws_results/output79.csv b/test/queries_generator/aws_results/output79.csv new file mode 100644 index 00000000..6f4247a6 --- /dev/null +++ b/test/queries_generator/aws_results/output79.csv @@ -0,0 +1 @@ +26 diff --git a/test/queries_generator/aws_results/output8.csv b/test/queries_generator/aws_results/output8.csv new file mode 100644 index 00000000..8eb496c6 --- /dev/null +++ b/test/queries_generator/aws_results/output8.csv @@ -0,0 +1,10 @@ +1937-09-16T10:17:51.46268Z +1937-09-16T10:17:51.46268Z +1937-09-16T10:17:51.46268Z +1937-09-16T10:17:51.46268Z +1937-09-16T10:17:51.46268Z +1937-09-16T10:17:51.46268Z +1937-09-16T10:17:51.46268Z +1937-09-16T10:17:51.46268Z +1937-09-16T10:17:51.46268Z +1937-09-16T10:17:51.46268Z diff --git a/test/queries_generator/aws_results/output80.csv b/test/queries_generator/aws_results/output80.csv new file mode 100644 index 00000000..5fe17c85 --- /dev/null +++ b/test/queries_generator/aws_results/output80.csv @@ -0,0 +1,10 @@ +1975-04-27T01:11:59.650881Z +1975-04-27T01:11:59.650881Z +1975-04-27T01:11:59.650881Z +1975-04-27T01:11:59.650881Z +1975-04-27T01:11:59.650881Z +1975-04-27T01:11:59.650881Z +1975-04-27T01:11:59.650881Z +1975-04-27T01:11:59.650881Z +1975-04-27T01:11:59.650881Z +1975-04-27T01:11:59.650881Z diff --git a/test/queries_generator/aws_results/output81.csv b/test/queries_generator/aws_results/output81.csv new file mode 100644 index 00000000..e06023f1 --- /dev/null +++ b/test/queries_generator/aws_results/output81.csv @@ -0,0 +1,10 @@ +1979-06-11T01:26:45.282716Z +1979-06-11T01:26:45.282716Z +1979-06-11T01:26:45.282716Z +1979-06-11T01:26:45.282716Z +1979-06-11T01:26:45.282716Z +1979-06-11T01:26:45.282716Z +1979-06-11T01:26:45.282716Z +1979-06-11T01:26:45.282716Z +1979-06-11T01:26:45.282716Z +1979-06-11T01:26:45.282716Z diff --git a/test/queries_generator/aws_results/output82.csv b/test/queries_generator/aws_results/output82.csv new file mode 100644 index 00000000..6c79711f --- /dev/null +++ b/test/queries_generator/aws_results/output82.csv @@ -0,0 +1,10 @@ +1986-06-13T02:07:35.12599Z +1986-06-13T02:07:35.12599Z +1986-06-13T02:07:35.12599Z +1986-06-13T02:07:35.12599Z +1986-06-13T02:07:35.12599Z +1986-06-13T02:07:35.12599Z +1986-06-13T02:07:35.12599Z +1986-06-13T02:07:35.12599Z +1986-06-13T02:07:35.12599Z +1986-06-13T02:07:35.12599Z diff --git a/test/queries_generator/aws_results/output83.csv b/test/queries_generator/aws_results/output83.csv new file mode 100644 index 00000000..536352aa --- /dev/null +++ b/test/queries_generator/aws_results/output83.csv @@ -0,0 +1,10 @@ +4617769257712 +1126860079104 +17643823945566 +16567961373600 +17884086353920 +18802448646696 +7030996270200 +100955492352 +22048166429550 +7020930789180 diff --git a/test/queries_generator/aws_results/output84.csv b/test/queries_generator/aws_results/output84.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output84.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/aws_results/output85.csv b/test/queries_generator/aws_results/output85.csv new file mode 100644 index 00000000..b327524b --- /dev/null +++ b/test/queries_generator/aws_results/output85.csv @@ -0,0 +1,10 @@ +42925 +21168 +35580 +38387 +42801 +45581 +8547 +22632 +38438 +6610 diff --git a/test/queries_generator/aws_results/output86.csv b/test/queries_generator/aws_results/output86.csv new file mode 100644 index 00000000..d4d0b4cb --- /dev/null +++ b/test/queries_generator/aws_results/output86.csv @@ -0,0 +1,10 @@ +1952-06-27T12:01:20.350613Z +1952-06-27T12:01:20.350613Z +1952-06-27T12:01:20.350613Z +1952-06-27T12:01:20.350613Z +1952-06-27T12:01:20.350613Z +1952-06-27T12:01:20.350613Z +1952-06-27T12:01:20.350613Z +1952-06-27T12:01:20.350613Z +1952-06-27T12:01:20.350613Z +1952-06-27T12:01:20.350613Z diff --git a/test/queries_generator/aws_results/output87.csv b/test/queries_generator/aws_results/output87.csv new file mode 100644 index 00000000..7728af37 --- /dev/null +++ b/test/queries_generator/aws_results/output87.csv @@ -0,0 +1 @@ +-9062 diff --git a/test/queries_generator/aws_results/output88.csv b/test/queries_generator/aws_results/output88.csv new file mode 100644 index 00000000..b6a7d89c --- /dev/null +++ b/test/queries_generator/aws_results/output88.csv @@ -0,0 +1 @@ +16 diff --git a/test/queries_generator/aws_results/output89.csv b/test/queries_generator/aws_results/output89.csv new file mode 100644 index 00000000..2b0a4054 --- /dev/null +++ b/test/queries_generator/aws_results/output89.csv @@ -0,0 +1,10 @@ +07 7 5778 +07 7 5778 +07 7 5778 +07 7 5778 +07 7 5778 +07 7 5778 +07 7 5778 +07 7 5778 +07 7 5778 +07 7 5778 diff --git a/test/queries_generator/aws_results/output9.csv b/test/queries_generator/aws_results/output9.csv new file mode 100644 index 00000000..45308023 --- /dev/null +++ b/test/queries_generator/aws_results/output9.csv @@ -0,0 +1,10 @@ +35 +35 +35 +35 +35 +35 +35 +35 +35 +35 diff --git a/test/queries_generator/aws_results/output90.csv b/test/queries_generator/aws_results/output90.csv new file mode 100644 index 00000000..56f8fb89 --- /dev/null +++ b/test/queries_generator/aws_results/output90.csv @@ -0,0 +1,10 @@ +-6781 +-3275 +405 +-4490 +-8459 +-11051 +11070 +-10247 +-7916 +11282 diff --git a/test/queries_generator/aws_results/output91.csv b/test/queries_generator/aws_results/output91.csv new file mode 100644 index 00000000..01512371 --- /dev/null +++ b/test/queries_generator/aws_results/output91.csv @@ -0,0 +1,10 @@ +73331 +36471 +90901 +73441 +64631 +58621 +76641 +5271 +56441 +72861 diff --git a/test/queries_generator/aws_results/output92.csv b/test/queries_generator/aws_results/output92.csv new file mode 100644 index 00000000..af6602c0 --- /dev/null +++ b/test/queries_generator/aws_results/output92.csv @@ -0,0 +1,10 @@ +5 78 +5 78 +5 78 +5 78 +5 78 +5 78 +5 78 +5 78 +5 78 +5 78 diff --git a/test/queries_generator/aws_results/output93.csv b/test/queries_generator/aws_results/output93.csv new file mode 100644 index 00000000..6e81b47e --- /dev/null +++ b/test/queries_generator/aws_results/output93.csv @@ -0,0 +1 @@ +1883720522 diff --git a/test/queries_generator/aws_results/output94.csv b/test/queries_generator/aws_results/output94.csv new file mode 100644 index 00000000..bb2378ed --- /dev/null +++ b/test/queries_generator/aws_results/output94.csv @@ -0,0 +1,10 @@ +-1842641484 +-448126569 +-1266007569 +-1473638552 +-1832011212 +-2077718732 +-73068312 +-512252696 +-1477556728 +-43705328 diff --git a/test/queries_generator/aws_results/output95.csv b/test/queries_generator/aws_results/output95.csv new file mode 100644 index 00000000..fa83cf36 --- /dev/null +++ b/test/queries_generator/aws_results/output95.csv @@ -0,0 +1,10 @@ +ET +RE +AL +LE +EO +L@ +LI +IN +DR +BY diff --git a/test/queries_generator/aws_results/output96.csv b/test/queries_generator/aws_results/output96.csv new file mode 100644 index 00000000..c91f980d --- /dev/null +++ b/test/queries_generator/aws_results/output96.csv @@ -0,0 +1,10 @@ +1907-09-15T22:43:17.91754Z +1907-09-15T22:43:17.91754Z +1907-09-15T22:43:17.91754Z +1907-09-15T22:43:17.91754Z +1907-09-15T22:43:17.91754Z +1907-09-15T22:43:17.91754Z +1907-09-15T22:43:17.91754Z +1907-09-15T22:43:17.91754Z +1907-09-15T22:43:17.91754Z +1907-09-15T22:43:17.91754Z diff --git a/test/queries_generator/aws_results/output97.csv b/test/queries_generator/aws_results/output97.csv new file mode 100644 index 00000000..a0472466 --- /dev/null +++ b/test/queries_generator/aws_results/output97.csv @@ -0,0 +1,10 @@ +: +: +: +: +: +: +: +: +: +: diff --git a/test/queries_generator/aws_results/output98.csv b/test/queries_generator/aws_results/output98.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output98.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/aws_results/output99.csv b/test/queries_generator/aws_results/output99.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output99.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/generate_aws_cmds.cpp b/test/queries_generator/generate_aws_cmds.cpp new file mode 100644 index 00000000..d01d9920 --- /dev/null +++ b/test/queries_generator/generate_aws_cmds.cpp @@ -0,0 +1,26 @@ +#include +#include + +using namespace std; + +int main() +{ + fstream query_file, cmd_file; + query_file.open("queries.txt", ios::in); + cmd_file.open("aws_cmds.sh", ios::out); + cmd_file << "#!/bin/sh\nset -x\nset -e\n\n"; + cmd_file << "mkdir -p aws_results\n"; + string bucket, csv_file, query, aws_cmd; + cout << "Enter bucket name: "; + cin >> bucket; + cout << "Enter file name: "; + cin >> csv_file; + for(int i = 1; getline(query_file, query); i++) + { + aws_cmd = "aws s3api select-object-content --bucket " + bucket + " --key " + csv_file + " --expression-type \'SQL\' --input-serialization \'{\"CSV\": {}, \"CompressionType\": \"NONE\"}\' --output-serialization \'{\"CSV\": {}}\' --profile openshift-dev --expression \"" + query + "\" \"aws_results/output" + to_string(i) + ".csv\""; + cmd_file << aws_cmd << endl; + } + cmd_file.close(); + query_file.close(); + return 0; +} diff --git a/test/queries_generator/queries.txt b/test/queries_generator/queries.txt new file mode 100644 index 00000000..411b8860 --- /dev/null +++ b/test/queries_generator/queries.txt @@ -0,0 +1,100 @@ +select extract(month from to_timestamp('1958-04-14T13:15:04.754788Z')) from s3object; +select to_timestamp('1935-09-17T01:37:17.162313Z') from s3object; +select date_add(day, 3, date_add(month, 5, to_timestamp('1927-12-07T10:02:38.119492Z'))) from s3object; +select cast(_2 as int)-cast(_3 as int)*1-1+2/6/5*6 from s3object; +select cast(_3 as int)*cast(_2 as int)+cast(_2 as int)/2*cast(_2 as int)+6*cast(_3 as int)*9 from s3object; +select extract(second from date_add(year, 8, date_add(second, 2, to_timestamp('1974-10-13T11:29:34.78708Z')))) from s3object; +select lower(to_string(to_timestamp('1974-05-04T00:42:14.680208Z'), 'xx : SSSSS ')) from s3object; +select date_add(second, 9, date_add(hour, 2, to_timestamp('1937-09-16T08:17:42.46268Z'))) from s3object; +select date_diff(year, date_add(second, 5, date_add(month, 3, to_timestamp('1944-06-19T03:50:10.750890Z'))), date_add(second, 7, to_timestamp('1980-09-14T08:37:55.777008Z'))) from s3object; +select cast(_3 as int)/1-8-6*10/1*cast(_1 as int)/3 from s3object; +select lower(upper(lower(upper(_8)))) from s3object; +select lower(to_string(to_timestamp('1910-06-01T08:18:17.44554Z'), 'a ss XXXX h a ')) from s3object; +select lower(to_string(to_timestamp('1959-05-08T16:24:44.865364Z'), 'mm S dd ss ')) from s3object; +select 6+cast(_2 as int)-9-cast(_3 as int)/10-6/cast(_2 as int)/7 from s3object; +select cast(_3 as int)-8-1+cast(_1 as int)/8+cast(_3 as int)/cast(_1 as int)/cast(_2 as int) from s3object; +select cast(_1 as int)-cast(_2 as int)*6-3*7*cast(_1 as int)/10+1 from s3object; +select to_timestamp('1926-10-01T02:11:24.471167Z') from s3object; +select lower(upper(substring(lower(_4), 4, 4))) from s3object; +select substring(lower(upper(to_string(to_timestamp('1925-08-08T07:14:29.25308Z'), 'yy x s '))), 1, 9) from s3object; +select cast(_2 as int)-8-cast(_1 as int)+cast(_3 as int)+9*cast(_2 as int)/5/2 from s3object; +select to_timestamp('1901-10-21T11:53:51.849814Z') from s3object; +select date_diff(hour, date_add(day, 2, to_timestamp('1913-09-05T10:30:41.786863Z')), to_timestamp('1988-10-06T14:27:11.313397Z')) from s3object; +select upper(to_string(to_timestamp('1972-09-12T10:34:19.435575Z'), 'XX : ')) from s3object; +select cast(_3 as int)+cast(_3 as int)/4-5-cast(_3 as int)+cast(_3 as int)+cast(_3 as int)*4 from s3object; +select lower(upper(to_string(date_add(day, 9, to_timestamp('1992-01-06T00:20:04.307516Z')), 'XXXXX ss SSSSSS SSSSSS '))) from s3object; +select date_add(hour, 2, date_add(minute, 9, to_timestamp('1911-09-23T21:55:03.726161Z'))) from s3object; +select 4*7*6+2*2-cast(_1 as int)+cast(_3 as int)*cast(_2 as int) from s3object; +select date_add(minute, 6, date_add(month, 1, date_add(minute, 5, date_add(second, 2, to_timestamp('1920-12-19T00:51:44.247190Z'))))) from s3object; +select cast(_3 as int)+cast(_2 as int)+cast(_1 as int)*cast(_1 as int)/cast(_3 as int)-cast(_3 as int)-cast(_1 as int)+cast(_3 as int) from s3object; +select upper(lower(lower(lower(_1)))) from s3object; +select date_diff(day, date_add(day, 7, date_add(day, 8, to_timestamp('1922-11-21T16:05:51.528720Z'))), to_timestamp('1997-01-14T08:17:52.822485Z')) from s3object; +select to_timestamp('1970-03-06T01:06:41.606432Z') from s3object; +select 1*8+6*6*1*9-cast(_1 as int)/7 from s3object; +select cast((avg(cast(_1 as int)/3*10+2*7/9-cast(_1 as int)*1/cast(_3 as int)) + 9/6*6+2/6-8+9-8) as int) from s3object; +select to_timestamp('1944-02-22T20:21:23.730763Z') from s3object; +select cast(_2 as int)/cast(_1 as int)+cast(_3 as int)-1/3*6-cast(_3 as int)-cast(_2 as int) from s3object; +select cast(_2 as int)/4/3/1-cast(_2 as int)/cast(_3 as int)*2/cast(_2 as int) from s3object; +select date_add(second, 10, to_timestamp('1939-08-27T10:46:32.829453Z')) from s3object; +select character_length(substring(substring(to_string(to_timestamp('1902-06-10T09:31:45.691575Z'), 'XXX m xxxxx XX XX '), 6, 4), 7, 4)) from s3object; +select date_add(day, 1, to_timestamp('1916-03-18T14:11:08.451358Z')) from s3object; +select date_add(hour, 4, date_add(day, 6, to_timestamp('1944-04-11T22:26:20.517916Z'))) from s3object; +select cast((avg(cast(_3 as int)*6-cast(_2 as int)*3/cast(_3 as int)/4*cast(_3 as int)*cast(_3 as int)+cast(_2 as int)) + 8+10/2-6-6/9/7/9) as int) from s3object; +select upper(substring(substring(substring(_4, 1, 10), 4, 8), 10, 4)) from s3object; +select 4*cast(_1 as int)+2*6+5+cast(_2 as int)/3-10 from s3object; +select cast((avg(cast(_1 as int)/cast(_3 as int)/7/2/cast(_2 as int)-1+cast(_2 as int)+6-cast(_3 as int)) - 5*3+9*1*10/6/5*8) as int) from s3object; +select to_timestamp('1920-06-01T06:23:21.691783Z') from s3object; +select 2/6/1-10*cast(_1 as int)/1+8-cast(_3 as int) from s3object; +select extract(timezone_hour from to_timestamp('1994-03-03T05:05:50.313428Z')) from s3object; +select to_string(to_timestamp('1950-12-07T04:56:21.314594Z'), 'n ') from s3object; +select to_string(date_add(hour, 5, to_timestamp('1968-04-16T08:53:56.344883Z')), 'xxxx M x XX SSSSSS mm SSS yy XXXX ') from s3object; +select date_add(second, 5, date_add(minute, 10, date_add(month, 5, to_timestamp('1958-11-26T19:13:22.653319Z')))) from s3object; +select cast(_2 as int)+9+6*cast(_1 as int)/cast(_3 as int)+4/9+10 from s3object; +select cast(_3 as int)+cast(_3 as int)*9*8*3+5-8+1 from s3object; +select to_timestamp('1914-05-26T23:17:08.436790Z') from s3object; +select to_timestamp('1921-04-03T08:59:19.330304Z') from s3object; +select cast(_3 as int)*cast(_1 as int)+cast(_1 as int)-cast(_3 as int)/cast(_3 as int)/3-3/2 from s3object; +select cast((avg(cast(_1 as int)-cast(_3 as int)+9*2+cast(_3 as int)-10-cast(_2 as int)/7*1) * 10*3*10/8/6*5*1+8) as int) from s3object; +select 1/cast(_2 as int)+3+cast(_2 as int)-1-6+5-7 from s3object; +select character_length(upper(upper(upper(_8)))) from s3object; +select cast((avg(cast(_1 as int)/cast(_1 as int)-cast(_1 as int)+3/6/cast(_2 as int)*1*10-9) - 8-3/7+3+1-2/2+3) as int) from s3object; +select substring(upper(upper(upper(_3))), 7, 9) from s3object; +select date_add(hour, 6, to_timestamp('1929-08-14T07:50:58.15506Z')) from s3object; +select substring(lower(substring(to_string(to_timestamp('1917-07-25T03:19:38.505229Z'), 'mm H HH '), 1, 3)), 4, 8) from s3object; +select to_string(date_add(hour, 8, date_add(second, 4, to_timestamp('1933-09-06T19:14:53.102660Z'))), 'yyyy a M yy dd xxx XXX SS ') from s3object; +select count(cast(_3 as int)*5-3+cast(_2 as int)*cast(_3 as int)*2/3*10/2) - 7/4/6-8*5-10-5/5 from s3object; +select cast(_3 as int)*6+cast(_1 as int)*cast(_2 as int)-cast(_2 as int)+9-cast(_1 as int)*3 from s3object; +select date_add(second, 4, to_timestamp('1965-01-10T14:07:47.970104Z')) from s3object; +select char_length(substring(upper(to_string(to_timestamp('1997-04-05T11:54:39.803197Z'), 'M - XXX SSSSSSSSS dd ss XX HH ')), 9, 3)) from s3object; +select to_timestamp('1911-07-21T12:23:13.78892Z') from s3object; +select to_timestamp('1994-05-17T02:52:46.806937Z') from s3object; +select cast(_1 as int)/cast(_1 as int)/cast(_3 as int)/cast(_1 as int)+cast(_3 as int)/cast(_3 as int)/cast(_1 as int)*8 from s3object; +select date_add(minute, 9, date_add(year, 7, date_add(hour, 4, to_timestamp('1958-02-09T14:49:50.116846Z')))) from s3object; +select lower(upper(lower(lower(_4)))) from s3object; +select character_length(upper(lower(to_string(to_timestamp('1905-11-02T13:31:59.401438Z'), 'H ')))) from s3object; +select cast(_3 as int)*2/2/cast(_1 as int)/9/cast(_2 as int)*cast(_2 as int)-8 from s3object; +select cast(_3 as int)+cast(_3 as int)-2*cast(_1 as int)-9*cast(_1 as int)*3+cast(_1 as int) from s3object; +select cast(_1 as int)+1+cast(_1 as int)*cast(_3 as int)+cast(_3 as int)/cast(_1 as int)*7*5 from s3object; +select max(cast(_1 as int)-4*cast(_3 as int)*cast(_2 as int)-cast(_2 as int)+cast(_1 as int)+cast(_1 as int)/1*cast(_1 as int)) + 3+5-6+5*2+1+4/3 from s3object; +select count(cast(_3 as int)+cast(_3 as int)*8/cast(_3 as int)-6/cast(_1 as int)*2/5-1) / 6-2+5*4*4/4-1+8 from s3object; +select date_add(minute, 4, date_add(minute, 3, to_timestamp('1975-04-27T01:04:59.650881Z'))) from s3object; +select date_add(minute, 7, to_timestamp('1979-06-11T01:19:45.282716Z')) from s3object; +select date_add(month, 1, date_add(hour, 5, to_timestamp('1986-05-12T21:07:35.12599Z'))) from s3object; +select 2*cast(_3 as int)*cast(_3 as int)*cast(_2 as int)*cast(_1 as int)+1*cast(_2 as int)-cast(_2 as int) from s3object; +select substring(substring(upper(substring(_1, 10, 6)), 3, 1), 6, 1) from s3object; +select cast(_2 as int)+4+cast(_3 as int)/cast(_3 as int)/cast(_3 as int)-cast(_3 as int)/cast(_3 as int)-4 from s3object; +select date_add(second, 1, to_timestamp('1952-06-27T12:01:19.350613Z')) from s3object; +select min(cast(_1 as int)*cast(_1 as int)-4+9-cast(_3 as int)+cast(_1 as int)-3+3/cast(_1 as int)) + 1+7+10-5+4-3/3-2 from s3object; +select count(cast(_3 as int)+7+10*cast(_2 as int)/cast(_3 as int)-cast(_1 as int)/4-cast(_3 as int)-10) + 5-1*1*3/7-3/8+1 from s3object; +select substring(lower(lower(to_string(to_timestamp('1926-06-10T07:47:53.577850Z'), 'x hh H n x M '))), 5, 9) from s3object; +select 10-cast(_2 as int)*1+cast(_3 as int)+cast(_3 as int)+4+cast(_2 as int)/2 from s3object; +select cast(_1 as int)/3/1/cast(_1 as int)*cast(_3 as int)-9+10*cast(_3 as int) from s3object; +select substring(to_string(to_timestamp('1931-05-15T05:42:52.780168Z'), 'S MMMM d SSSSSS H '), 8, 4) from s3object; +select sum(cast(_3 as int)*cast(_2 as int)-cast(_2 as int)+4/8+cast(_1 as int)+1*cast(_2 as int)/cast(_3 as int)) + 7*10/8-2*7-10+2+3 from s3object; +select cast(_1 as int)/8-cast(_2 as int)*cast(_2 as int)+4/1-4-8 from s3object; +select substring(substring(upper(upper(_7)), 10, 10), 2, 2) from s3object; +select date_add(year, 4, to_timestamp('1903-09-15T22:43:17.91754Z')) from s3object; +select substring(to_string(to_timestamp('1938-09-27T05:01:07.131992Z'), 'hh XXXXX xxx yyy dd X xx SSSSSSSSS n '), 9, 1) from s3object; +select upper(to_string(date_add(year, 2, to_timestamp('1996-12-07T10:11:17.447229Z')), '')) from s3object; +select substring(substring(upper(lower(_2)), 8, 10), 7, 4) from s3object; +select date_add(year, 2, date_add(minute, 6, to_timestamp('1938-02-01T15:24:44.640810Z'))) from s3object; diff --git a/test/queries_generator/queries_generator.cpp b/test/queries_generator/queries_generator.cpp new file mode 100644 index 00000000..f37aafa3 --- /dev/null +++ b/test/queries_generator/queries_generator.cpp @@ -0,0 +1,266 @@ +#include +#include +#include +#include +#define TOTAL_COLUMN 9 +#define NUM_COLUMN_INT 3 + +using namespace std; + +enum Return_type { INTEGER = 0, + STRING = 1, + TIMESTAMP = 2, + MIX_COL_NUM = 3, + COLUMN = 4, + NUMBER = 5}; + +auto random_arth_op = [](){std::string op="+-*/";return op[rand()%op.size()];}; + +auto random_compare_op = []() +{vector op={">", "<", ">=", "<=", "==", "!="}; + return op[ rand() % op.size() ]; +}; + +auto random_date_part = []() +{vector op={"year", "month", "day", "hour", "minute", "second"}; + return op[ rand() % op.size() ]; +}; + +auto random_date_part_extract = []() +{vector op={"year", "month", "day", "hour", "minute", "second", + "timezone_hour", "timezone_minute"}; + return op[ rand() % op.size() ]; +}; + +string random_timestamp_string() +{ + auto year = [](){return rand()%100 + 1900;}; + auto month = [](){return 1 + rand()%12;}; + auto day = [](){return 1 + rand()%28;}; + auto hours = [](){return rand()%24;}; + auto minutes = [](){return rand()%60;}; + auto seconds = [](){return rand()%60;}; + auto fraction_sec = [](){return rand()%1000000;}; + stringstream timestamp_str; + + timestamp_str << year() << "-" << std::setw(2) << std::setfill('0') << month() << "-" << std::setw(2) << std::setfill('0') << day() << "T" < op={"yyyyy ", "yyyy ", "yyy ", "yy ", "y ", "MMMMM ", "MMMM ", "MMM ", "MM ", "M ", "dd ", "d ", "a ", "hh ", "h ", "HH ", "H ", "mm ", "m ", "ss ", "s ", "SSSSSSSSS ", "SSSSSS ", "SSSSS ", "SSS ", "SS ", "S ", "n ", "X ", "XX ", "XXX ", "XXXX ", "XXXXX ", "x ", "xx ", "xxx ", "xxxx ", "xxxxx ", ": ", "- "}; + return op[ rand() % op.size() ]; + }; + int loop = rand() % 10; + string frmt; + while(loop) + { + frmt += random_format(); + loop--; + } + return frmt; +} + +string random_col() +{ + int num = 1 + (rand() % NUM_COLUMN_INT); + return "cast(_" + to_string(num) + " as int)"; +} + +string random_number() +{ + int num = rand() % 10 + 1; + return to_string(num); +} + +string random_num_expr(int depth) +{ + if (depth == 0) + { + return random_number(); + } + + return random_num_expr(depth-1) + random_arth_op() + random_num_expr(depth-1); +} + +string random_num_col_expr(int depth) +{ + if (depth == 0) + { + if ((rand() % 2) == 0) + { + return random_col(); + } + else + { + return random_number(); + } + } + + return random_num_col_expr(depth-1) + random_arth_op() + random_num_col_expr(depth-1); +} + +string random_query_expr(int depth, int type) +{ + string expr; + if (depth == 0) + { + switch (type) + { + case INTEGER: + case NUMBER: + { + expr = random_number(); + break; + } + case STRING: + { + expr = "_" + to_string(1 + (rand() % (TOTAL_COLUMN))); + break; + } + case MIX_COL_NUM: + { + expr = random_num_col_expr(depth); + break; + } + case TIMESTAMP: + { + expr = "to_timestamp(\'" + random_timestamp_string() + "\')"; + break; + } + } + return expr; + } + + int option; + if (type == INTEGER) //return type is int + { + switch (option = rand() % 9) + { + case 0: + expr = "cast((avg(" + random_col() + random_arth_op() + random_num_col_expr(depth-1) + + ") " + random_arth_op() + " " + random_num_expr(depth-1) + ") as int)"; + break; + case 1: + expr = "count(" + random_col() + random_arth_op() + random_num_col_expr(depth-1) + + ") " + random_arth_op() + " " + random_num_expr(depth-1); + break; + case 2: + expr = "max(" + random_col() + random_arth_op() + random_num_col_expr(depth-1) + + ") " + random_arth_op() + " " + random_num_expr(depth-1); + break; + case 3: + expr = "min(" + random_col() + random_arth_op() + random_num_col_expr(depth-1) + + ") " + random_arth_op() + " " + random_num_expr(depth-1); + break; + case 4: + expr = "sum(" + random_col() + random_arth_op() + random_num_col_expr(depth-1) + + ") " + random_arth_op() + " " + random_num_expr(depth-1); + break; + case 5: + expr = "char_length(" + random_query_expr(depth-1, STRING) + ")"; + break; + case 6: + expr = "character_length(" + random_query_expr(depth-1, STRING) + ")"; + break; + case 7: + expr = "extract(" + random_date_part_extract() + " from " + + random_query_expr(depth-1, TIMESTAMP) + ")"; + break; + case 8: + expr = "date_diff(" + random_date_part() + ", " + + random_query_expr(depth-1, TIMESTAMP) + ", " + + random_query_expr(depth-1, TIMESTAMP) + ")"; + break; + } + } + else if (type == STRING) // return type is string + { + switch (option = rand() % 4) + { + case 0: + expr = "lower(" + random_query_expr(depth-1, STRING) + ")"; + break; + case 1: + expr = "upper(" + random_query_expr(depth-1, STRING) + ")"; + break; + case 2: + expr = "substring(" + random_query_expr(depth-1, STRING) + ", " + + random_query_expr(depth-1, NUMBER) + ", " + + random_query_expr(depth-1, NUMBER) + ")"; + break; + case 3: + expr = "to_string(" + random_query_expr(depth-1, TIMESTAMP) + ", \'" + random_tm_format_string() + "\')"; + break; + } + } + else if (type == TIMESTAMP) // return type is TIMESTAMP + { + switch (option = rand() % 2) + { + case 0: + expr = "date_add(" + random_date_part()+ ", " + random_number() + ", " + random_query_expr(depth-1, TIMESTAMP) + ")"; + break; + case 1: + expr = "to_timestamp(\'" + random_timestamp_string() + "\')"; + break; + } + } + else if (type == MIX_COL_NUM) + { + expr = random_num_col_expr(depth-1); + } + else if (type == COLUMN) // return type integer column number + { + expr = random_col(); + } + else if (type == NUMBER) // return type random number + { + expr = random_number(); + } + else + { + expr = "error"; + } + return expr; +} + +int main() +{ + srand(time(0)); + int reps, depth; + fstream query_file; + + query_file.open("queries.txt", ios::out); + cout << "Enter number of quries to be generated: "; + cin >> reps; + cout << "Enter depth of queries to be generated: "; + cin >> depth; + + if(query_file.is_open()) //checking whether the file is open + { + while (reps) + { + int type; + string query = "select "; + // For multiple projections + //int projection = rand() % 4; + //while (projection > 1) + //{ + // type = rand() % 4; + // query = query + random_query_expr(depth, type) + ", "; + // projection--; + //} + type = rand() % 4; + query = query + random_query_expr(depth, type) + " from s3object;"; + query_file << query << endl; + reps--; + } + query_file.close(); + } + return 0; +} + diff --git a/test/queries_generator/run_aws_queries.sh b/test/queries_generator/run_aws_queries.sh new file mode 100755 index 00000000..0b38a159 --- /dev/null +++ b/test/queries_generator/run_aws_queries.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -x +set -e + +./generate_aws_cmds + +chmod +x aws_cmds.sh + +./aws_cmds.sh diff --git a/test/s3select_test.cpp b/test/s3select_test.cpp index c9490e74..967013ac 100644 --- a/test/s3select_test.cpp +++ b/test/s3select_test.cpp @@ -2595,3 +2595,48 @@ TEST(TestS3selectFunctions, nested_query_multirow_result) query_file.close(); result_file.close(); } + +TEST(TestS3selectFunctions, ceph_vs_aws) +{ + std::fstream query_file, result_file, input_csv; + query_file.open("./test/queries_generator/queries.txt", std::ios::in); + input_csv.open("./test/test_data.csv", std::ios::in); + ASSERT_EQ(query_file.is_open(), true); + ASSERT_EQ(input_csv.is_open(), true); + + std::string input, temp; + while (std::getline(input_csv, temp)) + { + input += temp; + input.push_back('\n'); + } + + std::string input_query; + int i = 1; + while (getline(query_file, input_query)) + { + result_file.open("./test/queries_generator/aws_results/output" + std::to_string(i) + ".csv", std::ios::in); + ASSERT_EQ(result_file.is_open(), true); + + std::string expected_res; + int j = 0; + while (getline(result_file, temp)) + { + expected_res += temp + ","; + expected_res.push_back('\n'); + j++; + } + + if(j == 1) + expected_res.erase(std::remove(expected_res.begin(), expected_res.end(), '\n'), expected_res.end()); + + std::cout << "Running query: " << i << std::endl; + auto s3select_res = run_s3select(input_query, input); + EXPECT_EQ(s3select_res, expected_res); + i++; + + result_file.close(); + } + + query_file.close(); +}