forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dictGet arguments check during GROUP BY injective functions elimi…
…nation This patch changes the place where the dictionary will be loaded (during syntax analysis), but I guess this is fine, it will be loaded anyway. Fixes: ClickHouse#10342
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/queries/0_stateless/01376_GROUP_BY_injective_elimination_dictGet.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.1 |
31 changes: 31 additions & 0 deletions
31
tests/queries/0_stateless/01376_GROUP_BY_injective_elimination_dictGet.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
-- https://github.com/ClickHouse/ClickHouse/issues/11469 | ||
SELECT dictGet('default.countryId', 'country', toUInt64(number)) AS country FROM numbers(2) GROUP BY country; -- { serverError 36; } | ||
|
||
|
||
-- with real dictionary | ||
DROP TABLE IF EXISTS dictdb_01376.table_for_dict; | ||
DROP DICTIONARY IF EXISTS dictdb_01376.dict_exists; | ||
DROP DATABASE IF EXISTS dictdb_01376; | ||
|
||
CREATE DATABASE dictdb_01376 ENGINE = Ordinary; | ||
|
||
CREATE TABLE dictdb_01376.table_for_dict | ||
( | ||
key_column UInt64, | ||
value Float64 | ||
) | ||
ENGINE = Memory(); | ||
|
||
INSERT INTO dictdb_01376.table_for_dict VALUES (1, 1.1); | ||
|
||
CREATE DICTIONARY IF NOT EXISTS dictdb_01376.dict_exists | ||
( | ||
key_column UInt64, | ||
value Float64 DEFAULT 77.77 | ||
) | ||
PRIMARY KEY key_column | ||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE 'table_for_dict' DB 'dictdb_01376')) | ||
LIFETIME(1) | ||
LAYOUT(FLAT()); | ||
|
||
SELECT dictGet('dictdb_01376.dict_exists', 'value', toUInt64(1)) as val FROM numbers(2) GROUP BY val; |