Implement untuple field access (#18309)

This commit is contained in:
hexiaoting 2020-12-22 21:48:40 +08:00 committed by GitHub
parent 5fd6f260ac
commit 93d28ef5c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

View File

@ -286,6 +286,17 @@ void removeUnneededColumnsFromSelectClause(const ASTSelectQuery * select_query,
{
new_elements.push_back(elem);
}
else
{
ASTFunction * func = elem->as<ASTFunction>();
if (func && func->name == "untuple")
for (const auto & col : required_result_columns)
if (col.rfind("_ut_", 0) == 0)
{
new_elements.push_back(elem);
break;
}
}
}
elements = std::move(new_elements);

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1 @@
select _ut_1 from (select untuple((1,2)));