Skip to content

Commit 301360c

Browse files
committed
fix Udf() as named arg
1 parent 662c126 commit 301360c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ydb/library/yql/sql/v1/sql_query.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ bool TSqlQuery::Statement(TVector<TNodePtr>& blocks, const TRule_sql_stmt_core&
178178
for (size_t i = 0; i < names.size(); ++i) {
179179
nodes.push_back(BuildSubqueryRef(blocks.back(), ref, names.size() == 1 ? -1 : i));
180180
}
181-
} else if (!Ctx.CompactNamedExprs) {
181+
} else if (!Ctx.CompactNamedExprs || nodeExpr->GetUdfNode()) {
182+
// Unlike other nodes, TUdfNode is not an independent node, but more like a set of parameters which should be
183+
// applied on UDF call site. For example, TUdfNode can not be Translate()d
184+
// So we can't add it to blocks and use reference, instead we store the TUdfNode itself as named node
185+
// TODO: remove this special case
182186
if (names.size() > 1) {
183187
auto tupleRes = BuildTupleResult(nodeExpr, names.size());
184188
for (size_t i = 0; i < names.size(); ++i) {

0 commit comments

Comments
 (0)