aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora-romanov <Anton.Romanov@ydb.tech>2023-04-28 13:00:09 +0300
committera-romanov <Anton.Romanov@ydb.tech>2023-04-28 13:00:09 +0300
commitf3b2c09e16a9c2faaf25e3fc928ae01b1e7fe566 (patch)
treef762596fbbf1afbeb0e3b6c1e44a567e26586f72
parent0227a413ca5d89bbeab941ee77c0832253066667 (diff)
downloadydb-f3b2c09e16a9c2faaf25e3fc928ae01b1e7fe566.tar.gz
Settings for dump node.
-rw-r--r--ydb/library/yql/ast/yql_expr.cpp43
1 files changed, 29 insertions, 14 deletions
diff --git a/ydb/library/yql/ast/yql_expr.cpp b/ydb/library/yql/ast/yql_expr.cpp
index 1ee199e1ce3..7f72763fc7a 100644
--- a/ydb/library/yql/ast/yql_expr.cpp
+++ b/ydb/library/yql/ast/yql_expr.cpp
@@ -52,23 +52,38 @@ namespace {
out << " <" << node.Content() << ">";
}
- if (node.GetTypeAnn()) {
- out << ", type: " << *node.GetTypeAnn();
+ constexpr bool WithTypes = false;
+ constexpr bool WithConstraints = false;
+ constexpr bool WithScope = false;
+
+ if constexpr (WithTypes) {
+ if (node.GetTypeAnn()) {
+ out << ", " << *node.GetTypeAnn();
+ }
}
- if (const auto scope = node.GetDependencyScope()) {
- out << ", outer lambda ";
- if (const auto outer = scope->first) {
- out << '#' << outer->UniqueId();
- } else {
- out << "null";
+ if constexpr (WithConstraints) {
+ if (node.GetState() >= TExprNode::EState::ConstrComplete) {
+ out << ", " << node.GetConstraintSet();
}
+ }
- out << ", inner lambda ";
- if (const auto inner = scope->second) {
- out << '#' << inner->UniqueId();
- } else {
- out << "null";
+ if constexpr (WithScope) {
+ if (const auto scope = node.GetDependencyScope()) {
+ out << ", (";
+ if (const auto outer = scope->first) {
+ out << '#' << outer->UniqueId();
+ } else {
+ out << "null";
+ }
+
+ out << ',';
+ if (const auto inner = scope->second) {
+ out << '#' << inner->UniqueId();
+ } else {
+ out << "null";
+ }
+ out << ')';
}
}
@@ -2937,7 +2952,7 @@ bool TDictExprType::Validate(TPosition position, TExprContext& ctx) const {
if (KeyType->IsComparableInternal()) {
return true;
- }
+ }
ctx.AddError(TIssue(position, TStringBuilder() << "Expected hashable and equatable or internally comparable dict key type, but got: " << *KeyType));
return false;