diff options
| author | max42 <[email protected]> | 2023-06-30 11:13:34 +0300 |
|---|---|---|
| committer | max42 <[email protected]> | 2023-06-30 11:13:34 +0300 |
| commit | 3e1899838408bbad47622007aa382bc8a2b01f87 (patch) | |
| tree | 0f21c1e6add187ddb6c3ccc048a7d640ce03fb87 /yt/cpp/mapreduce/interface/format.h | |
| parent | 5463eb3f5e72a86f858a3d27c886470a724ede34 (diff) | |
Revert "YT-19324: move YT provider to ydb/library/yql"
This reverts commit ca272f12fdd0e8d5c3e957fc87939148f1caaf72, reversing
changes made to 49f8acfc8b0b5c0071b804423bcf53fda26c7c12.
Diffstat (limited to 'yt/cpp/mapreduce/interface/format.h')
| -rw-r--r-- | yt/cpp/mapreduce/interface/format.h | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/yt/cpp/mapreduce/interface/format.h b/yt/cpp/mapreduce/interface/format.h deleted file mode 100644 index e2975764642..00000000000 --- a/yt/cpp/mapreduce/interface/format.h +++ /dev/null @@ -1,122 +0,0 @@ -#pragma once - -/// -/// @file yt/cpp/mapreduce/interface/format.h -/// -/// Header containing class to work with raw [YT formats](https://yt.yandex-team.ru/docs/description/storage/formats.html). - -#include "node.h" - -#include <google/protobuf/descriptor.h> - -namespace NYT { - -//////////////////////////////////////////////////////////////////////////////// - -/// @deprecated -struct TYamredDsvAttributes -{ - /// Names of key columns. - TVector<TString> KeyColumnNames; - - /// Names of subkey columns. - TVector<TString> SubkeyColumnNames; -}; - -//////////////////////////////////////////////////////////////////////////////// - -/// @brief Class representing YT data format. -/// -/// Normally the user does not need to use it. -/// However, the class is handy for "raw" operations and table reading and writing, -/// e.g. @ref NYT::IOperationClient::RawMap and other raw operations, -/// @ref NYT::IIOClient::CreateRawReader and @ref NYT::IIOClient::CreateRawWriter. -/// Anyway, the static factory methods should be preferred to the constructor. -/// -/// @see [YT doc](https://yt.yandex-team.ru/docs/description/storage/formats.html). -struct TFormat -{ -public: - /// Format representation understandable by YT. - TNode Config; - -public: - /// @brief Construct format from given YT format representation. - /// - /// @note Prefer using static factory methods (e.g. @ref NYT::TFormat::YsonBinary, @ref NYT::TFormat::YsonText, @ref NYT::TFormat::Protobuf). - explicit TFormat(const TNode& config = TNode()); - - /// @brief Create text YSON format. - /// - /// @see [the doc](https://yt.yandex-team.ru/docs/description/storage/formats.html#YSON) - static TFormat YsonText(); - - /// @brief Create binary YSON format. - /// - /// @see [the doc](https://yt.yandex-team.ru/docs/description/storage/formats.html#YSON) - static TFormat YsonBinary(); - - /// @brief Create YaMR format. - /// - /// @deprecated - static TFormat YaMRLenval(); - - /// @brief Create protobuf format from protobuf message descriptors. - /// - /// @see [the doc](https://yt.yandex-team.ru/docs/api/c++/protobuf.html). - static TFormat Protobuf( - const TVector<const ::google::protobuf::Descriptor*>& descriptors, - bool withDescriptors = false); - - /// @brief Create JSON format. - /// - /// @see [the doc](https://yt.yandex-team.ru/docs/description/storage/formats.html#JSON) - static TFormat Json(); - - /// @brief Create protobuf format for the message specified in template parameter. - /// - /// `T` must be inherited from `Message`. - /// - /// @see [the doc](https://yt.yandex-team.ru/docs/api/c++/protobuf.html). - template<typename T> - static inline TFormat Protobuf(bool withDescriptors = false); - - /// @brief Is the format text YSON? - /// - /// @see [the doc](https://yt.yandex-team.ru/docs/description/storage/formats.html#YSON) - bool IsTextYson() const; - - /// @brief Is the format protobuf? - /// - /// @see [the doc](https://yt.yandex-team.ru/docs/api/c++/protobuf.html) - bool IsProtobuf() const; - - /// @brief Is the format YaMR? - /// - /// @deprecated - bool IsYamredDsv() const; - - /// @brief For YAMR format returns its attributes in structured way. - /// - /// @deprecated - TYamredDsvAttributes GetYamredDsvAttributes() const; -}; - -//////////////////////////////////////////////////////////////////////////////// - -template<typename T> -TFormat TFormat::Protobuf(bool withDescriptors) { - return TFormat::Protobuf({T::descriptor()}, withDescriptors); -} - -/// @brief Create table schema from protobuf message descriptor. -/// -/// @param messageDescriptor Message descriptor -/// @param keepFieldsWithoutExtension Add to schema fields without "column_name" or "key_column_name" extensions. -TTableSchema CreateTableSchema( - const ::google::protobuf::Descriptor& messageDescriptor, - bool keepFieldsWithoutExtension); - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NYT |
