Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYPE_MISMATCH exception for in operator with single column tuples. #49844

Merged
merged 1 commit into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Storages/MergeTree/KeyCondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ bool KeyCondition::tryPrepareSetIndex(
/// Note: in case of ActionsDAG, tuple may be a constant.
/// In this case, there is no keys in tuple. So, we don't have to check it.
auto left_arg_tuple = left_arg.toFunctionNode();
if (left_arg_tuple.getFunctionName() == "tuple")
if (left_arg_tuple.getFunctionName() == "tuple" && left_arg_tuple.getArgumentsSize() > 1)
{
left_args_count = left_arg_tuple.getArgumentsSize();
for (size_t i = 0; i < left_args_count; ++i)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2023-04-17 1
2023-04-17 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE test(`report_date` Date, `sspid` UInt64) ENGINE MergeTree PARTITION BY report_date ORDER BY report_date;

INSERT INTO test SELECT toDate('2023-04-20'), 0;
INSERT INTO test SELECT toDate('2023-04-19'), 0;
INSERT INTO test SELECT toDate('2023-04-17'), 1;
INSERT INTO test SELECT toDate('2023-04-17'), 1;


SELECT * FROM test WHERE tuple(report_date) IN tuple(toDate('2023-04-17'));
DROP TABLE test;