Browse Source

Restoring authorship annotation for <laplab@yandex-team.ru>. Commit 2 of 2.

laplab 3 years ago
parent
commit
9968a46231

+ 6 - 6
contrib/libs/antlr3_cpp_runtime/include/antlr3exception.inl

@@ -313,12 +313,12 @@ void ANTLR_Exception<ImplTraits, Ex, StreamType>::displayRecognitionError( ANTLR
 			// parse?
 			//
 			count   = 0;
-			size    = 0; 
-			if (BaseType::m_expectingSet != NULL) { 
-				std::unique_ptr<BitsetType> errBits(BaseType::m_expectingSet->bitsetLoad()); 
-				numbits = errBits->numBits(); 
-				size    = errBits->size(); 
-			} 
+			size    = 0;
+			if (BaseType::m_expectingSet != NULL) {
+				std::unique_ptr<BitsetType> errBits(BaseType::m_expectingSet->bitsetLoad());
+				numbits = errBits->numBits();
+				size    = errBits->size();
+			}
 
 			if  (size > 0)
 			{

+ 7 - 7
library/cpp/yson/detail.h

@@ -380,9 +380,9 @@ namespace NYson {
 
             void CheckMemoryLimit() {
                 if (MemoryLimit_ && Buffer_.capacity() > *MemoryLimit_) {
-                    ythrow TYsonException() 
-                        << "Memory limit exceeded while parsing YSON stream: allocated " 
-                        << Buffer_.capacity() << ", limit " << (*MemoryLimit_); 
+                    ythrow TYsonException()
+                        << "Memory limit exceeded while parsing YSON stream: allocated "
+                        << Buffer_.capacity() << ", limit " << (*MemoryLimit_);
                 }
             }
 
@@ -411,7 +411,7 @@ namespace NYson {
                         Buffer_.push_back(ch);
                         result = ENumericResult::Uint64;
                     } else if (isalpha(ch)) {
-                        ythrow TYsonException() << "Unexpected '" << ch << "' in numeric literal"; 
+                        ythrow TYsonException() << "Unexpected '" << ch << "' in numeric literal";
                     } else {
                         break;
                     }
@@ -531,7 +531,7 @@ namespace NYson {
 
                 i32 length = ZigZagDecode32(ulength);
                 if (length < 0) {
-                    ythrow TYsonException() << "Negative binary string literal length " << length; 
+                    ythrow TYsonException() << "Negative binary string literal length " << length;
                 }
 
                 if (TBaseStream::Begin() + length <= TBaseStream::End()) {
@@ -564,7 +564,7 @@ namespace NYson {
                 static TStringBuf falseString = "false";
 
                 auto throwIncorrectBoolean = [&]() {
-                    ythrow TYsonException() << "Incorrect boolean string " << TString(Buffer_.data(), Buffer_.size()); 
+                    ythrow TYsonException() << "Incorrect boolean string " << TString(Buffer_.data(), Buffer_.size());
                 };
 
                 Buffer_.push_back(TBaseStream::template GetChar<AllowFinish>());
@@ -637,7 +637,7 @@ namespace NYson {
             void SkipCharToken(char symbol) {
                 char ch = SkipSpaceAndGetChar();
                 if (ch != symbol) {
-                    ythrow TYsonException() << "Expected '" << symbol << "' but found '" << ch << "'"; 
+                    ythrow TYsonException() << "Expected '" << symbol << "' but found '" << ch << "'";
                 }
 
                 TBaseStream::Advance(1);

+ 4 - 4
library/cpp/yson/lexer_detail.h

@@ -196,7 +196,7 @@ namespace NYson {
                             }
                         } else { // None
                             Y_ASSERT(state == EReadStartCase::None);
-                            ythrow TYsonException() << "Unexpected " << ch1; 
+                            ythrow TYsonException() << "Unexpected " << ch1;
                         }
                     } else { // BinaryScalar = x01b
                         TBase::Advance(1);
@@ -243,19 +243,19 @@ namespace NYson {
                     try {
                         *token = TToken(FromString<double>(valueBuffer));
                     } catch (yexception&) {
-                        ythrow TYsonException() << "Error parsing double literal " << valueBuffer; 
+                        ythrow TYsonException() << "Error parsing double literal " << valueBuffer;
                     }
                 } else if (numericResult == ENumericResult::Int64) {
                     try {
                         *token = TToken(FromString<i64>(valueBuffer));
                     } catch (yexception&) {
-                        ythrow TYsonException() << "Error parsing int64 literal " << valueBuffer; 
+                        ythrow TYsonException() << "Error parsing int64 literal " << valueBuffer;
                     }
                 } else if (numericResult == ENumericResult::Uint64) {
                     try {
                         *token = TToken(FromString<ui64>(valueBuffer.SubStr(0, valueBuffer.size() - 1)));
                     } catch (yexception&) {
-                        ythrow TYsonException() << "Error parsing uint64 literal " << valueBuffer; 
+                        ythrow TYsonException() << "Error parsing uint64 literal " << valueBuffer;
                     }
                 }
             }

+ 11 - 11
library/cpp/yson/parser_detail.h

@@ -40,7 +40,7 @@ namespace NYson {
 
                 while (!(TBase::IsFinished() && TBase::IsEmpty())) {
                     if (TBase::template SkipSpaceAndGetChar<true>() != EndSymbol) {
-                        ythrow TYsonException() << "Stray '" << (*TBase::Begin()) << "' found"; 
+                        ythrow TYsonException() << "Stray '" << (*TBase::Begin()) << "' found";
                     } else if (!TBase::IsEmpty()) {
                         TBase::Advance(1);
                     }
@@ -163,7 +163,7 @@ namespace NYson {
                                 Consumer->OnDoubleScalar(TBase::template ReadNanOrInf<AllowFinish>());
                             }
                         } else {
-                            ythrow TYsonException() << "Unexpected '" << ch << "' while parsing node"; 
+                            ythrow TYsonException() << "Unexpected '" << ch << "' while parsing node";
                         }
                     }
                 }
@@ -195,7 +195,7 @@ namespace NYson {
                             TBase::ReadUnquotedString(&value);
                             Consumer->OnKeyedItem(value);
                         } else {
-                            ythrow TYsonException() << "Unexpected '" << ch << "' while parsing key"; 
+                            ythrow TYsonException() << "Unexpected '" << ch << "' while parsing key";
                         }
                     }
                 }
@@ -210,7 +210,7 @@ namespace NYson {
                     if (ch == KeyValueSeparatorSymbol) {
                         TBase::Advance(1);
                     } else {
-                        ythrow TYsonException() << "Expected '" << KeyValueSeparatorSymbol << "' but '" << ch << "' found"; 
+                        ythrow TYsonException() << "Expected '" << KeyValueSeparatorSymbol << "' but '" << ch << "' found";
                     }
                     ParseNode<AllowFinish>();
                     ch = TBase::template SkipSpaceAndGetChar<AllowFinish>();
@@ -218,8 +218,8 @@ namespace NYson {
                         TBase::Advance(1);
                         ch = TBase::template SkipSpaceAndGetChar<AllowFinish>();
                     } else if (ch != endSymbol) {
-                        ythrow TYsonException() << "Expected '" << KeyedItemSeparatorSymbol 
-                                                << "' or '" << endSymbol << "' but '" << ch << "' found"; 
+                        ythrow TYsonException() << "Expected '" << KeyedItemSeparatorSymbol
+                                                << "' or '" << endSymbol << "' but '" << ch << "' found";
                     }
                 }
             }
@@ -246,8 +246,8 @@ namespace NYson {
                     TBase::Advance(1);
                     return true;
                 } else if (ch != endSymbol) {
-                    ythrow TYsonException() << "Expected '" << ListItemSeparatorSymbol 
-                                            << "' or '" << endSymbol << "' but '" << ch << "' found"; 
+                    ythrow TYsonException() << "Expected '" << ListItemSeparatorSymbol
+                                            << "' or '" << endSymbol << "' but '" << ch << "' found";
                 }
                 return false;
             }
@@ -273,7 +273,7 @@ namespace NYson {
                         value = FromString<double>(valueBuffer);
                     } catch (yexception& e) {
                         // This exception is wrapped in parser.
-                        ythrow TYsonException() << "Failed to parse double literal '" << valueBuffer << "'" << e; 
+                        ythrow TYsonException() << "Failed to parse double literal '" << valueBuffer << "'" << e;
                     }
                     Consumer->OnDoubleScalar(value);
                 } else if (numericResult == ENumericResult::Int64) {
@@ -282,7 +282,7 @@ namespace NYson {
                         value = FromString<i64>(valueBuffer);
                     } catch (yexception& e) {
                         // This exception is wrapped in parser.
-                        ythrow TYsonException() << "Failed to parse int64 literal '" << valueBuffer << "'" << e; 
+                        ythrow TYsonException() << "Failed to parse int64 literal '" << valueBuffer << "'" << e;
                     }
                     Consumer->OnInt64Scalar(value);
                 } else if (numericResult == ENumericResult::Uint64) {
@@ -291,7 +291,7 @@ namespace NYson {
                         value = FromString<ui64>(valueBuffer.SubStr(0, valueBuffer.size() - 1));
                     } catch (yexception& e) {
                         // This exception is wrapped in parser.
-                        ythrow TYsonException() << "Failed to parse uint64 literal '" << valueBuffer << "'" << e; 
+                        ythrow TYsonException() << "Failed to parse uint64 literal '" << valueBuffer << "'" << e;
                     }
                     Consumer->OnUint64Scalar(value);
                 }

