|
41 | 41 | #include "paimon/format/parquet/parquet_input_stream_impl.h" |
42 | 42 | #include "paimon/fs/file_system.h" |
43 | 43 | #include "paimon/fs/local/local_file_system.h" |
| 44 | +#include "paimon/global_config.h" |
44 | 45 | #include "paimon/memory/memory_pool.h" |
45 | 46 | #include "paimon/predicate/literal.h" |
46 | 47 | #include "paimon/predicate/predicate_builder.h" |
@@ -394,25 +395,27 @@ TEST_F(ParquetFileBatchReaderTest, TestCreateArrowReaderProperties) { |
394 | 395 | ASSERT_EQ(arrow_reader_properties.pre_buffer(), true); |
395 | 396 | ASSERT_EQ(arrow_reader_properties.batch_size(), 1024); |
396 | 397 | ASSERT_EQ(arrow_reader_properties.use_threads(), true); |
397 | | - ASSERT_EQ(arrow::GetCpuThreadPoolCapacity(), 3); |
398 | 398 | ASSERT_EQ(arrow_reader_properties.cache_options(), arrow::io::CacheOptions::Defaults()); |
399 | 399 | } |
400 | 400 | { |
401 | | - std::map<std::string, std::string> options = {{PARQUET_READ_EXECUTOR_THREAD_COUNT, "0"}}; |
| 401 | + std::map<std::string, std::string> options = {{PARQUET_READ_USE_THREADS, "false"}}; |
402 | 402 | int32_t batch_size = 1024; |
403 | 403 | ASSERT_OK_AND_ASSIGN( |
404 | 404 | auto arrow_reader_properties, |
405 | 405 | ParquetFileBatchReader::CreateArrowReaderProperties(pool_, options, batch_size)); |
406 | 406 | ASSERT_EQ(arrow_reader_properties.use_threads(), false); |
407 | 407 | } |
408 | 408 | { |
409 | | - std::map<std::string, std::string> options = {{PARQUET_READ_EXECUTOR_THREAD_COUNT, "6"}}; |
| 409 | + int original_capacity = GetArrowCpuThreadPoolCapacity(); |
| 410 | + ASSERT_OK(SetArrowCpuThreadPoolCapacity(6)); |
| 411 | + std::map<std::string, std::string> options = {{PARQUET_READ_USE_THREADS, "true"}}; |
410 | 412 | int32_t batch_size = 1024; |
411 | 413 | ASSERT_OK_AND_ASSIGN( |
412 | 414 | auto arrow_reader_properties, |
413 | 415 | ParquetFileBatchReader::CreateArrowReaderProperties(pool_, options, batch_size)); |
414 | 416 | ASSERT_EQ(arrow_reader_properties.use_threads(), true); |
415 | | - ASSERT_EQ(arrow::GetCpuThreadPoolCapacity(), 6); |
| 417 | + ASSERT_EQ(GetArrowCpuThreadPoolCapacity(), 6); |
| 418 | + ASSERT_OK(SetArrowCpuThreadPoolCapacity(original_capacity)); |
416 | 419 | } |
417 | 420 | } |
418 | 421 |
|
|
0 commit comments