summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorignat <[email protected]>2024-08-06 11:45:32 +0300
committerignat <[email protected]>2024-08-06 13:06:51 +0300
commit03cdd2da9245de42a5bed37355d703f62486ec21 (patch)
treef13562aa6a86a8ec36a2aace4c9c48bb6815d75d
parentdb9505d66cb73d62c7beaff1980941cfb1aec0ea (diff)
YT-22431: Move TProtoStringType under orc namespace
03c4c55ccebe71a295336e40c980ee2d65da4d9f
-rw-r--r--contrib/libs/apache/orc/c++/include/orc/Common.hh4
-rw-r--r--contrib/libs/apache/orc/c++/src/Reader.cc8
-rw-r--r--contrib/libs/apache/orc/c++/src/Statistics.hh10
-rw-r--r--contrib/libs/apache/orc/c++/src/Writer.cc12
-rw-r--r--contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc6
5 files changed, 20 insertions, 20 deletions
diff --git a/contrib/libs/apache/orc/c++/include/orc/Common.hh b/contrib/libs/apache/orc/c++/include/orc/Common.hh
index b3db848b524..e983280e46d 100644
--- a/contrib/libs/apache/orc/c++/include/orc/Common.hh
+++ b/contrib/libs/apache/orc/c++/include/orc/Common.hh
@@ -27,10 +27,10 @@
#include <string>
-using TProtoStringType = decltype(std::declval<::google::protobuf::MessageLite>().GetTypeName());
-
namespace orc {
+ using TProtobufString = decltype(std::declval<::google::protobuf::MessageLite>().GetTypeName());
+
class FileVersion {
private:
uint32_t majorVersion;
diff --git a/contrib/libs/apache/orc/c++/src/Reader.cc b/contrib/libs/apache/orc/c++/src/Reader.cc
index 0586918d80f..8f96914b947 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);
- TProtoStringType result;
+ TProtobufString 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() == TProtoStringType(key)) {
+ if (footer->metadata(i).name() == TProtobufString(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() == TProtoStringType(key)) {
+ if (footer->metadata(i).name() == TProtobufString(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(TProtoStringType(serializedFooter))) {
+ if (!tail.ParseFromString(TProtobufString(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 eb14011c410..94e19417c3a 100644
--- a/contrib/libs/apache/orc/c++/src/Statistics.hh
+++ b/contrib/libs/apache/orc/c++/src/Statistics.hh
@@ -711,14 +711,14 @@ namespace orc {
proto::DecimalStatistics* decStats = pbStats.mutable_decimal_statistics();
if (_stats.hasMinimum()) {
- decStats->set_minimum(TProtoStringType(_stats.getMinimum().toString(true)));
- decStats->set_maximum(TProtoStringType(_stats.getMaximum().toString(true)));
+ decStats->set_minimum(TProtobufString(_stats.getMinimum().toString(true)));
+ decStats->set_maximum(TProtobufString(_stats.getMaximum().toString(true)));
} else {
decStats->clear_minimum();
decStats->clear_maximum();
}
if (_stats.hasSum()) {
- decStats->set_sum(TProtoStringType(_stats.getSum().toString(true)));
+ decStats->set_sum(TProtobufString(_stats.getSum().toString(true)));
} else {
decStats->clear_sum();
}
@@ -1225,8 +1225,8 @@ namespace orc {
proto::StringStatistics* strStats = pbStats.mutable_string_statistics();
if (_stats.hasMinimum()) {
- strStats->set_minimum(TProtoStringType(_stats.getMinimum()));
- strStats->set_maximum(TProtoStringType(_stats.getMaximum()));
+ strStats->set_minimum(TProtobufString(_stats.getMinimum()));
+ strStats->set_maximum(TProtobufString(_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 ca96e709c9d..8a8044f0291 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(TProtoStringType(name));
- userMetadataItem->set_value(TProtoStringType(value));
+ userMetadataItem->set_name(TProtobufString(name));
+ userMetadataItem->set_value(TProtobufString(value));
}
void WriterImpl::init() {
@@ -510,7 +510,7 @@ namespace orc {
*stripeFooter.add_columns() = encodings[i];
}
- stripeFooter.set_writer_timezone(TProtoStringType(options.getTimezoneName()));
+ stripeFooter.set_writer_timezone(TProtobufString(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(TProtoStringType(key));
- protoAttr->set_value(TProtoStringType(value));
+ protoAttr->set_key(TProtobufString(key));
+ protoAttr->set_value(TProtobufString(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(TProtoStringType(t.getFieldName(i)));
+ footer.mutable_types(pos)->add_field_names(TProtobufString(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 78b699f3f2e..dda89f7c3b7 100644
--- a/contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc
+++ b/contrib/libs/apache/orc/c++/src/sargs/PredicateLeaf.cc
@@ -495,11 +495,11 @@ namespace orc {
return result;
}
- static std::vector<TProtoStringType> literal2String(const std::vector<Literal>& values) {
- std::vector<TProtoStringType> result;
+ static std::vector<TProtobufString> literal2String(const std::vector<Literal>& values) {
+ std::vector<TProtobufString> result;
std::for_each(values.cbegin(), values.cend(), [&](const Literal& val) {
if (!val.isNull()) {
- result.emplace_back(TProtoStringType(val.getString()));
+ result.emplace_back(TProtobufString(val.getString()));
}
});
return result;