| 140 | } |
| 141 | |
| 142 | StatisticsBasePtr createStatisticsBase(StatisticsTag tag, std::string_view blob) |
| 143 | { |
| 144 | // TODO: rewrite use macro iteration |
| 145 | auto ptr = [&]() -> StatisticsBasePtr { |
| 146 | switch (tag) |
| 147 | { |
| 148 | case StatisticsTag::DummyAlpha: |
| 149 | return createStatisticsUntyped<StatsDummyAlpha>(tag, blob); |
| 150 | case StatisticsTag::DummyBeta: |
| 151 | return createStatisticsUntyped<StatsDummyBeta>(tag, blob); |
| 152 | case StatisticsTag::TableBasic: |
| 153 | return createStatisticsUntyped<StatsTableBasic>(tag, blob); |
| 154 | case StatisticsTag::ColumnBasic: |
| 155 | return createStatisticsUntyped<StatsColumnBasic>(tag, blob); |
| 156 | case StatisticsTag::HllSketch: |
| 157 | return createStatisticsUntyped<StatsHllSketch>(tag, blob); |
| 158 | case StatisticsTag::KllSketch: |
| 159 | return createStatisticsTyped<StatsKllSketch>(tag, blob); |
| 160 | case StatisticsTag::NdvBuckets: |
| 161 | return createStatisticsTyped<StatsNdvBuckets>(tag, blob); |
| 162 | case StatisticsTag::NdvBucketsExtend: |
| 163 | return createStatisticsTyped<StatsNdvBucketsExtend>(tag, blob); |
| 164 | case StatisticsTag::NdvBucketsResult: |
| 165 | return createStatisticsTyped<StatsNdvBucketsResult>(tag, blob); |
| 166 | default: { |
| 167 | // unknonw statistics should be ignored instead of throw Exception |
| 168 | return nullptr; |
| 169 | } |
| 170 | } |
| 171 | }(); |
| 172 | |
| 173 | return ptr; |
| 174 | } |
| 175 | StatisticsBasePtr createStatisticsBaseFromJson(StatisticsTag tag, std::string_view blob) |
| 176 | { |
| 177 | auto ptr = [&]() -> StatisticsBasePtr { |
no outgoing calls
no test coverage detected