Merge pull request #30075 from kitaisreal/sql-user-defined-functions-fix-alias

SQL user defined functions fix alias
This commit is contained in:
Maksim Kita 2021-10-14 11:15:32 +03:00 committed by GitHub
commit 8d544a55b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View File

@ -93,6 +93,11 @@ ASTPtr UserDefinedSQLFunctionMatcher::tryToReplaceFunction(const ASTFunction & f
}
}
auto function_alias = function.tryGetAlias();
if (!function_alias.empty())
function_body_to_update->setAlias(function_alias);
return function_body_to_update;
}

View File

@ -0,0 +1 @@
a UInt16

View File

@ -0,0 +1,5 @@
-- Tags: no-parallel
CREATE FUNCTION 02096_test_function AS x -> x + 1;
DESCRIBE (SELECT 02096_test_function(1) AS a);
DROP FUNCTION 02096_test_function;