This commit is contained in:
Yarik Briukhovetskyi 2024-09-10 18:20:48 +02:00 committed by GitHub
parent a34a544f4a
commit caab4dd8b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 1 deletions

View File

@ -45,7 +45,7 @@ Chunk Squashing::squash(Chunk && input_chunk)
Chunk Squashing::add(Chunk && input_chunk)
{
if (!input_chunk)
if (!input_chunk || input_chunk.getNumRows() == 0)
return {};
/// Just read block is already enough.

View File

@ -0,0 +1,22 @@
DROP TABLE IF EXISTS id_values;
DROP TABLE IF EXISTS test_table;
CREATE TABLE id_values ENGINE MergeTree ORDER BY id1 AS
SELECT arrayJoin(range(1000000)) AS id1, arrayJoin(range(1000)) AS id2;
SET max_memory_usage = 1G;
CREATE TABLE test_table ENGINE MergeTree ORDER BY id AS
SELECT id_values.id1 AS id,
string_values.string_val1 AS string_val1,
string_values.string_val2 AS string_val2
FROM id_values
JOIN (SELECT arrayJoin(range(10)) AS id1,
'qwe' AS string_val1,
'asd' AS string_val2) AS string_values
ON id_values.id1 = string_values.id1
SETTINGS join_algorithm = 'hash';
DROP TABLE IF EXISTS id_values;
DROP TABLE IF EXISTS test_table;