Repository navigation
Conversation
|
Workflow [PR], commit [371e061] Summary: ❌
AI ReviewSummaryThis PR updates logical join planning so Tests
Final Verdict
|
LLVM Coverage Report
Changed lines: 93.33% (14/15) | lost baseline coverage: 1 line(s) · Uncovered code |
8c78a28 to
04b1439
Compare
| ) | ||
| WHERE explain LIKE '%Algorithm:%'; | ||
|
|
||
| -- LowCardinality(Nullable(String)) PK: exercises the recursive |
There was a problem hiding this comment.
This test still misses the nullable-mismatch path from the previous thread: left key Nullable(String) joined to storage PK LowCardinality(String).
That is the case where predicateOperandsToCommonType must force a right-side cast so we do not keep DirectKeyValueJoin; otherwise StorageEmbeddedRocksDB::getByKeys serializes nullable lookup bytes and non-null keys can miss.
Please add a focused regression here that makes the left key nullable against rdb_lc_pk and asserts both correctness of rows and that EXPLAIN does not pick Algorithm: DirectKeyValueJoin for this case.
|
Actually, I don't think we can simply ignore ClickHouse/src/Storages/RocksDB/StorageEmbeddedRocksDB.cpp Lines 913 to 915 in 43e37f6 other storages do not. For example, KeeperMap returns incorrect results if we disable So forcing a regular hash join in such cases (as happens with #!/usr/bin/env -S ${HOME}/clickhouse client --queries-file
SET query_plan_use_new_logical_join_step = 0;
DROP TABLE IF EXISTS rdb_lc_pk;
DROP TABLE IF EXISTS t_str_right;
CREATE TABLE rdb_lc_pk (key LowCardinality(String), value String)
-- ENGINE = EmbeddedRocksDB PRIMARY KEY (key);
Engine = KeeperMap('/' || currentDatabase() || '/repro_km_getbykeys') PRIMARY KEY (key);
INSERT INTO rdb_lc_pk VALUES ('a', 'A'), ('b', 'B'), ('c', 'C');
CREATE TABLE t_str_right (k String) ENGINE = TinyLog;
INSERT INTO t_str_right VALUES ('a'), ('b'), ('c'), ('d');
SELECT count() FROM (
SELECT key, value FROM (SELECT k AS key FROM t_str_right) AS t
INNER JOIN rdb_lc_pk USING (key)
) WHERE ignore(*) = 0;
SELECT trim(explain) FROM (
EXPLAIN actions = 1
SELECT key, value FROM (SELECT k AS key FROM t_str_right) AS t
INNER JOIN rdb_lc_pk USING (key)
)
WHERE explain LIKE '%Algorithm:%';
DROP TABLE IF EXISTS rdb_lc_pk;
DROP TABLE IF EXISTS t_str_right;
|
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...