Merge pull request #57033 from ClickHouse/fix-fuzzbits

Fix `fuzzBits` with `ARRAY JOIN`
This commit is contained in:
Antonio Andelic 2023-11-22 08:46:28 +01:00 committed by GitHub
commit 8c88dbe5aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View File

@ -84,6 +84,10 @@ public:
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t input_rows_count) const override
{
auto col_in_untyped = arguments[0].column;
if (input_rows_count == 0)
return col_in_untyped;
const double inverse_probability = assert_cast<const ColumnConst &>(*arguments[1].column).getValue<double>();
if (inverse_probability < 0.0 || 1.0 < inverse_probability)

View File

@ -0,0 +1,4 @@
12 1
12 2
100 1
100 2

View File

@ -0,0 +1,2 @@
SELECT length(fuzzBits('stringstring', 0.5)), a FROM numbers(1) ARRAY JOIN [1, 2] AS a;
SELECT length(fuzzBits('stringstring'::FixedString(100), 0.5)), a FROM numbers(1) ARRAY JOIN [1, 2] AS a