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..3075fbe9 --- /dev/null +++ b/test/queries_generator/aws_results/output1.csv @@ -0,0 +1,10 @@ +77 +40 +27 +20 +15 +12 +9 +7 +5 +3 diff --git a/test/queries_generator/aws_results/output10.csv b/test/queries_generator/aws_results/output10.csv new file mode 100644 index 00000000..8ffbb35f --- /dev/null +++ b/test/queries_generator/aws_results/output10.csv @@ -0,0 +1,10 @@ +2027-02-03T14:21:30.397Z +2016-03-10T04:22:45.8327+09:45 +2007-06-08T02:18:23.446633-12:00 +2001-12-01T04:40:00+12:30 +2019-05-07T08:27:59.2Z +2004-07-08T20:25-01:05 +2014-01-19T01:00:30Z +2026-10-08T14:07:01.23323-00:30 +2025-07-28T23:21:22.23+05:15 +2006-12-21T17:41Z diff --git a/test/queries_generator/aws_results/output100.csv b/test/queries_generator/aws_results/output100.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output100.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/aws_results/output11.csv b/test/queries_generator/aws_results/output11.csv new file mode 100644 index 00000000..7155d67b --- /dev/null +++ b/test/queries_generator/aws_results/output11.csv @@ -0,0 +1,10 @@ +-258 +-258 +-258 +-258 +-258 +-258 +-258 +-258 +-258 +-258 diff --git a/test/queries_generator/aws_results/output12.csv b/test/queries_generator/aws_results/output12.csv new file mode 100644 index 00000000..a19bfa8a --- /dev/null +++ b/test/queries_generator/aws_results/output12.csv @@ -0,0 +1,10 @@ +42930 +21173 +35585 +38392 +42806 +45586 +8552 +22637 +38443 +6615 diff --git a/test/queries_generator/aws_results/output13.csv b/test/queries_generator/aws_results/output13.csv new file mode 100644 index 00000000..f0501d96 --- /dev/null +++ b/test/queries_generator/aws_results/output13.csv @@ -0,0 +1,10 @@ +7327 +3647 +9096 +7356 +6481 +5886 +7694 +563 +5686 +7334 diff --git a/test/queries_generator/aws_results/output14.csv b/test/queries_generator/aws_results/output14.csv new file mode 100644 index 00000000..b07c4f2f --- /dev/null +++ b/test/queries_generator/aws_results/output14.csv @@ -0,0 +1,10 @@ +350375 +88077 +73924 +82220 +50598 +54906 +3725 +29642 +7161 +-5091 diff --git a/test/queries_generator/aws_results/output15.csv b/test/queries_generator/aws_results/output15.csv new file mode 100644 index 00000000..b0e00147 --- /dev/null +++ b/test/queries_generator/aws_results/output15.csv @@ -0,0 +1,10 @@ +1974-03-28T06:54:22.859837Z +1974-03-28T06:54:22.859837Z +1974-03-28T06:54:22.859837Z +1974-03-28T06:54:22.859837Z +1974-03-28T06:54:22.859837Z +1974-03-28T06:54:22.859837Z +1974-03-28T06:54:22.859837Z +1974-03-28T06:54:22.859837Z +1974-03-28T06:54:22.859837Z +1974-03-28T06:54:22.859837Z diff --git a/test/queries_generator/aws_results/output16.csv b/test/queries_generator/aws_results/output16.csv new file mode 100644 index 00000000..5f1c2c20 --- /dev/null +++ b/test/queries_generator/aws_results/output16.csv @@ -0,0 +1,10 @@ +1963-07-03T08:48:01.749638Z +1963-07-03T08:48:01.749638Z +1963-07-03T08:48:01.749638Z +1963-07-03T08:48:01.749638Z +1963-07-03T08:48:01.749638Z +1963-07-03T08:48:01.749638Z +1963-07-03T08:48:01.749638Z +1963-07-03T08:48:01.749638Z +1963-07-03T08:48:01.749638Z +1963-07-03T08:48:01.749638Z diff --git a/test/queries_generator/aws_results/output17.csv b/test/queries_generator/aws_results/output17.csv new file mode 100644 index 00000000..4d3cd9c7 --- /dev/null +++ b/test/queries_generator/aws_results/output17.csv @@ -0,0 +1,10 @@ +ker +ker +tor +efigh +ker +ice o +tor +elope +tor +ice o diff --git a/test/queries_generator/aws_results/output18.csv b/test/queries_generator/aws_results/output18.csv new file mode 100644 index 00000000..5ca3770a --- /dev/null +++ b/test/queries_generator/aws_results/output18.csv @@ -0,0 +1,10 @@ +-21539135 +-15805312 +-11199932 +-8297004 +-17469342 +-9666764 +-14678174 +-21369231 +-20740160 +-10958215 diff --git a/test/queries_generator/aws_results/output19.csv b/test/queries_generator/aws_results/output19.csv new file mode 100644 index 00000000..c06e22e0 --- /dev/null +++ b/test/queries_generator/aws_results/output19.csv @@ -0,0 +1,10 @@ + : + : + : + : + : + : + : + : + : + : diff --git a/test/queries_generator/aws_results/output2.csv b/test/queries_generator/aws_results/output2.csv new file mode 100644 index 00000000..75cdd0cd --- /dev/null +++ b/test/queries_generator/aws_results/output2.csv @@ -0,0 +1,10 @@ +31931 +15711 +21967 +27401 +33144 +36834 +-2895 +21903 +30042 +-4241 diff --git a/test/queries_generator/aws_results/output20.csv b/test/queries_generator/aws_results/output20.csv new file mode 100644 index 00000000..66556b99 --- /dev/null +++ b/test/queries_generator/aws_results/output20.csv @@ -0,0 +1,10 @@ +1914-02-11T14:46:06.505116Z +1914-02-11T14:46:06.505116Z +1914-02-11T14:46:06.505116Z +1914-02-11T14:46:06.505116Z +1914-02-11T14:46:06.505116Z +1914-02-11T14:46:06.505116Z +1914-02-11T14:46:06.505116Z +1914-02-11T14:46:06.505116Z +1914-02-11T14:46:06.505116Z +1914-02-11T14:46:06.505116Z diff --git a/test/queries_generator/aws_results/output21.csv b/test/queries_generator/aws_results/output21.csv new file mode 100644 index 00000000..1da45e08 --- /dev/null +++ b/test/queries_generator/aws_results/output21.csv @@ -0,0 +1,10 @@ +-57554 +-32073 +-71905 +-75073 +-81546 +-86583 +-69828 +-27345 +-94849 +-86728 diff --git a/test/queries_generator/aws_results/output22.csv b/test/queries_generator/aws_results/output22.csv new file mode 100644 index 00000000..386184c5 --- /dev/null +++ b/test/queries_generator/aws_results/output22.csv @@ -0,0 +1,10 @@ +-35562 +-13859 +-8300 +-9002 +-10478 +-10401 +45109 +-18407 +12367 +66260 diff --git a/test/queries_generator/aws_results/output23.csv b/test/queries_generator/aws_results/output23.csv new file mode 100644 index 00000000..3d1e2505 --- /dev/null +++ b/test/queries_generator/aws_results/output23.csv @@ -0,0 +1,10 @@ +2027-02-26T11:24:37.397Z +2016-04-02T01:25:52.8327+09:45 +2007-06-27T23:21:30.446633-12:00 +2001-12-24T01:43:07+12:30 +2019-05-30T05:31:06.2Z +2004-07-31T17:28:07-01:05 +2014-02-10T22:03:37Z +2026-10-30T11:10:08.23323-00:30 +2025-08-20T20:24:29.23+05:15 +2007-01-13T14:44:07Z diff --git a/test/queries_generator/aws_results/output24.csv b/test/queries_generator/aws_results/output24.csv new file mode 100644 index 00000000..1bbbd2e1 --- /dev/null +++ b/test/queries_generator/aws_results/output24.csv @@ -0,0 +1,10 @@ +429982 +106199 +119503 +96696 +86243 +76550 +12972 +28339 +43271 +7337 diff --git a/test/queries_generator/aws_results/output25.csv b/test/queries_generator/aws_results/output25.csv new file mode 100644 index 00000000..1b08ecac --- /dev/null +++ b/test/queries_generator/aws_results/output25.csv @@ -0,0 +1,10 @@ +0 +0 +0 +0 +1 +1 +1 +1 +1 +2 diff --git a/test/queries_generator/aws_results/output26.csv b/test/queries_generator/aws_results/output26.csv new file mode 100644 index 00000000..e2c35c65 --- /dev/null +++ b/test/queries_generator/aws_results/output26.csv @@ -0,0 +1 @@ +84769246786 diff --git a/test/queries_generator/aws_results/output27.csv b/test/queries_generator/aws_results/output27.csv new file mode 100644 index 00000000..a28d3609 --- /dev/null +++ b/test/queries_generator/aws_results/output27.csv @@ -0,0 +1 @@ +30572 diff --git a/test/queries_generator/aws_results/output28.csv b/test/queries_generator/aws_results/output28.csv new file mode 100644 index 00000000..b98640af --- /dev/null +++ b/test/queries_generator/aws_results/output28.csv @@ -0,0 +1,10 @@ +2020-10-29T15:21:48.397Z +2009-12-05T05:23:03.8327+09:45 +2001-03-03T03:18:41.446633-12:00 +1995-08-27T05:40:18+12:30 +2013-02-02T09:28:17.2Z +1998-04-03T21:25:18-01:05 +2007-10-14T02:00:48Z +2020-07-03T15:07:19.23323-00:30 +2019-04-24T00:21:40.23+05:15 +2000-09-16T18:41:18Z diff --git a/test/queries_generator/aws_results/output29.csv b/test/queries_generator/aws_results/output29.csv new file mode 100644 index 00000000..e6c01b0d --- /dev/null +++ b/test/queries_generator/aws_results/output29.csv @@ -0,0 +1,10 @@ +2 +0 +-2 +-5 +-7 +-9 +-11 +-14 +-16 +-18 diff --git a/test/queries_generator/aws_results/output3.csv b/test/queries_generator/aws_results/output3.csv new file mode 100644 index 00000000..7fb5ebec --- /dev/null +++ b/test/queries_generator/aws_results/output3.csv @@ -0,0 +1,10 @@ + + + +er + +ficer + + + +ficer diff --git a/test/queries_generator/aws_results/output30.csv b/test/queries_generator/aws_results/output30.csv new file mode 100644 index 00000000..d69c8c24 --- /dev/null +++ b/test/queries_generator/aws_results/output30.csv @@ -0,0 +1 @@ +121053 diff --git a/test/queries_generator/aws_results/output31.csv b/test/queries_generator/aws_results/output31.csv new file mode 100644 index 00000000..55ff8a82 --- /dev/null +++ b/test/queries_generator/aws_results/output31.csv @@ -0,0 +1,10 @@ +2022-10-26T14:28:30.397Z +2011-12-02T04:29:45.8327+09:45 +2003-02-28T02:25:23.446633-12:00 +1997-08-24T04:47:00+12:30 +2015-01-30T08:34:59.2Z +2000-03-31T20:32-01:05 +2009-10-11T01:07:30Z +2022-06-30T14:14:01.23323-00:30 +2021-04-20T23:28:22.23+05:15 +2002-09-13T17:48Z diff --git a/test/queries_generator/aws_results/output32.csv b/test/queries_generator/aws_results/output32.csv new file mode 100644 index 00000000..725fb6a8 --- /dev/null +++ b/test/queries_generator/aws_results/output32.csv @@ -0,0 +1,10 @@ +2020-10-27T05:21:37.397Z +2009-12-02T19:22:52.8327+09:45 +2001-02-28T17:18:30.446633-12:00 +1995-08-24T19:40:07+12:30 +2013-01-30T23:28:06.2Z +1998-04-01T11:25:07-01:05 +2007-10-11T16:00:37Z +2020-07-01T05:07:08.23323-00:30 +2019-04-21T14:21:29.23+05:15 +2000-09-14T08:41:07Z diff --git a/test/queries_generator/aws_results/output33.csv b/test/queries_generator/aws_results/output33.csv new file mode 100644 index 00000000..83154291 --- /dev/null +++ b/test/queries_generator/aws_results/output33.csv @@ -0,0 +1,10 @@ +-13594 +-6595 +741 +-9084 +-17066 +-22304 +21874 +-20833 +-16255 +22047 diff --git a/test/queries_generator/aws_results/output34.csv b/test/queries_generator/aws_results/output34.csv new file mode 100644 index 00000000..a5eff73a --- /dev/null +++ b/test/queries_generator/aws_results/output34.csv @@ -0,0 +1,10 @@ +2020-10-26T21:23:39.397Z +2009-12-02T11:24:54.8327+09:45 +2001-02-28T09:20:32.446633-12:00 +1995-08-24T11:42:09+12:30 +2013-01-30T15:30:08.2Z +1998-04-01T03:27:09-01:05 +2007-10-11T08:02:39Z +2020-06-30T21:09:10.23323-00:30 +2019-04-21T06:23:31.23+05:15 +2000-09-14T00:43:09Z diff --git a/test/queries_generator/aws_results/output35.csv b/test/queries_generator/aws_results/output35.csv new file mode 100644 index 00000000..fbdc2565 --- /dev/null +++ b/test/queries_generator/aws_results/output35.csv @@ -0,0 +1,10 @@ +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 +5 5 diff --git a/test/queries_generator/aws_results/output36.csv b/test/queries_generator/aws_results/output36.csv new file mode 100644 index 00000000..75378377 --- /dev/null +++ b/test/queries_generator/aws_results/output36.csv @@ -0,0 +1,10 @@ +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 diff --git a/test/queries_generator/aws_results/output37.csv b/test/queries_generator/aws_results/output37.csv new file mode 100644 index 00000000..39f1939a --- /dev/null +++ b/test/queries_generator/aws_results/output37.csv @@ -0,0 +1,10 @@ +53707960 +26561807 +247785079 +215632847 +208737934 +206056457 +411034742 +2190215 +286546921 +530698312 diff --git a/test/queries_generator/aws_results/output38.csv b/test/queries_generator/aws_results/output38.csv new file mode 100644 index 00000000..7cbd0435 --- /dev/null +++ b/test/queries_generator/aws_results/output38.csv @@ -0,0 +1,10 @@ +1 +1 +1 +1 +1 +1 +0 +1 +1 +0 diff --git a/test/queries_generator/aws_results/output39.csv b/test/queries_generator/aws_results/output39.csv new file mode 100644 index 00000000..a2a7667d --- /dev/null +++ b/test/queries_generator/aws_results/output39.csv @@ -0,0 +1,10 @@ +1 +1 +1 +1 +5 +5 +0 +1 +8 +2 diff --git a/test/queries_generator/aws_results/output4.csv b/test/queries_generator/aws_results/output4.csv new file mode 100644 index 00000000..be5aefe9 --- /dev/null +++ b/test/queries_generator/aws_results/output4.csv @@ -0,0 +1 @@ +-67 diff --git a/test/queries_generator/aws_results/output40.csv b/test/queries_generator/aws_results/output40.csv new file mode 100644 index 00000000..3095e019 --- /dev/null +++ b/test/queries_generator/aws_results/output40.csv @@ -0,0 +1,10 @@ +Nov 39 +00:00 2020 +00:00 02020 11 +Dec 83 +09:45 2009 +09:45 02009 12 +Mar 44 -12:00 2001 -12:00 02001 3 +Sep 00 +12:30 1995 +12:30 01995 9 +Feb 20 +00:00 2013 +00:00 02013 2 +Apr 00 -01:05 1998 -01:05 01998 4 +Oct 00 +00:00 2007 +00:00 02007 10 +Jul 23 -00:30 2020 -00:30 02020 7 +May 23 +05:15 2019 +05:15 02019 5 +Sep 00 +00:00 2000 +00:00 02000 9 diff --git a/test/queries_generator/aws_results/output41.csv b/test/queries_generator/aws_results/output41.csv new file mode 100644 index 00000000..fff0a247 --- /dev/null +++ b/test/queries_generator/aws_results/output41.csv @@ -0,0 +1 @@ +74 diff --git a/test/queries_generator/aws_results/output42.csv b/test/queries_generator/aws_results/output42.csv new file mode 100644 index 00000000..0c6dede2 --- /dev/null +++ b/test/queries_generator/aws_results/output42.csv @@ -0,0 +1,10 @@ +42 +21 +35 +38 +42 +45 +85 +22 +38 +66 diff --git a/test/queries_generator/aws_results/output43.csv b/test/queries_generator/aws_results/output43.csv new file mode 100644 index 00000000..6f42812a --- /dev/null +++ b/test/queries_generator/aws_results/output43.csv @@ -0,0 +1,10 @@ +13466 +6672 +14174 +12829 +12578 +12374 +8886 +3761 +11137 +8232 diff --git a/test/queries_generator/aws_results/output44.csv b/test/queries_generator/aws_results/output44.csv new file mode 100644 index 00000000..d36bcbff --- /dev/null +++ b/test/queries_generator/aws_results/output44.csv @@ -0,0 +1,10 @@ +32609522 +26877139 +22270319 +19368831 +28539729 +20740031 +25750001 +32439618 +31813427 +22028602 diff --git a/test/queries_generator/aws_results/output45.csv b/test/queries_generator/aws_results/output45.csv new file mode 100644 index 00000000..ccc104e6 --- /dev/null +++ b/test/queries_generator/aws_results/output45.csv @@ -0,0 +1,10 @@ +7343 +3653 +9094 +7347 +6465 +5862 +7663 +525 +5641 +7282 diff --git a/test/queries_generator/aws_results/output46.csv b/test/queries_generator/aws_results/output46.csv new file mode 100644 index 00000000..34643b69 --- /dev/null +++ b/test/queries_generator/aws_results/output46.csv @@ -0,0 +1 @@ +10704 diff --git a/test/queries_generator/aws_results/output47.csv b/test/queries_generator/aws_results/output47.csv new file mode 100644 index 00000000..939017ee --- /dev/null +++ b/test/queries_generator/aws_results/output47.csv @@ -0,0 +1,10 @@ +0 +-3 +-6 +-9 +-12 +-15 +-18 +-21 +-24 +-27 diff --git a/test/queries_generator/aws_results/output48.csv b/test/queries_generator/aws_results/output48.csv new file mode 100644 index 00000000..b8cb3c5c --- /dev/null +++ b/test/queries_generator/aws_results/output48.csv @@ -0,0 +1,10 @@ +2022-10-26T18:40:30.397Z +2011-12-02T08:41:45.8327+09:45 +2003-02-28T06:37:23.446633-12:00 +1997-08-24T08:59:00+12:30 +2015-01-30T12:46:59.2Z +2000-04-01T00:44-01:05 +2009-10-11T05:19:30Z +2022-06-30T18:26:01.23323-00:30 +2021-04-21T03:40:22.23+05:15 +2002-09-13T22:00Z diff --git a/test/queries_generator/aws_results/output49.csv b/test/queries_generator/aws_results/output49.csv new file mode 100644 index 00000000..6179f56c --- /dev/null +++ b/test/queries_generator/aws_results/output49.csv @@ -0,0 +1,10 @@ +000 +945 +200 +230 +000 +105 +000 +030 +515 +000 diff --git a/test/queries_generator/aws_results/output5.csv b/test/queries_generator/aws_results/output5.csv new file mode 100644 index 00000000..e15db9dd --- /dev/null +++ b/test/queries_generator/aws_results/output5.csv @@ -0,0 +1,10 @@ +31 10 +00 Nov PM Z Z 57 +31 10 +00 Nov PM Z Z 57 +31 10 +00 Nov PM Z Z 57 +31 10 +00 Nov PM Z Z 57 +31 10 +00 Nov PM Z Z 57 +31 10 +00 Nov PM Z Z 57 +31 10 +00 Nov PM Z Z 57 +31 10 +00 Nov PM Z Z 57 +31 10 +00 Nov PM Z Z 57 +31 10 +00 Nov PM Z Z 57 diff --git a/test/queries_generator/aws_results/output50.csv b/test/queries_generator/aws_results/output50.csv new file mode 100644 index 00000000..d1a47495 --- /dev/null +++ b/test/queries_generator/aws_results/output50.csv @@ -0,0 +1,10 @@ +2026-06-26T12:21:30.397Z +2015-08-02T02:22:45.8327+09:45 +2006-10-28T00:18:23.446633-12:00 +2001-04-24T02:40:00+12:30 +2018-09-30T06:27:59.2Z +2003-11-30T18:25-01:05 +2013-06-10T23:00:30Z +2026-02-28T12:07:01.23323-00:30 +2024-12-20T21:21:22.23+05:15 +2006-05-13T15:41Z diff --git a/test/queries_generator/aws_results/output51.csv b/test/queries_generator/aws_results/output51.csv new file mode 100644 index 00000000..af07951b --- /dev/null +++ b/test/queries_generator/aws_results/output51.csv @@ -0,0 +1,10 @@ +2036-10-31T11:21:30.397Z +2025-12-07T01:22:45.8327+09:45 +2017-03-04T23:18:23.446633-12:00 +2011-08-29T01:40:00+12:30 +2029-02-04T05:27:59.2Z +2014-04-05T17:25-01:05 +2023-10-15T22:00:30Z +2036-07-05T11:07:01.23323-00:30 +2035-04-25T20:21:22.23+05:15 +2016-09-18T14:41Z diff --git a/test/queries_generator/aws_results/output52.csv b/test/queries_generator/aws_results/output52.csv new file mode 100644 index 00000000..cfb86135 --- /dev/null +++ b/test/queries_generator/aws_results/output52.csv @@ -0,0 +1 @@ +-16 diff --git a/test/queries_generator/aws_results/output53.csv b/test/queries_generator/aws_results/output53.csv new file mode 100644 index 00000000..ec75de79 --- /dev/null +++ b/test/queries_generator/aws_results/output53.csv @@ -0,0 +1,10 @@ +278 +278 +278 +278 +278 +278 +278 +278 +278 +278 diff --git a/test/queries_generator/aws_results/output54.csv b/test/queries_generator/aws_results/output54.csv new file mode 100644 index 00000000..d874d46f --- /dev/null +++ b/test/queries_generator/aws_results/output54.csv @@ -0,0 +1,10 @@ +02020 : 4 +02009 : 6 +02001 : 4 +01995 : 6 +02013 : 10 +01998 : 10 +02007 : 3 +02020 : 4 +02019 : 1 +02000 : 7 diff --git a/test/queries_generator/aws_results/output55.csv b/test/queries_generator/aws_results/output55.csv new file mode 100644 index 00000000..e1401a29 --- /dev/null +++ b/test/queries_generator/aws_results/output55.csv @@ -0,0 +1,10 @@ +2030-12-26T15:21:30.397Z +2020-02-02T05:22:45.8327+09:45 +2011-04-28T03:18:23.446633-12:00 +2005-10-24T05:40:00+12:30 +2023-03-30T09:27:59.2Z +2008-05-31T21:25-01:05 +2017-12-11T02:00:30Z +2030-08-30T15:07:01.23323-00:30 +2029-06-21T00:21:22.23+05:15 +2010-11-13T18:41Z diff --git a/test/queries_generator/aws_results/output56.csv b/test/queries_generator/aws_results/output56.csv new file mode 100644 index 00000000..a1b07cbc --- /dev/null +++ b/test/queries_generator/aws_results/output56.csv @@ -0,0 +1 @@ +195294388 diff --git a/test/queries_generator/aws_results/output57.csv b/test/queries_generator/aws_results/output57.csv new file mode 100644 index 00000000..2bf5ca7a --- /dev/null +++ b/test/queries_generator/aws_results/output57.csv @@ -0,0 +1,10 @@ +14680 +7307 +18194 +14701 +12936 +11735 +15340 +1067 +11302 +14577 diff --git a/test/queries_generator/aws_results/output58.csv b/test/queries_generator/aws_results/output58.csv new file mode 100644 index 00000000..464cfad3 --- /dev/null +++ b/test/queries_generator/aws_results/output58.csv @@ -0,0 +1,10 @@ +-7 +-7 +-7 +-7 +-7 +-7 +-7 +-7 +-7 +-7 diff --git a/test/queries_generator/aws_results/output59.csv b/test/queries_generator/aws_results/output59.csv new file mode 100644 index 00000000..0e72d409 --- /dev/null +++ b/test/queries_generator/aws_results/output59.csv @@ -0,0 +1,10 @@ ++00:00 7 - +00:00 350987000 Z 35 350987 35 ++00:00 7 - +00:00 350987000 Z 35 350987 35 ++00:00 7 - +00:00 350987000 Z 35 350987 35 ++00:00 7 - +00:00 350987000 Z 35 350987 35 ++00:00 7 - +00:00 350987000 Z 35 350987 35 ++00:00 7 - +00:00 350987000 Z 35 350987 35 ++00:00 7 - +00:00 350987000 Z 35 350987 35 ++00:00 7 - +00:00 350987000 Z 35 350987 35 ++00:00 7 - +00:00 350987000 Z 35 350987 35 ++00:00 7 - +00:00 350987000 Z 35 350987 35 diff --git a/test/queries_generator/aws_results/output6.csv b/test/queries_generator/aws_results/output6.csv new file mode 100644 index 00000000..15ee9664 --- /dev/null +++ b/test/queries_generator/aws_results/output6.csv @@ -0,0 +1,10 @@ +2021-05-28T11:30:30.397Z +2010-07-04T01:31:45.8327+09:45 +2001-09-29T23:27:23.446633-12:00 +1996-03-26T01:49:00+12:30 +2013-09-01T05:36:59.2Z +1998-11-02T17:34-01:05 +2008-05-12T22:09:30Z +2021-02-01T11:16:01.23323-00:30 +2019-11-22T20:30:22.23+05:15 +2001-04-15T14:50Z diff --git a/test/queries_generator/aws_results/output60.csv b/test/queries_generator/aws_results/output60.csv new file mode 100644 index 00000000..297346df --- /dev/null +++ b/test/queries_generator/aws_results/output60.csv @@ -0,0 +1,10 @@ +-128782 +-63511 +-106747 +-115168 +-128410 +-136750 +-25648 +-67903 +-115321 +-19837 diff --git a/test/queries_generator/aws_results/output61.csv b/test/queries_generator/aws_results/output61.csv new file mode 100644 index 00000000..6c827b22 --- /dev/null +++ b/test/queries_generator/aws_results/output61.csv @@ -0,0 +1,10 @@ +-18873 +-14891 +-11693 +-9678 +-16046 +-10629 +-14109 +-18755 +-18319 +-11525 diff --git a/test/queries_generator/aws_results/output62.csv b/test/queries_generator/aws_results/output62.csv new file mode 100644 index 00000000..f60f2e63 --- /dev/null +++ b/test/queries_generator/aws_results/output62.csv @@ -0,0 +1 @@ +42968 diff --git a/test/queries_generator/aws_results/output63.csv b/test/queries_generator/aws_results/output63.csv new file mode 100644 index 00000000..2d91bfe8 --- /dev/null +++ b/test/queries_generator/aws_results/output63.csv @@ -0,0 +1,10 @@ +2023-03-26T11:21:39.397Z +2012-05-02T01:22:54.8327+09:45 +2003-07-27T23:18:32.446633-12:00 +1998-01-24T01:40:09+12:30 +2015-06-30T05:28:08.2Z +2000-08-31T17:25:09-01:05 +2010-03-10T22:00:39Z +2022-11-30T11:07:10.23323-00:30 +2021-09-20T20:21:31.23+05:15 +2003-02-13T14:41:09Z diff --git a/test/queries_generator/aws_results/output64.csv b/test/queries_generator/aws_results/output64.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output64.csv @@ -0,0 +1,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..b2bd83b2 --- /dev/null +++ b/test/queries_generator/aws_results/output65.csv @@ -0,0 +1,10 @@ +42926 +21169 +35581 +38388 +42802 +75970 +13432 +33949 +55523 +9255 diff --git a/test/queries_generator/aws_results/output66.csv b/test/queries_generator/aws_results/output66.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output66.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/aws_results/output67.csv b/test/queries_generator/aws_results/output67.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output67.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/aws_results/output68.csv b/test/queries_generator/aws_results/output68.csv new file mode 100644 index 00000000..fd9327c2 --- /dev/null +++ b/test/queries_generator/aws_results/output68.csv @@ -0,0 +1,10 @@ +er +er +or +figh +er +ce o +or +lope +or +ce o diff --git a/test/queries_generator/aws_results/output69.csv b/test/queries_generator/aws_results/output69.csv new file mode 100644 index 00000000..e459fe58 --- /dev/null +++ b/test/queries_generator/aws_results/output69.csv @@ -0,0 +1,10 @@ +-14668 +-7296 +-18182 +-14690 +-12928 +-11726 +-15330 +-1056 +-11290 +-14574 diff --git a/test/queries_generator/aws_results/output7.csv b/test/queries_generator/aws_results/output7.csv new file mode 100644 index 00000000..9d8010c1 --- /dev/null +++ b/test/queries_generator/aws_results/output7.csv @@ -0,0 +1,10 @@ +1974-07-06T14:10:05.361040Z +1974-07-06T14:10:05.361040Z +1974-07-06T14:10:05.361040Z +1974-07-06T14:10:05.361040Z +1974-07-06T14:10:05.361040Z +1974-07-06T14:10:05.361040Z +1974-07-06T14:10:05.361040Z +1974-07-06T14:10:05.361040Z +1974-07-06T14:10:05.361040Z +1974-07-06T14:10:05.361040Z diff --git a/test/queries_generator/aws_results/output70.csv b/test/queries_generator/aws_results/output70.csv new file mode 100644 index 00000000..b950460f --- /dev/null +++ b/test/queries_generator/aws_results/output70.csv @@ -0,0 +1,10 @@ +-2310624 +-567868 +-631319 +-510844 +-455744 +-404324 +-58217 +-152185 +-224935 +-28352 diff --git a/test/queries_generator/aws_results/output71.csv b/test/queries_generator/aws_results/output71.csv new file mode 100644 index 00000000..82322e80 --- /dev/null +++ b/test/queries_generator/aws_results/output71.csv @@ -0,0 +1,10 @@ +-252435060 +-252435060 +-252435060 +-252435060 +-252435060 +-252435060 +-252435060 +-252435060 +-252435060 +-252435060 diff --git a/test/queries_generator/aws_results/output72.csv b/test/queries_generator/aws_results/output72.csv new file mode 100644 index 00000000..3f46206c --- /dev/null +++ b/test/queries_generator/aws_results/output72.csv @@ -0,0 +1 @@ +182323 diff --git a/test/queries_generator/aws_results/output73.csv b/test/queries_generator/aws_results/output73.csv new file mode 100644 index 00000000..fd634668 --- /dev/null +++ b/test/queries_generator/aws_results/output73.csv @@ -0,0 +1,10 @@ +6 +6 +6 +6 +6 +6 +6 +6 +6 +6 diff --git a/test/queries_generator/aws_results/output74.csv b/test/queries_generator/aws_results/output74.csv new file mode 100644 index 00000000..82993887 --- /dev/null +++ b/test/queries_generator/aws_results/output74.csv @@ -0,0 +1,10 @@ +-51339 +-25537 +-63636 +-51416 +-45250 +-41044 +-53652 +-3734 +-39517 +-51005 diff --git a/test/queries_generator/aws_results/output75.csv b/test/queries_generator/aws_results/output75.csv new file mode 100644 index 00000000..513dcd77 --- /dev/null +++ b/test/queries_generator/aws_results/output75.csv @@ -0,0 +1,10 @@ +42939 +42350 +106754 +153561 +214018 +273499 +59842 +181068 +345954 +66112 diff --git a/test/queries_generator/aws_results/output76.csv b/test/queries_generator/aws_results/output76.csv new file mode 100644 index 00000000..57d1baf7 --- /dev/null +++ b/test/queries_generator/aws_results/output76.csv @@ -0,0 +1,10 @@ +258580 +126492 +148358 +207991 +289905 +360276 +17245 +970766 +267471 +13383 diff --git a/test/queries_generator/aws_results/output77.csv b/test/queries_generator/aws_results/output77.csv new file mode 100644 index 00000000..2bda1f96 --- /dev/null +++ b/test/queries_generator/aws_results/output77.csv @@ -0,0 +1,10 @@ +t11: +t01: +t23: +t01: +t05: +t17: +t22: +t11: +t20: +t14: diff --git a/test/queries_generator/aws_results/output78.csv b/test/queries_generator/aws_results/output78.csv new file mode 100644 index 00000000..00d4d562 --- /dev/null +++ b/test/queries_generator/aws_results/output78.csv @@ -0,0 +1 @@ +401478 diff --git a/test/queries_generator/aws_results/output79.csv b/test/queries_generator/aws_results/output79.csv new file mode 100644 index 00000000..077e8834 --- /dev/null +++ b/test/queries_generator/aws_results/output79.csv @@ -0,0 +1,10 @@ +2021-07-30T11:21:39.397Z +2010-09-06T01:22:54.8327+09:45 +2001-12-03T23:18:32.446633-12:00 +1996-05-28T01:40:09+12:30 +2013-11-03T05:28:08.2Z +1999-01-04T17:25:09-01:05 +2008-07-14T22:00:39Z +2021-04-04T11:07:10.23323-00:30 +2020-01-24T20:21:31.23+05:15 +2001-06-17T14:41:09Z diff --git a/test/queries_generator/aws_results/output8.csv b/test/queries_generator/aws_results/output8.csv new file mode 100644 index 00000000..e1ae67dc --- /dev/null +++ b/test/queries_generator/aws_results/output8.csv @@ -0,0 +1,10 @@ +42928 +21173 +35587 +38396 +42812 +45594 +8562 +22649 +38457 +6631 diff --git a/test/queries_generator/aws_results/output80.csv b/test/queries_generator/aws_results/output80.csv new file mode 100644 index 00000000..964480f6 --- /dev/null +++ b/test/queries_generator/aws_results/output80.csv @@ -0,0 +1 @@ +213 diff --git a/test/queries_generator/aws_results/output81.csv b/test/queries_generator/aws_results/output81.csv new file mode 100644 index 00000000..e85903f2 --- /dev/null +++ b/test/queries_generator/aws_results/output81.csv @@ -0,0 +1,10 @@ + + + +h + +o + +e + +o diff --git a/test/queries_generator/aws_results/output82.csv b/test/queries_generator/aws_results/output82.csv new file mode 100644 index 00000000..3e26c256 --- /dev/null +++ b/test/queries_generator/aws_results/output82.csv @@ -0,0 +1,10 @@ +14683 +7313 +18201 +14711 +12951 +11751 +15357 +1085 +11321 +14607 diff --git a/test/queries_generator/aws_results/output83.csv b/test/queries_generator/aws_results/output83.csv new file mode 100644 index 00000000..b1eb21e5 --- /dev/null +++ b/test/queries_generator/aws_results/output83.csv @@ -0,0 +1,10 @@ +1939-11-23T16:55:42.932361Z +1939-11-23T16:55:42.932361Z +1939-11-23T16:55:42.932361Z +1939-11-23T16:55:42.932361Z +1939-11-23T16:55:42.932361Z +1939-11-23T16:55:42.932361Z +1939-11-23T16:55:42.932361Z +1939-11-23T16:55:42.932361Z +1939-11-23T16:55:42.932361Z +1939-11-23T16:55:42.932361Z diff --git a/test/queries_generator/aws_results/output84.csv b/test/queries_generator/aws_results/output84.csv new file mode 100644 index 00000000..4521d575 --- /dev/null +++ b/test/queries_generator/aws_results/output84.csv @@ -0,0 +1,10 @@ +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 diff --git a/test/queries_generator/aws_results/output85.csv b/test/queries_generator/aws_results/output85.csv new file mode 100644 index 00000000..e210aa65 --- /dev/null +++ b/test/queries_generator/aws_results/output85.csv @@ -0,0 +1,10 @@ +1047 +521 +1298 +1049 +923 +837 +1095 +75 +806 +1041 diff --git a/test/queries_generator/aws_results/output86.csv b/test/queries_generator/aws_results/output86.csv new file mode 100644 index 00000000..4613e54d --- /dev/null +++ b/test/queries_generator/aws_results/output86.csv @@ -0,0 +1,10 @@ +2021-02-28T11:30:39.397Z +2010-04-04T01:31:54.8327+09:45 +2001-06-29T23:27:32.446633-12:00 +1995-12-26T01:49:09+12:30 +2013-06-01T05:37:08.2Z +1998-08-02T17:34:09-01:05 +2008-02-12T22:09:39Z +2020-11-01T11:16:10.23323-00:30 +2019-08-22T20:30:31.23+05:15 +2001-01-15T14:50:09Z diff --git a/test/queries_generator/aws_results/output87.csv b/test/queries_generator/aws_results/output87.csv new file mode 100644 index 00000000..48a9ff90 --- /dev/null +++ b/test/queries_generator/aws_results/output87.csv @@ -0,0 +1,10 @@ +0 +45 +0 +30 +0 +-5 +0 +-30 +15 +0 diff --git a/test/queries_generator/aws_results/output88.csv b/test/queries_generator/aws_results/output88.csv new file mode 100644 index 00000000..c63424ab --- /dev/null +++ b/test/queries_generator/aws_results/output88.csv @@ -0,0 +1,10 @@ +-4755 +-4755 +-4755 +-4756 +-4755 +-4755 +-4756 +-4755 +-4756 +-4755 diff --git a/test/queries_generator/aws_results/output89.csv b/test/queries_generator/aws_results/output89.csv new file mode 100644 index 00000000..30fdf8c0 --- /dev/null +++ b/test/queries_generator/aws_results/output89.csv @@ -0,0 +1,10 @@ +02 +00 +00 +99 +01 +99 +00 +02 +01 +00 diff --git a/test/queries_generator/aws_results/output9.csv b/test/queries_generator/aws_results/output9.csv new file mode 100644 index 00000000..7fc21204 --- /dev/null +++ b/test/queries_generator/aws_results/output9.csv @@ -0,0 +1,10 @@ +35603 +17538 +26513 +31072 +36373 +39760 +930 +22158 +32853 +-611 diff --git a/test/queries_generator/aws_results/output90.csv b/test/queries_generator/aws_results/output90.csv new file mode 100644 index 00000000..878d5a02 --- /dev/null +++ b/test/queries_generator/aws_results/output90.csv @@ -0,0 +1 @@ +146 diff --git a/test/queries_generator/aws_results/output91.csv b/test/queries_generator/aws_results/output91.csv new file mode 100644 index 00000000..7633d868 --- /dev/null +++ b/test/queries_generator/aws_results/output91.csv @@ -0,0 +1,10 @@ +1999-03-11T15:02:40.730891Z +1999-03-11T15:02:40.730891Z +1999-03-11T15:02:40.730891Z +1999-03-11T15:02:40.730891Z +1999-03-11T15:02:40.730891Z +1999-03-11T15:02:40.730891Z +1999-03-11T15:02:40.730891Z +1999-03-11T15:02:40.730891Z +1999-03-11T15:02:40.730891Z +1999-03-11T15:02:40.730891Z diff --git a/test/queries_generator/aws_results/output92.csv b/test/queries_generator/aws_results/output92.csv new file mode 100644 index 00000000..1015728a --- /dev/null +++ b/test/queries_generator/aws_results/output92.csv @@ -0,0 +1,10 @@ +2021-07-26T16:38:30.397Z +2010-09-02T06:39:45.8327+09:45 +2001-11-28T04:35:23.446633-12:00 +1996-05-24T06:57:00+12:30 +2013-10-30T10:44:59.2Z +1998-12-31T22:42-01:05 +2008-07-11T03:17:30Z +2021-03-30T16:24:01.23323-00:30 +2020-01-21T01:38:22.23+05:15 +2001-06-13T19:58Z diff --git a/test/queries_generator/aws_results/output93.csv b/test/queries_generator/aws_results/output93.csv new file mode 100644 index 00000000..584ba879 --- /dev/null +++ b/test/queries_generator/aws_results/output93.csv @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/queries_generator/aws_results/output94.csv b/test/queries_generator/aws_results/output94.csv new file mode 100644 index 00000000..954c6e83 --- /dev/null +++ b/test/queries_generator/aws_results/output94.csv @@ -0,0 +1,10 @@ +6 +6 +6 +6 +6 +6 +6 +6 +6 +6 diff --git a/test/queries_generator/aws_results/output95.csv b/test/queries_generator/aws_results/output95.csv new file mode 100644 index 00000000..27f512c2 --- /dev/null +++ b/test/queries_generator/aws_results/output95.csv @@ -0,0 +1,10 @@ +26 +26 +26 +26 +26 +26 +26 +26 +26 +26 diff --git a/test/queries_generator/aws_results/output96.csv b/test/queries_generator/aws_results/output96.csv new file mode 100644 index 00000000..d16ff393 --- /dev/null +++ b/test/queries_generator/aws_results/output96.csv @@ -0,0 +1,10 @@ +14668 +7296 +18182 +14690 +12928 +11726 +15362 +1088 +11322 +14606 diff --git a/test/queries_generator/aws_results/output97.csv b/test/queries_generator/aws_results/output97.csv new file mode 100644 index 00000000..398e3a90 --- /dev/null +++ b/test/queries_generator/aws_results/output97.csv @@ -0,0 +1 @@ +1984241 diff --git a/test/queries_generator/aws_results/output98.csv b/test/queries_generator/aws_results/output98.csv new file mode 100644 index 00000000..b47ea5dc --- /dev/null +++ b/test/queries_generator/aws_results/output98.csv @@ -0,0 +1,10 @@ +9172 +4553 +10612 +8986 +8293 +7810 +8024 +1489 +7283 +7560 diff --git a/test/queries_generator/aws_results/output99.csv b/test/queries_generator/aws_results/output99.csv new file mode 100644 index 00000000..bc2405a9 --- /dev/null +++ b/test/queries_generator/aws_results/output99.csv @@ -0,0 +1,10 @@ +0 Z 26 Z 2 +5 +0945 27 +0 -12 23 - +0 +1230 45 +0 Z 32 Z 1 +5 -0105 30 +0 Z 5 Z 08 +0 -0030 12 +5 +0515 26 +0 Z 46 Z 0 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..ad377341 --- /dev/null +++ b/test/queries_generator/queries.txt @@ -0,0 +1,100 @@ +select 6*2*6/cast(_1 as int)-cast(_1 as int)+7-5+4 from s3object; +select cast(_2 as int)+cast(_1 as int)*8+cast(_3 as int)-2-10*cast(_3 as int)/4 from s3object; +select substring(lower(upper(lower(_8))), 10, 5) from s3object; +select count(cast(_3 as int)*2-cast(_2 as int)-8*cast(_2 as int)*cast(_3 as int)*cast(_2 as int)-2/9) / 7/1-1+2-4+7-9*8 from s3object; +select to_string(date_add(hour, 7, date_add(second, 9, date_add(month, 8, to_timestamp('1957-03-01T15:14:22.547033Z')))), 's h x MMM a XX XXXX yy ') from s3object; +select date_add(minute, 6, date_add(minute, 3, date_add(day, 2, date_add(month, 7, to_timestamp(_9))))) from s3object; +select date_add(month, 4, date_add(hour, 7, date_add(year, 2, date_add(second, 10, to_timestamp('1972-03-06T07:09:55.361040Z'))))) from s3object; +select cast(_1 as int)+cast(_1 as int)+9/3*10/cast(_2 as int)/7+cast(_2 as int) from s3object; +select 4+cast(_2 as int)+7*cast(_1 as int)-1-cast(_3 as int)+2-cast(_1 as int) from s3object; +select date_add(hour, 3, date_add(month, 3, date_add(year, 6, date_add(day, 8, to_timestamp(_9))))) from s3object; +select date_diff(month, date_add(second, 6, date_add(second, 4, date_add(year, 8, to_timestamp('1945-07-10T08:57:20.928169Z')))), date_add(year, 2, date_add(minute, 1, date_add(hour, 7, to_timestamp('1929-12-19T18:58:24.72684Z'))))) from s3object; +select cast(_1 as int)/cast(_3 as int)*9+4-10/cast(_2 as int)/cast(_1 as int)+cast(_2 as int) from s3object; +select 7-8+1+cast(_1 as int)*6-4-9+cast(_3 as int) from s3object; +select cast(_2 as int)/3+8/cast(_1 as int)*cast(_2 as int)-cast(_3 as int)+2-9 from s3object; +select date_add(month, 10, date_add(minute, 2, date_add(month, 7, date_add(hour, 3, to_timestamp('1972-10-28T03:52:22.859837Z'))))) from s3object; +select date_add(hour, 6, date_add(second, 2, date_add(second, 4, date_add(month, 2, to_timestamp('1963-05-03T02:47:55.749638Z'))))) from s3object; +select lower(upper(upper(substring(_8, 4, 5)))) from s3object; +select date_diff(minute, date_add(hour, 8, date_add(hour, 7, date_add(minute, 5, to_timestamp(_9)))), date_add(second, 9, date_add(second, 7, date_add(year, 9, to_timestamp('1970-11-14T08:50:28.47889Z'))))) from s3object; +select substring(lower(to_string(date_add(second, 1, to_timestamp('1910-04-09T23:12:24.71881Z')), 'H a x : ')), 10, 6) from s3object; +select date_add(month, 1, date_add(second, 8, date_add(second, 7, date_add(second, 3, to_timestamp('1914-01-11T14:45:48.505116Z'))))) from s3object; +select 4*10*cast(_3 as int)/cast(_3 as int)-cast(_3 as int)-cast(_2 as int)-cast(_3 as int)*cast(_1 as int) from s3object; +select 8*4/cast(_1 as int)-5-cast(_2 as int)+cast(_1 as int)*cast(_3 as int)+3 from s3object; +select date_add(year, 6, date_add(minute, 3, date_add(month, 4, date_add(second, 7, to_timestamp(_9))))) from s3object; +select cast(_1 as int)+10*cast(_2 as int)/cast(_1 as int)+cast(_3 as int)/10-2-10 from s3object; +select cast(_3 as int)-cast(_3 as int)+cast(_1 as int)/5+2/cast(_2 as int)/7/10 from s3object; +select sum(cast(_1 as int)/7/cast(_1 as int)*10+10*10*cast(_3 as int)*2*cast(_3 as int)) - 7-6/5/7+4-8*1-3 from s3object; +select max(cast(_1 as int)+2*cast(_3 as int)*5-8*cast(_2 as int)*8/10+9) + 9*8/6/8-4+7/4-5 from s3object; +select date_add(second, 9, date_add(day, 3, date_add(second, 9, date_add(hour, 4, to_timestamp(_9))))) from s3object; +select 2/9+3-6*cast(_1 as int)*3/8+1 from s3object; +select cast((avg(cast(_2 as int)*4+1*cast(_1 as int)/3+9/2*3+cast(_1 as int)) - 6/2-10-9+1*1-4*4) as int) from s3object; +select date_add(minute, 4, date_add(minute, 3, date_add(hour, 3, date_add(year, 2, to_timestamp(_9))))) from s3object; +select date_add(second, 7, date_add(hour, 8, date_add(hour, 2, date_add(hour, 8, to_timestamp(_9))))) from s3object; +select cast(_3 as int)-cast(_1 as int)*5*cast(_1 as int)+cast(_1 as int)+cast(_3 as int)*3-cast(_2 as int) from s3object; +select date_add(hour, 6, date_add(hour, 4, date_add(second, 9, date_add(minute, 2, to_timestamp(_9))))) from s3object; +select substring(lower(upper(to_string(to_timestamp('1913-09-05T12:48:45.613098Z'), 'ss HH s d '))), 8, 9) from s3object; +select character_length(to_string(date_add(hour, 2, date_add(hour, 1, to_timestamp(_9))), 'S ')) from s3object; +select cast(_3 as int)*cast(_1 as int)*cast(_3 as int)-cast(_2 as int)-cast(_3 as int)*cast(_1 as int)*4-cast(_3 as int) from s3object; +select character_length(lower(substring(substring(_2, 2, 5), 4, 8))) from s3object; +select substring(upper(to_string(date_add(second, 8, to_timestamp(_9)), 'xxx hh ')), 9, 4) from s3object; +select to_string(date_add(hour, 5, date_add(day, 10, date_add(day, 4, to_timestamp(_9)))), 'MMM SS xxx yyyy xxx yyyyy M ') from s3object; +select max(cast(_2 as int)*9/cast(_2 as int)-7/cast(_1 as int)-cast(_1 as int)/8/cast(_1 as int)*cast(_2 as int)) + 5-6+6+6*10-2/7*10 from s3object; +select substring(lower(upper(upper(_2))), 1, 2) from s3object; +select cast(_3 as int)-4/cast(_2 as int)+cast(_1 as int)/9+1*cast(_2 as int)/7 from s3object; +select date_diff(minute, date_add(second, 7, date_add(day, 4, date_add(day, 5, to_timestamp('1959-07-18T02:25:32.956102Z')))), date_add(month, 9, date_add(minute, 7, date_add(hour, 3, to_timestamp(_9))))) from s3object; +select 9+5/cast(_1 as int)-9+9-cast(_1 as int)+cast(_3 as int)-4 from s3object; +select min(cast(_2 as int)+3*cast(_2 as int)-3/cast(_2 as int)+cast(_2 as int)*cast(_1 as int)-cast(_1 as int)-cast(_2 as int)) / 8+1*10*7-2-3*8*2 from s3object; +select 1+2-3*cast(_1 as int)+cast(_2 as int)/7/8/cast(_3 as int) from s3object; +select date_add(hour, 7, date_add(year, 2, date_add(minute, 10, date_add(minute, 9, to_timestamp(_9))))) from s3object; +select substring(to_string(date_add(second, 10, date_add(minute, 4, to_timestamp(_9))), 'xxxx '), 3, 6) from s3object; +select date_add(year, 2, date_add(hour, 1, date_add(year, 3, date_add(month, 8, to_timestamp(_9))))) from s3object; +select date_add(year, 4, date_add(year, 3, date_add(year, 9, date_add(day, 5, to_timestamp(_9))))) from s3object; +select min(cast(_1 as int)+cast(_1 as int)*cast(_1 as int)-9-2-9/cast(_1 as int)-cast(_1 as int)/cast(_1 as int)) + 10/3/4-1+5-9*1/7 from s3object; +select date_diff(month, date_add(month, 10, date_add(year, 6, date_add(year, 4, to_timestamp('1945-11-12T19:15:15.440144Z')))), date_add(second, 3, date_add(hour, 7, date_add(hour, 10, to_timestamp('1979-12-05T15:23:07.631157Z'))))) from s3object; +select to_string(date_add(hour, 5, date_add(second, 10, date_add(second, 4, to_timestamp(_9)))), 'yyyyy : h ') from s3object; +select date_add(hour, 4, date_add(month, 2, date_add(year, 5, date_add(year, 5, to_timestamp(_9))))) from s3object; +select max(cast(_1 as int)*cast(_2 as int)*cast(_3 as int)+9/4+cast(_1 as int)+8+cast(_1 as int)*cast(_3 as int)) / 10-9*8/3-5*1-8/2 from s3object; +select cast(_1 as int)/cast(_1 as int)+2+cast(_3 as int)+9/cast(_1 as int)*cast(_1 as int)+cast(_3 as int) from s3object; +select 9*cast(_1 as int)/cast(_2 as int)+2*10/cast(_2 as int)/8-7 from s3object; +select to_string(date_add(day, 8, date_add(month, 2, date_add(hour, 7, to_timestamp('1977-03-21T12:31:15.350987Z')))), 'xxx h - xxxxx SSSSSSSSS XXXXX SS SSSSSS SS ') from s3object; +select cast(_2 as int)-4+8/cast(_3 as int)+8/cast(_2 as int)-4*cast(_2 as int) from s3object; +select date_diff(day, date_add(year, 4, date_add(year, 6, date_add(day, 9, to_timestamp(_9)))), date_add(day, 10, date_add(month, 1, date_add(hour, 1, to_timestamp('1979-01-22T06:27:28.376014Z'))))) from s3object; +select max(cast(_2 as int)/cast(_1 as int)+6+9+3-10*5/cast(_2 as int)+3) + 3+1-7/8/8+8+1+8 from s3object; +select date_add(second, 7, date_add(month, 5, date_add(year, 2, date_add(second, 2, to_timestamp(_9))))) from s3object; +select upper(substring(upper(to_string(to_timestamp(_9), '')), 6, 5)) from s3object; +select cast(_1 as int)/6*cast(_2 as int)*4/cast(_1 as int)+cast(_2 as int)*cast(_3 as int)/cast(_3 as int) from s3object; +select lower(substring(substring(to_string(to_timestamp('1900-05-10T21:05:55.783675Z'), 'SSSSS XXXX n MMMMM MM X '), 6, 3), 9, 4)) from s3object; +select upper(substring(substring(to_string(to_timestamp('1937-02-09T08:47:20.786636Z'), 'xxxxx d XX d MMMM '), 5, 2), 6, 5)) from s3object; +select lower(lower(substring(upper(_8), 5, 4))) from s3object; +select 3/2/cast(_1 as int)/2/5-cast(_3 as int)*1-cast(_3 as int) from s3object; +select 5*9-cast(_2 as int)*6/cast(_1 as int)*9+cast(_3 as int)+cast(_1 as int) from s3object; +select date_diff(second, date_add(year, 9, date_add(year, 9, date_add(hour, 3, to_timestamp(_9)))), date_add(hour, 10, date_add(year, 10, date_add(minute, 9, to_timestamp(_9))))) from s3object; +select max(cast(_2 as int)-cast(_3 as int)+cast(_3 as int)+cast(_1 as int)+cast(_2 as int)*2+cast(_2 as int)-cast(_1 as int)+2) + 1-3-7-5/2+7*4/7 from s3object; +select substring(lower(to_string(date_add(second, 5, to_timestamp('1996-06-02T19:00:55.118379Z')), 'dd X yyy s xxxxx ')), 9, 2) from s3object; +select 8-3-cast(_2 as int)/cast(_3 as int)-cast(_1 as int)/cast(_1 as int)-7*cast(_3 as int) from s3object; +select cast(_1 as int)-9*cast(_1 as int)/4+2*7+cast(_2 as int)*cast(_1 as int) from s3object; +select cast(_3 as int)+cast(_2 as int)*cast(_2 as int)/cast(_3 as int)+cast(_1 as int)*cast(_1 as int)-5/4 from s3object; +select lower(substring(substring(lower(_9), 8, 7), 4, 8)) from s3object; +select min(cast(_2 as int)*1+1/cast(_3 as int)*cast(_1 as int)/3/4+8*cast(_1 as int)) * 6*10+6*3+9-3/10-9 from s3object; +select date_add(month, 2, date_add(month, 7, date_add(second, 9, date_add(day, 4, to_timestamp(_9))))) from s3object; +select min(cast(_1 as int)-cast(_3 as int)/cast(_3 as int)/cast(_1 as int)*cast(_1 as int)+cast(_2 as int)/cast(_1 as int)+cast(_2 as int)/cast(_1 as int)) / 6+9-9*3+9+4/8/5 from s3object; +select substring(lower(substring(upper(_8), 7, 5)), 2, 1) from s3object; +select cast(_1 as int)-5/cast(_2 as int)+cast(_3 as int)+9+cast(_3 as int)+cast(_1 as int)+4 from s3object; +select date_add(second, 6, date_add(second, 4, date_add(second, 2, date_add(second, 1, to_timestamp('1939-11-23T16:55:29.932361Z'))))) from s3object; +select character_length(substring(substring(upper(_6), 4, 2), 4, 4)) from s3object; +select cast(_3 as int)/2/cast(_2 as int)-cast(_3 as int)+cast(_3 as int)/7/1+cast(_3 as int) from s3object; +select date_add(day, 2, date_add(second, 9, date_add(minute, 9, date_add(month, 4, to_timestamp(_9))))) from s3object; +select extract(timezone_minute from date_add(hour, 5, date_add(month, 10, date_add(month, 2, to_timestamp(_9))))) from s3object; +select date_diff(day, date_add(year, 10, date_add(year, 3, date_add(day, 8, to_timestamp(_9)))), date_add(second, 7, date_add(hour, 5, date_add(second, 3, to_timestamp(_9))))) from s3object; +select substring(substring(upper(upper(_9)), 2, 2), 1, 2) from s3object; +select sum(cast(_1 as int)-5+2*cast(_3 as int)*1/cast(_3 as int)*9-3/cast(_2 as int)) - 8*6-5+4-1*8/10+10 from s3object; +select date_add(month, 9, date_add(minute, 1, date_add(year, 5, date_add(year, 3, to_timestamp('1990-06-11T15:01:40.730891Z'))))) from s3object; +select date_add(minute, 7, date_add(month, 9, date_add(hour, 5, date_add(minute, 10, to_timestamp(_9))))) from s3object; +select lower(lower(lower(to_string(to_timestamp(_9), '')))) from s3object; +select character_length(substring(upper(to_string(to_timestamp('1928-11-10T05:42:33.180083Z'), 'SS yy S X ')), 3, 6)) from s3object; +select to_string(date_add(second, 6, date_add(hour, 9, date_add(day, 9, to_timestamp('1926-04-13T13:26:43.504513Z')))), 'yy ') from s3object; +select 10/4*cast(_3 as int)+cast(_1 as int)*1/7*8*4 from s3object; +select min(cast(_1 as int)*2+cast(_3 as int)/2*cast(_2 as int)+2-cast(_1 as int)/5-cast(_2 as int)) / 3+10+8*3+2+8+8*4 from s3object; +select 4/4*cast(_3 as int)-cast(_1 as int)+cast(_2 as int)*3/7/10 from s3object; +select substring(to_string(date_add(minute, 5, date_add(month, 9, to_timestamp(_9))), 'ss xx X m XX yy xxxxx y XX '), 8, 10) from s3object; +select upper(lower(upper(substring(_3, 6, 1)))) from s3object; diff --git a/test/queries_generator/queries_generator.cpp b/test/queries_generator/queries_generator.cpp new file mode 100644 index 00000000..18d60fe6 --- /dev/null +++ b/test/queries_generator/queries_generator.cpp @@ -0,0 +1,274 @@ +#include +#include +#include +#include +#define TOTAL_COLUMN 9 +#define NUM_COLUMN_INT 3 +#define TIMESTAMP_COLUMN 9 + +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: + { + if ((rand() % 2) == 0) + { + expr = "to_timestamp(\'" + random_timestamp_string() + "\')"; + } + else + { + expr = "to_timestamp(_" + to_string(TIMESTAMP_COLUMN) + ")"; + } + 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: //for to_timestamp function + // expr = random_query_expr(0, TIMESTAMP); + // 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(); +}