+ 4 - 4
library/cpp/yson/token.cpp

@@ -188,11 +188,11 @@ namespace NYson {
     void TToken::CheckType(ETokenType expectedType) const {
         if (Type_ != expectedType) {
             if (Type_ == ETokenType::EndOfStream) {
-                ythrow TYsonException() << "Unexpected end of stream (ExpectedType: " << TokenTypeToString(expectedType) << ")"; 
+                ythrow TYsonException() << "Unexpected end of stream (ExpectedType: " << TokenTypeToString(expectedType) << ")";
             } else {
-                ythrow TYsonException() << "Unexpected token (Token: '" << ToString(*this) 
-                                        << "', Type: " << TokenTypeToString(Type_) 
-                                        << ", ExpectedType: " << TokenTypeToString(expectedType) << ")"; 
+                ythrow TYsonException() << "Unexpected token (Token: '" << ToString(*this)
+                                        << "', Type: " << TokenTypeToString(Type_)
+                                        << ", ExpectedType: " << TokenTypeToString(expectedType) << ")";
             }
         }
     }

+ 4 - 4
ydb/core/client/server/msgbus_server_db.cpp

@@ -370,10 +370,10 @@ public:
             return pgmBuilder.NewDataLiteral<NUdf::EDataSlot::Yson>(jsonValue.GetString());
         case NScheme::NTypeIds::Json:
             return pgmBuilder.NewDataLiteral<NUdf::EDataSlot::Json>(jsonValue.GetString());
-        case NScheme::NTypeIds::JsonDocument: 
-            return pgmBuilder.NewDataLiteral<NUdf::EDataSlot::JsonDocument>(jsonValue.GetString()); 
-        case NScheme::NTypeIds::DyNumber: 
-            return pgmBuilder.NewDataLiteral<NUdf::EDataSlot::DyNumber>(jsonValue.GetString()); 
+        case NScheme::NTypeIds::JsonDocument:
+            return pgmBuilder.NewDataLiteral<NUdf::EDataSlot::JsonDocument>(jsonValue.GetString());
+        case NScheme::NTypeIds::DyNumber:
+            return pgmBuilder.NewDataLiteral<NUdf::EDataSlot::DyNumber>(jsonValue.GetString());
         default:
             // still better than VERIFY
             return pgmBuilder.NewEmptyOptionalDataLiteral(typeId);

+ 12 - 12
ydb/core/engine/mkql_proto.cpp

@@ -51,10 +51,10 @@ namespace {
                 return NUdf::TUnboxedValuePod(value.uint64_value());
             case NUdf::TDataType<NUdf::TInterval>::Id:
                 return NUdf::TUnboxedValuePod(value.int64_value());
-            case NUdf::TDataType<NUdf::TJsonDocument>::Id: 
-                return ValueFromString(NUdf::EDataSlot::JsonDocument, value.text_value()); 
-            case NUdf::TDataType<NUdf::TDyNumber>::Id: 
-                return ValueFromString(NUdf::EDataSlot::DyNumber, value.text_value()); 
+            case NUdf::TDataType<NUdf::TJsonDocument>::Id:
+                return ValueFromString(NUdf::EDataSlot::JsonDocument, value.text_value());
+            case NUdf::TDataType<NUdf::TDyNumber>::Id:
+                return ValueFromString(NUdf::EDataSlot::DyNumber, value.text_value());
             default:
                 return MakeString(value.bytes_value());
         }
@@ -302,12 +302,12 @@ bool CellsFromTuple(const NKikimrMiniKQL::TType* tupleType,
             c = TCell(v.GetText().data(), v.GetText().size());
             break;
         }
-        case NScheme::NTypeIds::JsonDocument: 
-        case NScheme::NTypeIds::DyNumber: 
-        { 
-            c = TCell(v.GetBytes().data(), v.GetBytes().size()); 
-            break; 
-        } 
+        case NScheme::NTypeIds::JsonDocument:
+        case NScheme::NTypeIds::DyNumber:
+        {
+            c = TCell(v.GetBytes().data(), v.GetBytes().size());
+            break;
+        }
         case NScheme::NTypeIds::String:
         {
             if (v.HasBytes()) {
@@ -407,9 +407,9 @@ bool CellToValue(NScheme::TTypeId typeId, const TCell& c, NKikimrMiniKQL::TValue
         val.MutableOptional()->SetInt64(ReadUnaligned<i64>(c.Data()));
         break;
 
-    case NScheme::NTypeIds::JsonDocument: 
+    case NScheme::NTypeIds::JsonDocument:
     case NScheme::NTypeIds::String:
-    case NScheme::NTypeIds::DyNumber: 
+    case NScheme::NTypeIds::DyNumber:
         val.MutableOptional()->SetBytes(c.Data(), c.Size());
         break;
 

+ 21 - 21
ydb/core/grpc_services/rpc_load_rows.cpp

@@ -12,7 +12,7 @@
 
 #include <ydb/library/binary_json/write.h>
 #include <ydb/library/dynumber/dynumber.h>
- 
+
 #include <util/string/vector.h>
 #include <util/generic/size_literals.h>
 
@@ -225,26 +225,26 @@ private:
                 c = TCell(v.data(), v.size());
                 break;
             }
-        case NScheme::NTypeIds::JsonDocument : { 
-            const auto binaryJson = NBinaryJson::SerializeToBinaryJson(val.Gettext_value()); 
-            if (!binaryJson.Defined()) { 
-                err = "Invalid JSON for JsonDocument provided"; 
-                return false; 
-            } 
-            const auto binaryJsonInPool = valueDataPool.AppendString(TStringBuf(binaryJson->Data(), binaryJson->Size())); 
-            c = TCell(binaryJsonInPool.data(), binaryJsonInPool.size()); 
-            break; 
-        } 
-        case NScheme::NTypeIds::DyNumber : { 
-            const auto dyNumber = NDyNumber::ParseDyNumberString(val.Gettext_value()); 
-            if (!dyNumber.Defined()) { 
-                err = "Invalid DyNumber string representation"; 
-                return false; 
-            } 
-            const auto dyNumberInPool = valueDataPool.AppendString(TStringBuf(*dyNumber)); 
-            c = TCell(dyNumberInPool.data(), dyNumberInPool.size()); 
-            break; 
-        } 
+        case NScheme::NTypeIds::JsonDocument : {
+            const auto binaryJson = NBinaryJson::SerializeToBinaryJson(val.Gettext_value());
+            if (!binaryJson.Defined()) {
+                err = "Invalid JSON for JsonDocument provided";
+                return false;
+            }
+            const auto binaryJsonInPool = valueDataPool.AppendString(TStringBuf(binaryJson->Data(), binaryJson->Size()));
+            c = TCell(binaryJsonInPool.data(), binaryJsonInPool.size());
+            break;
+        }
+        case NScheme::NTypeIds::DyNumber : {
+            const auto dyNumber = NDyNumber::ParseDyNumberString(val.Gettext_value());
+            if (!dyNumber.Defined()) {
+                err = "Invalid DyNumber string representation";
+                return false;
+            }
+            const auto dyNumberInPool = valueDataPool.AppendString(TStringBuf(*dyNumber));
+            c = TCell(dyNumberInPool.data(), dyNumberInPool.size());
+            break;
+        }
         case NScheme::NTypeIds::Yson :
         case NScheme::NTypeIds::String : {
                 TString v = val.Getbytes_value();

+ 10 - 10
ydb/core/kqp/compile/kqp_compile.cpp

@@ -196,7 +196,7 @@ void FillReadRanges(const TReader& read, const TKikimrTableMetadata& tableMeta,
     readProto.SetReverse(settings.Reverse);
 }
 
-template <typename TEffectCallable, typename TEffectProto> 
+template <typename TEffectCallable, typename TEffectProto>
 void FillEffectRows(const TEffectCallable& callable, TEffectProto& proto, bool inplace) {
     if (auto maybeList = callable.Input().template Maybe<TCoIterator>().List()) {
         if (auto maybeParam = maybeList.Cast().template Maybe<TCoParameter>()) {
@@ -491,15 +491,15 @@ private:
                 FillTable(upsertRows.Table(), *tableOp.MutableTable());
                 FillColumns(upsertRows.Columns(), *tableMeta, tableOp, false);
                 FillEffectRows(upsertRows, *tableOp.MutableUpsertRows(), settings.Inplace);
-            } else if (auto maybeDeleteRows = node.Maybe<TKqpDeleteRows>()) { 
-                auto deleteRows = maybeDeleteRows.Cast(); 
-                auto tableMeta = TablesData->ExistingTable(Cluster, deleteRows.Table().Path()).Metadata; 
-                YQL_ENSURE(tableMeta); 
- 
-                YQL_ENSURE(stageProto.GetIsEffectsStage()); 
- 
-                auto& tableOp = *stageProto.AddTableOps(); 
-                FillTable(deleteRows.Table(), *tableOp.MutableTable()); 
+            } else if (auto maybeDeleteRows = node.Maybe<TKqpDeleteRows>()) {
+                auto deleteRows = maybeDeleteRows.Cast();
+                auto tableMeta = TablesData->ExistingTable(Cluster, deleteRows.Table().Path()).Metadata;
+                YQL_ENSURE(tableMeta);
+
+                YQL_ENSURE(stageProto.GetIsEffectsStage());
+
+                auto& tableOp = *stageProto.AddTableOps();
+                FillTable(deleteRows.Table(), *tableOp.MutableTable());
                 FillEffectRows(deleteRows, *tableOp.MutableDeleteRows(), false);
             } else if (auto maybeWideReadTableRanges = node.Maybe<TKqpWideReadTableRanges>()) {
                 auto readTableRanges = maybeWideReadTableRanges.Cast();

+ 10 - 10
ydb/core/kqp/compile/kqp_mkql_compiler.cpp

@@ -320,21 +320,21 @@ TIntrusivePtr<IMkqlCallableCompiler> CreateKqlCompiler(const TKqlCompileContext&
             return result;
         });
 
-    compiler->AddCallable(TKqpDeleteRows::CallableName(), 
-        [&ctx](const TExprNode& node, TMkqlBuildContext& buildCtx) { 
-            TKqpDeleteRows deleteRows(&node); 
- 
+    compiler->AddCallable(TKqpDeleteRows::CallableName(),
+        [&ctx](const TExprNode& node, TMkqlBuildContext& buildCtx) {
+            TKqpDeleteRows deleteRows(&node);
+
             const auto& tableMeta = ctx.GetTableMeta(deleteRows.Table());
 
             auto rowsType = deleteRows.Input().Ref().GetTypeAnn()->Cast<TStreamExprType>();
             ValidateColumnsType(rowsType, tableMeta);
 
-            const auto tableId = MakeTableId(deleteRows.Table()); 
-            const auto rows = MkqlBuildExpr(deleteRows.Input().Ref(), buildCtx); 
- 
-            return ctx.PgmBuilder().KqpDeleteRows(tableId, rows); 
-        }); 
- 
+            const auto tableId = MakeTableId(deleteRows.Table());
+            const auto rows = MkqlBuildExpr(deleteRows.Input().Ref(), buildCtx);
+
+            return ctx.PgmBuilder().KqpDeleteRows(tableId, rows);
+        });
+
     compiler->AddCallable(TKqpEffects::CallableName(),
         [&ctx](const TExprNode& node, TMkqlBuildContext& buildCtx) {
             std::vector<TRuntimeNode> args;

Some files were not shown because too many files changed in this diff