Skip to content

Commit

Permalink
fix: hive threadpool read orc failed
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny19930321 committed Jan 5, 2024
1 parent 2166df0 commit f9b57bf
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/Storages/Hive/StorageHive.cpp
Expand Up @@ -226,21 +226,27 @@ class StorageHiveSource : public ISource, WithContext
{
auto get_raw_read_buf = [&]() -> std::unique_ptr<ReadBuffer>
{
auto buf = std::make_unique<ReadBufferFromHDFS>(
hdfs_namenode_url,
current_path,
getContext()->getGlobalContext()->getConfigRef(),
getContext()->getReadSettings());

bool thread_pool_read = read_settings.remote_fs_method == RemoteFSReadMethod::threadpool;
if (thread_pool_read)
{
auto buf = std::make_unique<ReadBufferFromHDFS>(
hdfs_namenode_url,
current_path,
getContext()->getGlobalContext()->getConfigRef(),
getContext()->getReadSettings(),
/* read_until_position */0,
/* use_external_buffer */true);

return std::make_unique<AsynchronousReadBufferFromHDFS>(
getThreadPoolReader(FilesystemReaderType::ASYNCHRONOUS_REMOTE_FS_READER), read_settings, std::move(buf));
}
else
{
return buf;
return std::make_unique<ReadBufferFromHDFS>(
hdfs_namenode_url,
current_path,
getContext()->getGlobalContext()->getConfigRef(),
getContext()->getReadSettings());;
}
};

Expand Down

0 comments on commit f9b57bf

Please sign in to comment.