You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Argument at index 1 for function ilike must be constant: while executing. (ILLEGAL_COLUMN) #36279
CREATE TABLE test_local on cluster '{cluster}' (text String, text2 String) ENGINE = MergeTree() ORDER BY text;
CREATE TABLE test_distruted (text String, text2 String) ENGINE = Distributed('{cluster}', currentDatabase(), test_local);
INSERT INTO test_distruted SELECT randomString(100) as text, randomString(100) as tex2 from system.numbers limit 1;
SELECT COUNT() AS count
FROM test_distruted
INNER JOIN
(
SELECT text
FROM test_distruted
WHERE (text ILIKE '%text-for-search%') AND (text2 ILIKE '%text-for-search%')
) USING (text)
WHERE (text ILIKE '%text-for-search%') AND (text2 ILIKE '%text-for-search%')
Received exception from server (version 22.3.2):
Code: 44. DB::Exception: Received from xxx. DB::Exception: Argument at index 1 for function ilike must be constant: while executing 'FUNCTION ilike(text2 : 3, '%text-for-search%' : 0) -> ilike(text2, '%text-for-search%') UInt8 : 4'. (ILLEGAL_COLUMN)
Simple query - it works
SELECT text
FROM test_distruted
WHERE (text ILIKE '%text-for-search%') AND (text2 ILIKE '%text-for-search%')
Query id: 4960850f-6e27-4a10-a7a0-c9182fdf27ac
Ok.
0 rows in set. Elapsed: 0.010 sec.
if i change one of like expressions
like this - it works correctly
SELECT COUNT() AS count
FROM test_distruted
INNER JOIN
(
SELECT text
FROM test_distruted
WHERE (text ILIKE '%text-for-search%') AND (text2 ILIKE '%another-text%')
) USING (text)
WHERE (text ILIKE '%text-for-search%') AND (text2 ILIKE '%another-text%')
Query id: c37e4514-9d53-4cc6-9626-fee0ed0ae800
┌─count─┐
│ 0 │
└───────┘
1 rows in set. Elapsed: 0.013 sec.
Activity
orloffv commentedon Apr 14, 2022
if i change one of like expressions
like this - it works correctly
orloffv commentedon Apr 20, 2022
@vdimir do u know workaround or fix?
vdimir commentedon Apr 21, 2022
Sorry for delay, just started to work on it, investigating right now.
Workaround is
SET optimize_move_to_prewhere = 0;