diff --git a/benchmark/bench_compression_ratio.cpp b/benchmark/bench_compression_ratio.cpp index bfbc2c25..560d4608 100644 --- a/benchmark/bench_compression_ratio.cpp +++ b/benchmark/bench_compression_ratio.cpp @@ -43,6 +43,11 @@ BenchmarkCase tpch_case {Tpch::dataset, std::string(FLS_CMAKE_SOURCE_DIR) + "/benchmark/result/compression_ratio/tpch/fastlanes_detailed.csv"}; +BenchmarkCase time_series_case { + TimeSeries::dataset, + std::string(FLS_CMAKE_SOURCE_DIR) + "/benchmark/result/compression_ratio/time_series/fastlanes.csv", + std::string(FLS_CMAKE_SOURCE_DIR) + "/benchmark/result/compression_ratio/time_series/fastlanes_detailed.csv"}; + void run_compression_ratio_benchmark(const BenchmarkCase& benchmark_case) { const auto& result_file_path = benchmark_case.result_file_path; const auto detailed_result_file_path = benchmark_case.detailed_result_file_path; diff --git a/benchmark/result/compression_ratio/time_series/compression_summary.csv b/benchmark/result/compression_ratio/time_series/compression_summary.csv new file mode 100644 index 00000000..b1d83b5e --- /dev/null +++ b/benchmark/result/compression_ratio/time_series/compression_summary.csv @@ -0,0 +1,6 @@ +table_name,version,csv_size,fls_size,compression_ratio +AMPds,0.1.4,2540627,363719,6.99 +Computer_Monitor,0.1.4,917528,57529,15.95 +Linear_Road,0.1.4,1290067,253407,5.09 +Smart_Gird,0.1.4,918847,250929,3.66 +Weather_Forcast,0.1.4,2595630,237159,10.94 diff --git a/benchmark/result/compression_ratio/time_series/fastlanes.csv b/benchmark/result/compression_ratio/time_series/fastlanes.csv new file mode 100644 index 00000000..555e0688 --- /dev/null +++ b/benchmark/result/compression_ratio/time_series/fastlanes.csv @@ -0,0 +1,6 @@ +table_name,version,file_size +AMPds,0.1.4,363719 +Computer_Monitor,0.1.4,57529 +Linear_Road,0.1.4,253407 +Smart_Gird,0.1.4,250929 +Weather_Forcast,0.1.4,237159 diff --git a/benchmark/result/compression_ratio/time_series/fastlanes_detailed.csv b/benchmark/result/compression_ratio/time_series/fastlanes_detailed.csv new file mode 100644 index 00000000..a26c86b4 --- /dev/null +++ b/benchmark/result/compression_ratio/time_series/fastlanes_detailed.csv @@ -0,0 +1,35 @@ +compression,version,table_name,id,name,data_type,size(bytes),expression,bytes_per_value,bits_per_value +FastLanes,0.1.4,AMPds,0,Column_1,DOUBLE,51665,"{[EXP_DICT_DBL_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.79,6.31 +FastLanes,0.1.4,AMPds,1,Column_2,DOUBLE,28726,"{[EXP_DICT_DBL_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.44,3.51 +FastLanes,0.1.4,AMPds,2,Column_3,DOUBLE,16744,"{[EXP_DICT_DBL_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.26,2.04 +FastLanes,0.1.4,AMPds,3,Column_4,DOUBLE,42400,"{[EXP_DICT_DBL_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.65,5.18 +FastLanes,0.1.4,AMPds,4,Column_5,DOUBLE,42542,"{[EXP_DICT_DBL_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.65,5.19 +FastLanes,0.1.4,AMPds,5,Column_6,INT16,52348,"{[EXP_DICT_I16_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.80,6.39 +FastLanes,0.1.4,AMPds,6,Column_7,INT8,17976,"{[EXP_FFOR_SLPATCH_I08][0, 1, 2, 3, 4, 5]}",0.27,2.19 +FastLanes,0.1.4,AMPds,7,Column_8,INT16,31412,"{[EXP_FFOR_SLPATCH_I16][0, 1, 2, 3, 4, 5]}",0.48,3.83 +FastLanes,0.1.4,AMPds,8,Column_9,INT8,8906,"{[EXP_DICT_I08_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.14,1.09 +FastLanes,0.1.4,AMPds,9,Column_10,INT16,52976,"{[EXP_DICT_I16_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.81,6.47 +FastLanes,0.1.4,AMPds,10,Column_11,INT8,17976,"{[EXP_FFOR_SLPATCH_I08][0, 1, 2, 3, 4, 5]}",0.27,2.19 +FastLanes,0.1.4,Computer_Monitor,0,Column_1,INT8,9476,"{[EXP_DICT_I08_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.14,1.16 +FastLanes,0.1.4,Computer_Monitor,1,Column_2,DOUBLE,23493,"{[EXP_DICT_DBL_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.36,2.87 +FastLanes,0.1.4,Computer_Monitor,2,Column_3,INT8,15046,"{[EXP_DICT_I08_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.23,1.84 +FastLanes,0.1.4,Computer_Monitor,3,Column_4,INT8,9466,"{[EXP_DICT_I08_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.14,1.16 +FastLanes,0.1.4,Linear_Road,0,Column_1,INT16,3748,"{[EXP_CROSS_RLE_I16][0, 1]}",0.06,0.46 +FastLanes,0.1.4,Linear_Road,1,Column_2,INT8,57728,"{[EXP_FFOR_I08][0, 1, 2]}",0.88,7.05 +FastLanes,0.1.4,Linear_Road,2,Column_3,INT8,1467,"{[EXP_FREQUENCY_I08][0, 1, 2, 3]}",0.02,0.18 +FastLanes,0.1.4,Linear_Road,3,Column_4,INT8,21614,"{[EXP_FFOR_SLPATCH_I08][0, 1, 2, 3, 4, 5]}",0.33,2.64 +FastLanes,0.1.4,Linear_Road,4,Column_5,INT8,11104,"{[EXP_DICT_I08_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.17,1.36 +FastLanes,0.1.4,Linear_Road,5,Column_6,INT32,157698,"{[EXP_FFOR_SLPATCH_I32][0, 1, 2, 3, 4, 5]}",2.41,19.25 +FastLanes,0.1.4,Smart_Gird,0,Column_1,DOUBLE,174196,"{[EXP_DICT_DBL_FFOR_U16][0, 1, 2, 3]}",2.66,21.26 +FastLanes,0.1.4,Smart_Gird,1,Column_2,INT8,8579,"{[EXP_DICT_I08_FFOR_U08][0, 1, 2, 3]}",0.13,1.05 +FastLanes,0.1.4,Smart_Gird,2,Column_3,INT8,33167,"{[EXP_DICT_I08_FFOR_U08][0, 1, 2, 3]}",0.51,4.05 +FastLanes,0.1.4,Smart_Gird,3,Column_4,INT8,27100,"{[EXP_RLE_I08_U16][0, 1, 2, 3, 4]}",0.41,3.31 +FastLanes,0.1.4,Smart_Gird,4,Column_5,INT8,7839,"{[EXP_CROSS_RLE_I08][0, 1]}",0.12,0.96 +FastLanes,0.1.4,Weather_Forcast,0,Column_1,INT8,22,"{[EXP_CROSS_RLE_I08][0, 1]}",0.00,0.00 +FastLanes,0.1.4,Weather_Forcast,1,Column_2,INT64,95312,"{[EXP_RLE_I64_U16][0, 1, 2, 3, 4]}",1.45,11.63 +FastLanes,0.1.4,Weather_Forcast,2,Column_3,INT8,6788,"{[EXP_DICT_I08_FFOR_U08][0, 1, 2, 3]}",0.10,0.83 +FastLanes,0.1.4,Weather_Forcast,3,Column_4,INT8,31633,"{[EXP_DICT_I08_FFOR_U08][0, 1, 2, 3]}",0.48,3.86 +FastLanes,0.1.4,Weather_Forcast,4,Column_5,INT8,38912,"{[EXP_FFOR_I08][0, 1, 2]}",0.59,4.75 +FastLanes,0.1.4,Weather_Forcast,5,Column_6,INT8,37888,"{[EXP_FFOR_I08][0, 1, 2]}",0.58,4.62 +FastLanes,0.1.4,Weather_Forcast,6,Column_7,DOUBLE,12463,"{[EXP_DICT_DBL_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.19,1.52 +FastLanes,0.1.4,Weather_Forcast,7,Column_7,INT8,14093,"{[EXP_DICT_I08_FFOR_SLPATCH_U08][0, 1, 2, 3, 4, 5, 6]}",0.22,1.72 diff --git a/benchmark/result/compression_time/time_series/fastlanes.csv b/benchmark/result/compression_time/time_series/fastlanes.csv new file mode 100644 index 00000000..2392963f --- /dev/null +++ b/benchmark/result/compression_time/time_series/fastlanes.csv @@ -0,0 +1,6 @@ +table_name,version,compression_time_ms,n_repetition +AMPds,0.1.4,64.601,1 +Computer_Monitor,0.1.4,21.5683,1 +Linear_Road,0.1.4,1232.85,1 +Smart_Gird,0.1.4,32.1722,1 +Weather_Forcast,0.1.4,41.9882,1 diff --git a/benchmark/result/decompression_time/time_series/fastlanes.csv b/benchmark/result/decompression_time/time_series/fastlanes.csv new file mode 100644 index 00000000..e7384784 --- /dev/null +++ b/benchmark/result/decompression_time/time_series/fastlanes.csv @@ -0,0 +1,6 @@ +table_name,version,decompression_time_ms,n_repetition +AMPds,0.1.4,71.3487,1000 +Computer_Monitor,0.1.4,18.7312,1000 +Linear_Road,0.1.4,24.1296,1000 +Smart_Gird,0.1.4,17.0261,1000 +Weather_Forcast,0.1.4,28.9171,1000 diff --git a/data/include/data/TimeSeries.hpp b/data/include/data/TimeSeries.hpp new file mode 100644 index 00000000..3494ebb9 --- /dev/null +++ b/data/include/data/TimeSeries.hpp @@ -0,0 +1,35 @@ +// ──────────────────────────────────────────────────────── +// | FastLanes | +// ──────────────────────────────────────────────────────── +// data/include/data/TimeSeries.hpp +// ──────────────────────────────────────────────────────── +#ifndef DATA_TIMESERIES_HPP +#define DATA_TIMESERIES_HPP + +#include +#include + +namespace fastlanes { + +using timeseries_dataset_t = std::array, 5>; + +// clang-format off +class TimeSeries { +public: + static constexpr std::string_view AMPds { FASTLANES_DATA_DIR "/time_series/tables/AMPds" }; + static constexpr std::string_view WEATHER_FORCAST { FASTLANES_DATA_DIR "/time_series/tables/Weather_Forcast" }; + static constexpr std::string_view SMART_GRID { FASTLANES_DATA_DIR "/time_series/tables/Smart_Grid" }; + static constexpr std::string_view LINEAR_ROEAD { FASTLANES_DATA_DIR "/time_series/tables/Linear_Road" }; + static constexpr std::string_view COMPUTER_MONITOR { FASTLANES_DATA_DIR "/time_series/tables/Computer_Monitor" }; + static constexpr timeseries_dataset_t dataset = {{ + { "AMPds", AMPds }, + { "Weather_Forcast", WEATHER_FORCAST }, + { "Smart_Grid", SMART_GRID }, + { "Linear_Road", LINEAR_ROEAD }, + { "Computer_Monitor", COMPUTER_MONITOR } + }}; +}; + +} // namespace fastlanes + +#endif // DATA_TIMESERIES_HPP diff --git a/data/include/data/fastlanes_data.hpp b/data/include/data/fastlanes_data.hpp index 6a64c066..5095a815 100644 --- a/data/include/data/fastlanes_data.hpp +++ b/data/include/data/fastlanes_data.hpp @@ -7,6 +7,7 @@ #define DATA_FASTLANES_DATA_HPP #include "data/NextiaJD.hpp" +#include "data/TimeSeries.hpp" #include "data/clickbench.hpp" #include "data/embedding.hpp" #include "data/example.hpp" diff --git a/test/src/dataset_tests/CMakeLists.txt b/test/src/dataset_tests/CMakeLists.txt index a2919d78..82e06fc2 100644 --- a/test/src/dataset_tests/CMakeLists.txt +++ b/test/src/dataset_tests/CMakeLists.txt @@ -5,6 +5,7 @@ add_executable( generated_data.cpp issues.cpp nextiajd_test.cpp + timeseries_test.cpp public_bi.cpp test_fc_bench.cpp tpch.cpp diff --git a/test/src/dataset_tests/timeseries_test.cpp b/test/src/dataset_tests/timeseries_test.cpp new file mode 100644 index 00000000..0e7dba0b --- /dev/null +++ b/test/src/dataset_tests/timeseries_test.cpp @@ -0,0 +1,28 @@ +// ──────────────────────────────────────────────────────── +// | FastLanes | +// ──────────────────────────────────────────────────────── +// test/src/dataset_tests/timeseries_test.cpp +// ──────────────────────────────────────────────────────── +#include "data/TimeSeries.hpp" +#include "fastlanes.hpp" +#include "fls_tester.hpp" + +namespace fastlanes { + +#define TIMESERIES_TEST(DATASET_VAR) \ + TEST_F(FastLanesReaderTester, TimeSeries_##DATASET_VAR) { \ + const std::vector constant_cols {}; \ + const std::vector equal_cols {}; \ + const std::vector one_to_one_mapped_col_indexes {}; \ + AllTest(TimeSeries::DATASET_VAR, constant_cols, equal_cols, one_to_one_mapped_col_indexes); \ + } + +TIMESERIES_TEST(SMART_GRID) +TIMESERIES_TEST(LINEAR_ROEAD) +TIMESERIES_TEST(COMPUTER_MONITOR) +TIMESERIES_TEST(AMPds) +TIMESERIES_TEST(WEATHER_FORCAST) + +#undef TIMESERIES_TEST + +} // namespace fastlanes diff --git a/test/src/quick_fuzz_tests/fuzz_config.json b/test/src/quick_fuzz_tests/fuzz_config.json index a9c7af5b..bddf02cc 100644 --- a/test/src/quick_fuzz_tests/fuzz_config.json +++ b/test/src/quick_fuzz_tests/fuzz_config.json @@ -1,6 +1,6 @@ { "num_cases": 10, - "base_seed": 13, + "base_seed": 14, "delimiter": "|", "min_cols": 1, "max_cols": 2,