mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Merge pull request #9014 from amosbird/joingetfix2
Fix joinGet with nullable return types.
This commit is contained in:
commit
e0b6019878
@ -17,6 +17,10 @@ public:
|
||||
|
||||
static constexpr auto name = "joinGet";
|
||||
|
||||
bool useDefaultImplementationForNulls() const override { return false; }
|
||||
bool useDefaultImplementationForConstants() const override { return true; }
|
||||
bool useDefaultImplementationForLowCardinalityColumns() const override { return true; }
|
||||
|
||||
void execute(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) override;
|
||||
|
||||
String getName() const override { return name; }
|
||||
@ -72,6 +76,9 @@ public:
|
||||
FunctionBaseImplPtr build(const ColumnsWithTypeAndName & arguments, const DataTypePtr &) const override;
|
||||
DataTypePtr getReturnType(const ColumnsWithTypeAndName & arguments) const override;
|
||||
|
||||
bool useDefaultImplementationForNulls() const override { return false; }
|
||||
bool useDefaultImplementationForLowCardinalityColumns() const override { return true; }
|
||||
|
||||
bool isVariadic() const override { return true; }
|
||||
size_t getNumberOfArguments() const override { return 0; }
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
2 2
|
12
dbms/tests/queries/0_stateless/01080_join_get_null.sql
Normal file
12
dbms/tests/queries/0_stateless/01080_join_get_null.sql
Normal file
@ -0,0 +1,12 @@
|
||||
DROP TABLE IF EXISTS test_joinGet;
|
||||
DROP TABLE IF EXISTS test_join_joinGet;
|
||||
|
||||
CREATE TABLE test_joinGet(id Int32, user_id Nullable(Int32)) Engine = Memory();
|
||||
CREATE TABLE test_join_joinGet(user_id Int32, name String) Engine = Join(ANY, LEFT, user_id);
|
||||
|
||||
INSERT INTO test_join_joinGet VALUES (2, 'a'), (6, 'b'), (10, 'c');
|
||||
|
||||
SELECT 2 id, toNullable(toInt32(2)) user_id WHERE joinGet(test_join_joinGet, 'name', user_id) != '';
|
||||
|
||||
DROP TABLE test_joinGet;
|
||||
DROP TABLE test_join_joinGet;
|
Loading…
Reference in New Issue
Block a user