diff options
author | aozeritsky <aozeritsky@ydb.tech> | 2023-06-21 22:51:18 +0300 |
---|---|---|
committer | aozeritsky <aozeritsky@ydb.tech> | 2023-06-21 22:51:18 +0300 |
commit | d1973b2704359803d73aad8c1e1d7a193baa8205 (patch) | |
tree | d273b97f65bc4881de48688f71ce728fd7d7d975 | |
parent | 025e7323ef477503ca140a5fed444acb21785d94 (diff) | |
download | ydb-d1973b2704359803d73aad8c1e1d7a193baa8205.tar.gz |
Fix Code Style
-rw-r--r-- | ydb/library/yql/core/cbo/cbo_optimizer.cpp | 10 | ||||
-rw-r--r-- | ydb/library/yql/core/cbo/cbo_optimizer.h | 20 | ||||
-rw-r--r-- | ydb/library/yql/sql/pg/optimizer.cpp | 18 |
3 files changed, 24 insertions, 24 deletions
diff --git a/ydb/library/yql/core/cbo/cbo_optimizer.cpp b/ydb/library/yql/core/cbo/cbo_optimizer.cpp index 7ed787fe4d..3a755b4544 100644 --- a/ydb/library/yql/core/cbo/cbo_optimizer.cpp +++ b/ydb/library/yql/core/cbo/cbo_optimizer.cpp @@ -26,7 +26,7 @@ TStringBuf Prefix(int level) { void PrettyPrintVar(TStringBuilder& b, const IOptimizer::TOutput& output, IOptimizer::TVarId varId) { const auto& [relno, varno] = varId; auto varName = output.Input - ? output.Input->Rels[relno-1].TargetVars[varno-1].name + ? output.Input->Rels[relno-1].TargetVars[varno-1].Name : '\0'; if (!varName) { b << "(" << relno << "," << varno << ")"; @@ -39,13 +39,13 @@ void PrettyPrintNode(int level, TStringBuilder& b, const IOptimizer::TOutput& ou TStringBuf prefix = Prefix(level); const auto& node = output.Nodes[id]; switch (node.Mode) { - case IOptimizer::EJoinType::UNKNOWN: b << prefix << " Node\n"; break; - case IOptimizer::EJoinType::INNER: b << prefix << " Inner Join\n"; break; + case IOptimizer::EJoinType::Unknown: b << prefix << " Node\n"; break; + case IOptimizer::EJoinType::Inner: b << prefix << " Inner Join\n"; break; default: b << prefix << " Unknown\n"; break; } switch (node.Strategy) { - case IOptimizer::EJoinStrategy::HASH: b << prefix << " Hash Strategy\n"; break; - case IOptimizer::EJoinStrategy::LOOP: b << prefix << " Loop Strategy\n"; break; + case IOptimizer::EJoinStrategy::Hash: b << prefix << " Hash Strategy\n"; break; + case IOptimizer::EJoinStrategy::Loop: b << prefix << " Loop Strategy\n"; break; default: break; } if (!node.Rels.empty()) diff --git a/ydb/library/yql/core/cbo/cbo_optimizer.h b/ydb/library/yql/core/cbo/cbo_optimizer.h index fb1657c1d7..982dd1790a 100644 --- a/ydb/library/yql/core/cbo/cbo_optimizer.h +++ b/ydb/library/yql/core/cbo/cbo_optimizer.h @@ -11,12 +11,12 @@ struct IOptimizer { using TVarId = std::tuple<int, int>; struct TVar { - char name = 0; // debug name: 'a', 'b', 'c', ... + char Name = 0; // debug name: 'a', 'b', 'c', ... }; struct TRel { - double rows = 0; - double total_cost = 0; + double Rows = 0; + double TotalCost = 0; std::vector<TVar> TargetVars; }; @@ -31,19 +31,19 @@ struct IOptimizer { }; enum class EJoinType { - UNKNOWN, - INNER + Unknown, + Inner }; enum class EJoinStrategy { - UNKNOWN, - HASH, - LOOP + Unknown, + Hash, + Loop }; struct TJoinNode { - EJoinType Mode = EJoinType::UNKNOWN; - EJoinStrategy Strategy = EJoinStrategy::UNKNOWN; + EJoinType Mode = EJoinType::Unknown; + EJoinStrategy Strategy = EJoinStrategy::Unknown; // only a = b supported yet TVarId LeftVar = {}; TVarId RightVar = {}; diff --git a/ydb/library/yql/sql/pg/optimizer.cpp b/ydb/library/yql/sql/pg/optimizer.cpp index 6694e8a9e9..6837e4881d 100644 --- a/ydb/library/yql/sql/pg/optimizer.cpp +++ b/ydb/library/yql/sql/pg/optimizer.cpp @@ -61,9 +61,9 @@ Var* MakeVar(int varno, int relno) { RelOptInfo* MakeRelOptInfo(const IOptimizer::TRel& r, int relno) { RelOptInfo* rel = makeNode(RelOptInfo); - rel->rows = r.rows; - rel->tuples = r.rows; - rel->pages = r.rows; + rel->rows = r.Rows; + rel->tuples = r.Rows; + rel->pages = r.Rows; rel->allvisfrac = 1.0; rel->relid = relno; rel->amflags = 1.0; @@ -82,9 +82,9 @@ RelOptInfo* MakeRelOptInfo(const IOptimizer::TRel& r, int relno) { Path* p = makeNode(Path); p->pathtype = T_SeqScan; - p->rows = r.rows; + p->rows = r.Rows; p->startup_cost = 0; - p->total_cost = r.total_cost; + p->total_cost = r.TotalCost; p->pathtarget = t; p->parent = rel; @@ -185,12 +185,12 @@ int TPgOptimizer::MakeOutputJoin(TOutput& output, Path* path) { } if (path->type != T_Path) { - node.Mode = EJoinType::INNER; - node.Strategy = EJoinStrategy::UNKNOWN; + node.Mode = EJoinType::Inner; + node.Strategy = EJoinStrategy::Unknown; if (path->type == T_HashPath) { - node.Strategy = EJoinStrategy::HASH; + node.Strategy = EJoinStrategy::Hash; } else if (path->type == T_NestPath) { - node.Strategy = EJoinStrategy::LOOP; + node.Strategy = EJoinStrategy::Loop; } else { ythrow yexception() << "Uknown pathtype " << (int)path->type; } |