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

Added failing test #24404 #26179

Merged
merged 3 commits into from Jul 10, 2021
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
7 changes: 1 addition & 6 deletions src/Interpreters/ActionsVisitor.cpp
Expand Up @@ -686,7 +686,7 @@ ASTs ActionsMatcher::doUntuple(const ASTFunction * function, ActionsMatcher::Dat

ASTs columns;
size_t tid = 0;
for (const auto & name : tuple_type->getElementNames())
for (const auto & name [[maybe_unused]] : tuple_type->getElementNames())
{
auto tuple_ast = function->arguments->children[0];
if (tid != 0)
Expand All @@ -697,11 +697,6 @@ ASTs ActionsMatcher::doUntuple(const ASTFunction * function, ActionsMatcher::Dat

auto func = makeASTFunction("tupleElement", tuple_ast, literal);

if (tuple_type->haveExplicitNames())
func->setAlias(name);
else
func->setAlias(data.getUniqueName("_ut_" + name));

auto function_builder = FunctionFactory::instance().get(func->name, data.getContext());
data.addFunction(function_builder, {tuple_name_type->name, literal->getColumnName(data.getContext()->getSettingsRef())}, func->getColumnName(data.getContext()->getSettingsRef()));

Expand Down
2 changes: 1 addition & 1 deletion tests/queries/0_stateless/01232_untuple.reference
Expand Up @@ -2,7 +2,7 @@
hello 1 3 world
9
9 (0,1)
key v1 v2 v3 v4 v5
key tupleElement(argMax(tuple(v1, v2, v3, v4, v5), v1), 1) tupleElement(argMax(tuple(v1, v2, v3, v4, v5), v1), 2) tupleElement(argMax(tuple(v1, v2, v3, v4, v5), v1), 3) tupleElement(argMax(tuple(v1, v2, v3, v4, v5), v1), 4) tupleElement(argMax(tuple(v1, v2, v3, v4, v5), v1), 5)
4 10 20 10 20 30
3 70 20 10 20 30
2 11 20 10 20 30
Expand Down
@@ -1 +1 @@
1
1 2
2 changes: 1 addition & 1 deletion tests/queries/0_stateless/01616_untuple_access_field.sql
@@ -1 +1 @@
select _ut_1 from (select untuple((1,2)));
select * from (select untuple((1,2)));
@@ -0,0 +1 @@
100.0000991821289 \N \N 1 1024 \N
@@ -0,0 +1 @@
SELECT untuple(tuple(100.0000991821289)), NULL, untuple((toDateTime(9223372036854775806, -1, NULL, NULL, toDateTime(NULL, NULL)), * EXCEPT b)), NULL FROM (SELECT 1 AS a, 1024, NULL AS b);