| 286 | } |
| 287 | |
| 288 | void ExpressionVerifier::persistReproInfo( |
| 289 | const VectorPtr& inputVector, |
| 290 | std::vector<int> columnsToWrapInLazy, |
| 291 | const VectorPtr& resultVector, |
| 292 | const std::string& sql, |
| 293 | const std::vector<VectorPtr>& complexConstants) { |
| 294 | std::string inputPath; |
| 295 | std::string lazyListPath; |
| 296 | std::string resultPath; |
| 297 | std::string sqlPath; |
| 298 | std::string complexConstantsPath; |
| 299 | |
| 300 | const auto basePath = options_.reproPersistPath.c_str(); |
| 301 | if (!common::generateFileDirectory(basePath)) { |
| 302 | return; |
| 303 | } |
| 304 | |
| 305 | // Create a new directory |
| 306 | auto dirPath = common::generateTempFolderPath(basePath, "expressionVerifier"); |
| 307 | if (!dirPath.has_value()) { |
| 308 | LOG(INFO) << "Failed to create directory for persisting repro info."; |
| 309 | return; |
| 310 | } |
| 311 | // Saving input vector |
| 312 | inputPath = fmt::format("{}/{}", dirPath->c_str(), kInputVectorFileName); |
| 313 | try { |
| 314 | saveVectorToFile(inputVector.get(), inputPath.c_str()); |
| 315 | } catch (std::exception& e) { |
| 316 | inputPath = e.what(); |
| 317 | } |
| 318 | |
| 319 | // Saving the list of column indices that are to be wrapped in lazy. |
| 320 | if (!columnsToWrapInLazy.empty()) { |
| 321 | lazyListPath = |
| 322 | fmt::format("{}/{}", dirPath->c_str(), kIndicesOfLazyColumnsFileName); |
| 323 | try { |
| 324 | saveStdVectorToFile<int>(columnsToWrapInLazy, lazyListPath.c_str()); |
| 325 | } catch (std::exception& e) { |
| 326 | lazyListPath = e.what(); |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | // Saving result vector |
| 331 | if (resultVector) { |
| 332 | resultPath = fmt::format("{}/{}", dirPath->c_str(), kResultVectorFileName); |
| 333 | try { |
| 334 | saveVectorToFile(resultVector.get(), resultPath.c_str()); |
| 335 | } catch (std::exception& e) { |
| 336 | resultPath = e.what(); |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | // Saving sql |
| 341 | sqlPath = fmt::format("{}/{}", dirPath->c_str(), kExpressionSqlFileName); |
| 342 | try { |
| 343 | saveStringToFile(sql, sqlPath.c_str()); |
| 344 | } catch (std::exception& e) { |
| 345 | sqlPath = e.what(); |
nothing calls this directly
no test coverage detected