Browse Source

Support YT_KEEP_TEMP_TABLES environment variable in C++ SDK

No description

---
c5f81efe57e11992b55a5cbbf3dfff08b790c28c

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/813
Maxim Akhmedov 6 months ago
parent
commit
07991279b3
2 changed files with 4 additions and 0 deletions
  1. 1 0
      yt/cpp/mapreduce/interface/config.cpp
  2. 3 0
      yt/cpp/mapreduce/interface/config.h

+ 1 - 0
yt/cpp/mapreduce/interface/config.cpp

@@ -225,6 +225,7 @@ void TConfig::Reset()
         "//tmp/yt_wrapper/table_storage");
     RemoteTempTablesDirectory = GetEnv("YT_TEMP_DIR",
         RemoteTempTablesDirectory);
+    KeepTempTables = GetBool("YT_KEEP_TEMP_TABLES");
 
     InferTableSchema = false;
 

+ 3 - 0
yt/cpp/mapreduce/interface/config.h

@@ -126,6 +126,9 @@ struct TConfig
 
     TString RemoteTempFilesDirectory;
     TString RemoteTempTablesDirectory;
+    // @brief Keep temp tables produced by TTempTable (despite their name). Should not be used in user programs,
+    // but may be useful for setting via environment variable for debugging purposes.
+    bool KeepTempTables = false;
 
     //
     // Infer schemas for nonexstent tables from typed rows (e.g. protobuf)