summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/client/format_hints.cpp
diff options
context:
space:
mode:
authormax42 <[email protected]>2023-06-30 11:13:34 +0300
committermax42 <[email protected]>2023-06-30 11:13:34 +0300
commit3e1899838408bbad47622007aa382bc8a2b01f87 (patch)
tree0f21c1e6add187ddb6c3ccc048a7d640ce03fb87 /yt/cpp/mapreduce/client/format_hints.cpp
parent5463eb3f5e72a86f858a3d27c886470a724ede34 (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/client/format_hints.cpp')
-rw-r--r--yt/cpp/mapreduce/client/format_hints.cpp84
1 files changed, 0 insertions, 84 deletions
diff --git a/yt/cpp/mapreduce/client/format_hints.cpp b/yt/cpp/mapreduce/client/format_hints.cpp
deleted file mode 100644
index 1f6eb173adb..00000000000
--- a/yt/cpp/mapreduce/client/format_hints.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-#include "format_hints.h"
-
-#include <yt/cpp/mapreduce/common/helpers.h>
-#include <yt/cpp/mapreduce/interface/config.h>
-#include <yt/cpp/mapreduce/interface/operation.h>
-
-#include <util/string/builder.h>
-
-namespace NYT::NDetail {
-
-using ::ToString;
-
-////////////////////////////////////////////////////////////////////////////////
-
-static void ApplyEnableTypeConversion(TFormat* format, const TFormatHints& formatHints)
-{
- if (formatHints.EnableAllToStringConversion_) {
- format->Config.Attributes()["enable_all_to_string_conversion"] = *formatHints.EnableAllToStringConversion_;
- }
- if (formatHints.EnableStringToAllConversion_) {
- format->Config.Attributes()["enable_string_to_all_conversion"] = *formatHints.EnableStringToAllConversion_;
- }
- if (formatHints.EnableIntegralTypeConversion_) {
- format->Config.Attributes()["enable_integral_type_conversion"] = *formatHints.EnableIntegralTypeConversion_;
- }
- if (formatHints.EnableIntegralToDoubleConversion_) {
- format->Config.Attributes()["enable_integral_to_double_conversion"] = *formatHints.EnableIntegralToDoubleConversion_;
- }
- if (formatHints.EnableTypeConversion_) {
- format->Config.Attributes()["enable_type_conversion"] = *formatHints.EnableTypeConversion_;
- }
-}
-
-template <>
-void ApplyFormatHints<TNode>(TFormat* format, const TMaybe<TFormatHints>& formatHints)
-{
- Y_VERIFY(format);
- if (!formatHints) {
- return;
- }
-
- ApplyEnableTypeConversion(format, *formatHints);
-
- if (formatHints->SkipNullValuesForTNode_) {
- Y_ENSURE_EX(
- format->Config.AsString() == "yson",
- TApiUsageError() << "SkipNullForTNode option must be used with yson format, actual format: " << format->Config.AsString());
- format->Config.Attributes()["skip_null_values"] = formatHints->SkipNullValuesForTNode_;
- }
-
- if (formatHints->ComplexTypeMode_) {
- Y_ENSURE_EX(
- format->Config.AsString() == "yson",
- TApiUsageError() << "ComplexTypeMode option must be used with yson format, actual format: "
- << format->Config.AsString());
- format->Config.Attributes()["complex_type_mode"] = ToString(*formatHints->ComplexTypeMode_);
- }
-}
-
-template <>
-void ApplyFormatHints<TYaMRRow>(TFormat* format, const TMaybe<TFormatHints>& formatHints)
-{
- Y_VERIFY(format);
- if (!formatHints) {
- return;
- }
-
- ythrow TApiUsageError() << "Yamr format currently has no supported format hints";
-}
-
-template <>
-void ApplyFormatHints<::google::protobuf::Message>(TFormat* format, const TMaybe<TFormatHints>& formatHints)
-{
- Y_VERIFY(format);
- if (!formatHints) {
- return;
- }
-
- ythrow TApiUsageError() << "Protobuf format currently has no supported format hints";
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace NYT::NDetail