123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- #pragma once
- #include "node.h"
- #include <google/protobuf/descriptor.h>
- namespace NYT {
- struct TYamredDsvAttributes
- {
-
- TVector<TString> KeyColumnNames;
-
- TVector<TString> SubkeyColumnNames;
- };
- struct TFormat
- {
- public:
-
- TNode Config;
- public:
-
-
- explicit TFormat(const TNode& config = TNode());
-
-
- static TFormat YsonText();
-
-
- static TFormat YsonBinary();
-
-
- static TFormat YaMRLenval();
-
-
- static TFormat Protobuf(
- const TVector<const ::google::protobuf::Descriptor*>& descriptors,
- bool withDescriptors = false);
-
-
- static TFormat Json();
-
-
- static TFormat Dsv();
-
-
-
- template<typename T>
- static inline TFormat Protobuf(bool withDescriptors = false);
-
-
- bool IsTextYson() const;
-
-
- bool IsProtobuf() const;
-
-
- bool IsYamredDsv() const;
-
-
- TYamredDsvAttributes GetYamredDsvAttributes() const;
- };
- TFormat TFormat::Protobuf(bool withDescriptors) {
- return TFormat::Protobuf({T::descriptor()}, withDescriptors);
- }
- TTableSchema CreateTableSchema(
- const ::google::protobuf::Descriptor& messageDescriptor,
- bool keepFieldsWithoutExtension);
|