vibhatha commented on code in PR #13914:
URL: https://github.com/apache/arrow/pull/13914#discussion_r964369525
##########
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,
Review Comment:
Yes, you're right the wording is wrong. The intention was to use both the
data generator plus this function to be used in end-to-end cases. So we can use
it in other cases 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]