diff options
author | nadya73 <nadya73@yandex-team.com> | 2024-07-30 13:16:23 +0300 |
---|---|---|
committer | nadya73 <nadya73@yandex-team.com> | 2024-07-30 14:12:09 +0300 |
commit | cb13057a00bee6a4c0dd414b44686d3ee5680cba (patch) | |
tree | 18e155bfc7b614a922f5f3640d8d984579267a11 /contrib/libs | |
parent | d7d99122c63ecaa60d07f3eea7589512ff729aec (diff) | |
download | ydb-cb13057a00bee6a4c0dd414b44686d3ee5680cba.tar.gz |
[yt/cpp/mapreduce]Fix build with system protoc, std::string and system stl
Fix build with system protoc, std::string and system stl
8b5b81b2d7855f6b0dcb4bb0583a6408e5b7d3f7
Diffstat (limited to 'contrib/libs')
-rw-r--r-- | contrib/libs/apache/orc/c++/src/Reader.cc | 8 | ||||
-rw-r--r-- | contrib/libs/apache/orc/c++/src/Statistics.hh | 12 | ||||
-rw-r--r-- | contrib/libs/apache/orc/c++/src/Writer.cc | 12 | ||||
-rw-r--r-- | contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc | 8 |
4 files changed, 22 insertions, 18 deletions
diff --git a/contrib/libs/apache/orc/c++/src/Reader.cc b/contrib/libs/apache/orc/c++/src/Reader.cc index 2cc88fbb80..0586918d80 100644 --- a/contrib/libs/apache/orc/c++/src/Reader.cc +++ b/contrib/libs/apache/orc/c++/src/Reader.cc @@ -565,7 +565,7 @@ namespace orc { mutableFooter->CopyFrom(*footer); tail.set_file_length(fileLength); tail.set_postscript_length(postscriptLength); - TString result; + TProtoStringType result; if (!tail.SerializeToString(&result)) { throw ParseError("Failed to serialize file tail"); } @@ -691,7 +691,7 @@ namespace orc { std::string ReaderImpl::getMetadataValue(const std::string& key) const { for (int i = 0; i < footer->metadata_size(); ++i) { - if (footer->metadata(i).name() == TString(key)) { + if (footer->metadata(i).name() == TProtoStringType(key)) { return footer->metadata(i).value(); } } @@ -741,7 +741,7 @@ namespace orc { bool ReaderImpl::hasMetadataValue(const std::string& key) const { for (int i = 0; i < footer->metadata_size(); ++i) { - if (footer->metadata(i).name() == TString(key)) { + if (footer->metadata(i).name() == TProtoStringType(key)) { return true; } } @@ -1367,7 +1367,7 @@ namespace orc { if (serializedFooter.length() != 0) { // Parse the file tail from the serialized one. proto::FileTail tail; - if (!tail.ParseFromString(TString(serializedFooter))) { + if (!tail.ParseFromString(TProtoStringType(serializedFooter))) { throw ParseError("Failed to parse the file tail from string"); } contents->postscript = std::make_unique<proto::PostScript>(tail.postscript()); diff --git a/contrib/libs/apache/orc/c++/src/Statistics.hh b/contrib/libs/apache/orc/c++/src/Statistics.hh index b36e431a7f..053b6c7fd8 100644 --- a/contrib/libs/apache/orc/c++/src/Statistics.hh +++ b/contrib/libs/apache/orc/c++/src/Statistics.hh @@ -27,6 +27,8 @@ #include "Timezone.hh" #include "TypeImpl.hh" +#include <util/generic/string.h> + namespace orc { /** @@ -711,14 +713,14 @@ namespace orc { proto::DecimalStatistics* decStats = pbStats.mutable_decimal_statistics(); if (_stats.hasMinimum()) { - decStats->set_minimum(TString(_stats.getMinimum().toString(true))); - decStats->set_maximum(TString(_stats.getMaximum().toString(true))); + decStats->set_minimum(TProtoStringType(_stats.getMinimum().toString(true))); + decStats->set_maximum(TProtoStringType(_stats.getMaximum().toString(true))); } else { decStats->clear_minimum(); decStats->clear_maximum(); } if (_stats.hasSum()) { - decStats->set_sum(TString(_stats.getSum().toString(true))); + decStats->set_sum(TProtoStringType(_stats.getSum().toString(true))); } else { decStats->clear_sum(); } @@ -1225,8 +1227,8 @@ namespace orc { proto::StringStatistics* strStats = pbStats.mutable_string_statistics(); if (_stats.hasMinimum()) { - strStats->set_minimum(TString(_stats.getMinimum())); - strStats->set_maximum(TString(_stats.getMaximum())); + strStats->set_minimum(TProtoStringType(_stats.getMinimum())); + strStats->set_maximum(TProtoStringType(_stats.getMaximum())); } else { strStats->clear_minimum(); strStats->clear_maximum(); diff --git a/contrib/libs/apache/orc/c++/src/Writer.cc b/contrib/libs/apache/orc/c++/src/Writer.cc index 19b71190a3..ca96e709c9 100644 --- a/contrib/libs/apache/orc/c++/src/Writer.cc +++ b/contrib/libs/apache/orc/c++/src/Writer.cc @@ -429,8 +429,8 @@ namespace orc { void WriterImpl::addUserMetadata(const std::string& name, const std::string& value) { proto::UserMetadataItem* userMetadataItem = fileFooter.add_metadata(); - userMetadataItem->set_name(TString(name)); - userMetadataItem->set_value(TString(value)); + userMetadataItem->set_name(TProtoStringType(name)); + userMetadataItem->set_value(TProtoStringType(value)); } void WriterImpl::init() { @@ -510,7 +510,7 @@ namespace orc { *stripeFooter.add_columns() = encodings[i]; } - stripeFooter.set_writer_timezone(TString(options.getTimezoneName())); + stripeFooter.set_writer_timezone(TProtoStringType(options.getTimezoneName())); // add stripe statistics to metadata proto::StripeStatistics* stripeStats = metadata.add_stripe_stats(); @@ -679,8 +679,8 @@ namespace orc { for (auto& key : t.getAttributeKeys()) { const auto& value = t.getAttributeValue(key); auto protoAttr = protoType.add_attributes(); - protoAttr->set_key(TString(key)); - protoAttr->set_value(TString(value)); + protoAttr->set_key(TProtoStringType(key)); + protoAttr->set_value(TProtoStringType(value)); } int pos = static_cast<int>(index); @@ -689,7 +689,7 @@ namespace orc { for (uint64_t i = 0; i < t.getSubtypeCount(); ++i) { // only add subtypes' field names if this type is STRUCT if (t.getKind() == STRUCT) { - footer.mutable_types(pos)->add_field_names(TString(t.getFieldName(i))); + footer.mutable_types(pos)->add_field_names(TProtoStringType(t.getFieldName(i))); } footer.mutable_types(pos)->add_subtypes(++index); buildFooterType(*t.getSubtype(i), footer, index); diff --git a/contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc b/contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc index 5fceedd854..54968545b9 100644 --- a/contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc +++ b/contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc @@ -26,6 +26,8 @@ #include <sstream> #include <type_traits> +#include <util/generic/string.h> + namespace orc { PredicateLeaf::PredicateLeaf(Operator op, PredicateDataType type, const std::string& colName, @@ -495,11 +497,11 @@ namespace orc { return result; } - static std::vector<TString> literal2String(const std::vector<Literal>& values) { - std::vector<TString> result; + static std::vector<TProtoStringType> literal2String(const std::vector<Literal>& values) { + std::vector<TProtoStringType> result; std::for_each(values.cbegin(), values.cend(), [&](const Literal& val) { if (!val.isNull()) { - result.emplace_back(TString(val.getString())); + result.emplace_back(TProtoStringType(val.getString())); } }); return result; |