@@ -50,7 +50,7 @@ class AvroStatsExtractorTest : public ::testing::Test {
5050 ASSERT_TRUE (arrow::ExportSchema (*schema, &c_schema).ok ());
5151
5252 ASSERT_OK_AND_ASSIGN (std::unique_ptr<FileFormat> file_format,
53- FileFormatFactory::Get (" avro" , {} ));
53+ FileFormatFactory::Get (" avro" , options_ ));
5454 ASSERT_OK_AND_ASSIGN (auto writer_builder,
5555 file_format->CreateWriterBuilder (&c_schema, /* batch_size=*/ 1024 ));
5656
@@ -70,6 +70,10 @@ class AvroStatsExtractorTest : public ::testing::Test {
7070 ASSERT_OK_AND_ASSIGN (auto file_status, fs->GetFileStatus (file_path));
7171 ASSERT_GT (file_status->GetLen (), 0 );
7272 }
73+
74+ private:
75+ std::map<std::string, std::string> options_ = {{Options::FILE_FORMAT , " avro" },
76+ {Options::MANIFEST_FORMAT , " avro" }};
7377};
7478
7579TEST_F (AvroStatsExtractorTest, TestPrimitiveStatsExtractor) {
@@ -111,7 +115,7 @@ TEST_F(AvroStatsExtractorTest, TestPrimitiveStatsExtractor) {
111115 std::string file_path = dir->Str () + " /test.avro" ;
112116 WriteAvroFile (file_path, src_chunk_array, schema);
113117
114- AvroFileFormat format ({{ " file.format " , " avro " }, { " manifest.format " , " avro " }} );
118+ AvroFileFormat format (options_ );
115119 ::ArrowSchema arrow_schema;
116120 ASSERT_TRUE (arrow::ExportSchema (*schema, &arrow_schema).ok ());
117121 ASSERT_OK_AND_ASSIGN (auto extractor, format.CreateStatsExtractor (&arrow_schema));
@@ -144,7 +148,7 @@ TEST_F(AvroStatsExtractorTest, TestNestedType) {
144148 std::string file_path = dir->Str () + " /test.avro" ;
145149 WriteAvroFile (file_path, src_chunk_array, schema);
146150
147- AvroStatsExtractor extractor ({} );
151+ AvroStatsExtractor extractor (options_ );
148152 auto fs = std::make_shared<LocalFileSystem>();
149153 ASSERT_OK_AND_ASSIGN (auto results, extractor.Extract (fs, file_path, GetDefaultPool ()));
150154
@@ -197,7 +201,7 @@ TEST_F(AvroStatsExtractorTest, TestNullForAllType) {
197201 std::string file_path = dir->Str () + " /test.avro" ;
198202 WriteAvroFile (file_path, src_chunk_array, schema);
199203
200- AvroStatsExtractor extractor ({} );
204+ AvroStatsExtractor extractor (options_ );
201205 auto fs = std::make_shared<LocalFileSystem>();
202206 ASSERT_OK_AND_ASSIGN (auto column_stats, extractor.Extract (fs, file_path, GetDefaultPool ()));
203207
0 commit comments