| 162 | } |
| 163 | |
| 164 | QueryPlanStepPtr BuildRuntimeFilterStep::deserialize(Deserialization & ctx) |
| 165 | { |
| 166 | if (ctx.input_headers.size() != 1) |
| 167 | throw Exception(ErrorCodes::INCORRECT_DATA, "BuildRuntimeFilterStep must have one input stream"); |
| 168 | |
| 169 | String filter_column_name; |
| 170 | readStringBinary(filter_column_name, ctx.in); |
| 171 | |
| 172 | DataTypePtr filter_column_type = decodeDataType(ctx.in); |
| 173 | |
| 174 | String filter_name; |
| 175 | readStringBinary(filter_name, ctx.in); |
| 176 | |
| 177 | bool allow_to_use_not_exact_filter = false; |
| 178 | readBinary(allow_to_use_not_exact_filter, ctx.in); |
| 179 | |
| 180 | const UInt64 exact_values_limit = ctx.settings[QueryPlanSerializationSetting::join_runtime_filter_exact_values_limit]; |
| 181 | const UInt64 bloom_filter_bytes = ctx.settings[QueryPlanSerializationSetting::join_runtime_bloom_filter_bytes]; |
| 182 | const UInt64 bloom_filter_hash_functions = ctx.settings[QueryPlanSerializationSetting::join_runtime_bloom_filter_hash_functions]; |
| 183 | const Float64 pass_ratio_threshold_for_disabling = ctx.settings[QueryPlanSerializationSetting::join_runtime_filter_pass_ratio_threshold_for_disabling]; |
| 184 | const Float64 blocks_to_skip_before_reenabling = static_cast<Float64>(ctx.settings[QueryPlanSerializationSetting::join_runtime_filter_blocks_to_skip_before_reenabling]); |
| 185 | const Float64 max_ratio_of_set_bits_in_bloom_filter = ctx.settings[QueryPlanSerializationSetting::join_runtime_bloom_filter_max_ratio_of_set_bits]; |
| 186 | |
| 187 | /// A deserialized step carries no random lookup key (it is never serialized); runtime filters are |
| 188 | /// re-derived per plan build. If such a step is ever executed, `finish()` no-ops on the empty key. |
| 189 | return std::make_unique<BuildRuntimeFilterStep>( |
| 190 | ctx.input_headers.front(), |
| 191 | std::move(filter_column_name), |
| 192 | filter_column_type, |
| 193 | std::move(filter_name), |
| 194 | /*filter_key_=*/String{}, |
| 195 | exact_values_limit, |
| 196 | bloom_filter_bytes, |
| 197 | bloom_filter_hash_functions, |
| 198 | pass_ratio_threshold_for_disabling, |
| 199 | blocks_to_skip_before_reenabling, |
| 200 | max_ratio_of_set_bits_in_bloom_filter, |
| 201 | allow_to_use_not_exact_filter); |
| 202 | } |
| 203 | |
| 204 | QueryPlanStepPtr BuildRuntimeFilterStep::clone() const |
| 205 | { |
nothing calls this directly
no test coverage detected