diff options
author | zverevgeny <zverevgeny@ydb.tech> | 2023-09-07 09:27:49 +0300 |
---|---|---|
committer | zverevgeny <zverevgeny@ydb.tech> | 2023-09-07 10:41:07 +0300 |
commit | c4f7b41e89eea0f4d607e8a0ba7582e5cbdb7f6a (patch) | |
tree | f0c34a8c20a00f66f976fb7a4aaaad9a02620a2d | |
parent | caf33adab6af74ee539f0472d4204010671ea90a (diff) | |
download | ydb-c4f7b41e89eea0f4d607e8a0ba7582e5cbdb7f6a.tar.gz |
YQL-16325 rename enum according to style guide
-rw-r--r-- | ydb/library/yql/core/sql_types/match_recognize.h | 4 | ||||
-rw-r--r-- | ydb/library/yql/core/type_ann/type_ann_match_recognize.cpp | 6 | ||||
-rw-r--r-- | ydb/library/yql/minikql/mkql_program_builder.cpp | 14 |
3 files changed, 12 insertions, 12 deletions
diff --git a/ydb/library/yql/core/sql_types/match_recognize.h b/ydb/library/yql/core/sql_types/match_recognize.h index dc02eb0302..766bd4874f 100644 --- a/ydb/library/yql/core/sql_types/match_recognize.h +++ b/ydb/library/yql/core/sql_types/match_recognize.h @@ -11,13 +11,13 @@ namespace NYql::NMatchRecognize { constexpr size_t MaxPatternNesting = 20; //Limit recursion for patterns //Mixin columns for calculating measures -enum class MeasureInputDataSpecialColumns { +enum class EMeasureInputDataSpecialColumns { Classifier = 0, MatchNumber = 1, Last }; -inline TString MeasureInputDataSpecialColumnName(MeasureInputDataSpecialColumns c) { +inline TString MeasureInputDataSpecialColumnName(EMeasureInputDataSpecialColumns c) { return TString("_yql_") + ToString(c); } diff --git a/ydb/library/yql/core/type_ann/type_ann_match_recognize.cpp b/ydb/library/yql/core/type_ann/type_ann_match_recognize.cpp index 081d2209ca..018a944dc5 100644 --- a/ydb/library/yql/core/type_ann/type_ann_match_recognize.cpp +++ b/ydb/library/yql/core/type_ann/type_ann_match_recognize.cpp @@ -92,12 +92,12 @@ MatchRecognizeMeasuresWrapper(const TExprNode::TPtr& input, TExprNode::TPtr& out auto lambdaInputRowColumns = inputRowType->GetTypeAnn() ->Cast<TTypeExprType>()->GetType()->Cast<TStructExprType>()->GetItems(); - using NYql::NMatchRecognize::MeasureInputDataSpecialColumns; + using NYql::NMatchRecognize::EMeasureInputDataSpecialColumns; lambdaInputRowColumns.push_back(ctx.Expr.MakeType<TItemExprType>( - MeasureInputDataSpecialColumnName(MeasureInputDataSpecialColumns::Classifier), + MeasureInputDataSpecialColumnName(EMeasureInputDataSpecialColumns::Classifier), ctx.Expr.MakeType<TDataExprType>(EDataSlot::Utf8))); lambdaInputRowColumns.push_back(ctx.Expr.MakeType<TItemExprType>( - MeasureInputDataSpecialColumnName(MeasureInputDataSpecialColumns::MatchNumber), + MeasureInputDataSpecialColumnName(EMeasureInputDataSpecialColumns::MatchNumber), ctx.Expr.MakeType<TDataExprType>(EDataSlot::Uint64))); auto lambdaInputRowType = ctx.Expr.MakeType<TStructExprType>(lambdaInputRowColumns); const auto& matchedRowsRanges = GetMatchedRowsRangesType(pattern, ctx); diff --git a/ydb/library/yql/minikql/mkql_program_builder.cpp b/ydb/library/yql/minikql/mkql_program_builder.cpp index 9e8debac65..07a2841f3a 100644 --- a/ydb/library/yql/minikql/mkql_program_builder.cpp +++ b/ydb/library/yql/minikql/mkql_program_builder.cpp @@ -5850,30 +5850,30 @@ TRuntimeNode TProgramBuilder::MatchRecognizeCore( if (getMeasures.empty()) { measureInputDataArg = Arg(Env.GetTypeOfVoid()); } else { - using NYql::NMatchRecognize::MeasureInputDataSpecialColumns; + using NYql::NMatchRecognize::EMeasureInputDataSpecialColumns; measures.reserve(getMeasures.size()); measureTypes.reserve(getMeasures.size()); - specialColumnIndexesInMeasureInputDataRow.resize(static_cast<size_t>(NYql::NMatchRecognize::MeasureInputDataSpecialColumns::Last)); + specialColumnIndexesInMeasureInputDataRow.resize(static_cast<size_t>(NYql::NMatchRecognize::EMeasureInputDataSpecialColumns::Last)); TStructTypeBuilder measureInputDataRowTypeBuilder(Env); for (ui32 i = 0; i != inputRowType->GetMembersCount(); ++i) { measureInputDataRowTypeBuilder.Add(inputRowType->GetMemberName(i), inputRowType->GetMemberType(i)); } measureInputDataRowTypeBuilder.Add( - MeasureInputDataSpecialColumnName(MeasureInputDataSpecialColumns::Classifier), + MeasureInputDataSpecialColumnName(EMeasureInputDataSpecialColumns::Classifier), TDataType::Create(NUdf::TDataType<NYql::NUdf::TUtf8>::Id, Env) ); measureInputDataRowTypeBuilder.Add( - MeasureInputDataSpecialColumnName(MeasureInputDataSpecialColumns::MatchNumber), + MeasureInputDataSpecialColumnName(EMeasureInputDataSpecialColumns::MatchNumber), TDataType::Create(NUdf::TDataType<ui64>::Id, Env) ); const auto measureInputDataRowType = measureInputDataRowTypeBuilder.Build(); for (ui32 i = 0; i != measureInputDataRowType->GetMembersCount(); ++i) { //assume a few, if grows, it's better to use a lookup table here - static_assert(static_cast<size_t>(MeasureInputDataSpecialColumns::Last) < 5); - for (size_t j = 0; j != static_cast<size_t>(MeasureInputDataSpecialColumns::Last); ++j) { + static_assert(static_cast<size_t>(EMeasureInputDataSpecialColumns::Last) < 5); + for (size_t j = 0; j != static_cast<size_t>(EMeasureInputDataSpecialColumns::Last); ++j) { if (measureInputDataRowType->GetMemberName(i) == - NYql::NMatchRecognize::MeasureInputDataSpecialColumnName(static_cast<MeasureInputDataSpecialColumns>(j))) + NYql::NMatchRecognize::MeasureInputDataSpecialColumnName(static_cast<EMeasureInputDataSpecialColumns>(j))) specialColumnIndexesInMeasureInputDataRow[j] = NewDataLiteral<ui32>(i); } } |