vibhatha commented on code in PR #13914: URL: https://github.com/apache/arrow/pull/13914#discussion_r964371290
########## cpp/src/arrow/engine/substrait/serde_test.cc: ########## @@ -121,6 +155,78 @@ inline compute::Expression UseBoringRefs(const compute::Expression& expr) { return compute::Expression{std::move(modified_call)}; } +// TODO: complete this interface +struct TempDataGenerator { + TempDataGenerator(const std::shared_ptr<Table> input_table, + const std::string& file_prefix, + std::unique_ptr<arrow::internal::TemporaryDir>& tempdir) + : input_table(input_table), file_prefix(file_prefix), tempdir(tempdir) {} + + Status operator()() { + auto format = std::make_shared<arrow::dataset::ParquetFileFormat>(); + auto filesystem = std::make_shared<fs::LocalFileSystem>(); + + const std::string file_name = file_prefix + ".parquet"; + + ARROW_ASSIGN_OR_RAISE(auto file_path, tempdir->path().Join(file_name)); + data_file_path = file_path.ToString(); + + std::string toReplace("/T//"); + size_t pos = data_file_path.find(toReplace); + data_file_path.replace(pos, toReplace.length(), "/T/"); + + ARROW_EXPECT_OK(WriteParquetData(data_file_path, filesystem, input_table)); + return Status::OK(); + } + + std::shared_ptr<Table> input_table; + std::string file_prefix; + std::unique_ptr<arrow::internal::TemporaryDir>& tempdir; + std::string data_file_path; +}; + +struct EmitValidate { + EmitValidate(const std::shared_ptr<Schema> output_schema, + const std::shared_ptr<Table> expected_table, + compute::ExecContext& exec_context, std::shared_ptr<Buffer>& buf, + const std::vector<int>& include_columns = {}) + : output_schema(output_schema), + expected_table(expected_table), + exec_context(exec_context), + buf(buf), + include_columns(include_columns) {} + void operator()() { + for (auto sp_ext_id_reg : + {std::shared_ptr<ExtensionIdRegistry>(), MakeExtensionIdRegistry()}) { Review Comment: I think I just adopted what is being done in a previous test without paying that much attention to it. We could just use the `MakeExtensionRegistry`. I already changed it [ToProto-Read](https://github.com/apache/arrow/pull/13401). And I updated here too. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org