Skip to content

Commit

Permalink
fix Udf() as named arg
Browse files Browse the repository at this point in the history
  • Loading branch information
nepal committed May 30, 2024
1 parent 662c126 commit 301360c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ydb/library/yql/sql/v1/sql_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ bool TSqlQuery::Statement(TVector<TNodePtr>& blocks, const TRule_sql_stmt_core&
for (size_t i = 0; i < names.size(); ++i) {
nodes.push_back(BuildSubqueryRef(blocks.back(), ref, names.size() == 1 ? -1 : i));
}
} else if (!Ctx.CompactNamedExprs) {
} else if (!Ctx.CompactNamedExprs || nodeExpr->GetUdfNode()) {
// Unlike other nodes, TUdfNode is not an independent node, but more like a set of parameters which should be
// applied on UDF call site. For example, TUdfNode can not be Translate()d
// So we can't add it to blocks and use reference, instead we store the TUdfNode itself as named node
// TODO: remove this special case
if (names.size() > 1) {
auto tupleRes = BuildTupleResult(nodeExpr, names.size());
for (size_t i = 0; i < names.size(); ++i) {
Expand Down

0 comments on commit 301360c

Please sign in to comment.