From 046a2ba51c61424aa7a9c00cf1fc651dd6526c51 Mon Sep 17 00:00:00 2001 From: taiyang-li <654010905@qq.com> Date: Thu, 7 Apr 2022 15:35:08 +0800 Subject: [PATCH] rename some symboles --- src/Storages/Hive/HiveFile.cpp | 32 +++++++++++++++---------------- src/Storages/Hive/HiveFile.h | 22 ++++++++++----------- src/Storages/Hive/StorageHive.cpp | 4 ++-- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/Storages/Hive/HiveFile.cpp b/src/Storages/Hive/HiveFile.cpp index cc2687415ff..166336df78d 100644 --- a/src/Storages/Hive/HiveFile.cpp +++ b/src/Storages/Hive/HiveFile.cpp @@ -184,7 +184,7 @@ std::unique_ptr HiveOrcFile::buildMinMaxIndex(c } -void HiveOrcFile::loadMinMaxIndex() +void HiveOrcFile::loadFileMinMaxIndex() { if (!reader) { @@ -193,7 +193,7 @@ void HiveOrcFile::loadMinMaxIndex() } auto statistics = reader->GetRawORCReader()->getStatistics(); - minmax_idx = buildMinMaxIndex(statistics.get()); + file_minmax_idx = buildMinMaxIndex(statistics.get()); } bool HiveOrcFile::useSplitMinMaxIndex() const @@ -202,7 +202,7 @@ bool HiveOrcFile::useSplitMinMaxIndex() const } -void HiveOrcFile::loadSubMinMaxIndex() +void HiveOrcFile::loadSplitMinMaxIndex() { if (!reader) { @@ -218,11 +218,11 @@ void HiveOrcFile::loadSubMinMaxIndex() fmt::format("orc file:{} has different strip num {} and strip statistics num {}", path, stripe_num, stripe_stats_num), ErrorCodes::BAD_ARGUMENTS); - sub_minmax_idxes.resize(stripe_num); + split_minmax_idxes.resize(stripe_num); for (size_t i = 0; i < stripe_num; ++i) { auto stripe_stats = raw_reader->getStripeStatistics(i); - sub_minmax_idxes[i] = buildMinMaxIndex(stripe_stats.get()); + split_minmax_idxes[i] = buildMinMaxIndex(stripe_stats.get()); } } @@ -239,7 +239,7 @@ void HiveParquetFile::prepareReader() THROW_ARROW_NOT_OK(parquet::arrow::OpenFile(asArrowFile(*in, format_settings, is_stopped), arrow::default_memory_pool(), &reader)); } -void HiveParquetFile::loadSubMinMaxIndex() +void HiveParquetFile::loadSplitMinMaxIndex() { if (!reader) prepareReader(); @@ -256,12 +256,12 @@ void HiveParquetFile::loadSubMinMaxIndex() } - sub_minmax_idxes.resize(num_row_groups); + split_minmax_idxes.resize(num_row_groups); for (size_t i = 0; i < num_row_groups; ++i) { auto row_group_meta = meta->RowGroup(i); - sub_minmax_idxes[i] = std::make_shared(); - sub_minmax_idxes[i]->hyperrectangle.resize(num_cols); + split_minmax_idxes[i] = std::make_shared(); + split_minmax_idxes[i]->hyperrectangle.resize(num_cols); size_t j = 0; auto it = index_names_and_types.begin(); @@ -284,31 +284,31 @@ void HiveParquetFile::loadSubMinMaxIndex() if (auto bool_stats = std::dynamic_pointer_cast(stats)) { - sub_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(bool_stats); + split_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(bool_stats); } else if (auto int32_stats = std::dynamic_pointer_cast(stats)) { - sub_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(int32_stats); + split_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(int32_stats); } else if (auto int64_stats = std::dynamic_pointer_cast(stats)) { - sub_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(int64_stats); + split_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(int64_stats); } else if (auto float_stats = std::dynamic_pointer_cast(stats)) { - sub_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(float_stats); + split_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(float_stats); } else if (auto double_stats = std::dynamic_pointer_cast(stats)) { - sub_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(double_stats); + split_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(double_stats); } else if (auto string_stats = std::dynamic_pointer_cast(stats)) { - sub_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(string_stats); + split_minmax_idxes[i]->hyperrectangle[j] = createRangeFromParquetStatistics(string_stats); } /// Other types are not supported for minmax index, skip } - sub_minmax_idxes[i]->initialized = true; + split_minmax_idxes[i]->initialized = true; } } diff --git a/src/Storages/Hive/HiveFile.h b/src/Storages/Hive/HiveFile.h index bd4f12cf6b6..1404f97eff0 100644 --- a/src/Storages/Hive/HiveFile.h +++ b/src/Storages/Hive/HiveFile.h @@ -102,8 +102,8 @@ public: size_t getSize() const { return size; } const FieldVector & getPartitionValues() const { return partition_values; } const String & getNamenodeUrl() { return namenode_url; } - MinMaxIndexPtr getMinMaxIndex() const { return minmax_idx; } - const std::vector & getSubMinMaxIndexes() const { return sub_minmax_idxes; } + MinMaxIndexPtr getMinMaxIndex() const { return file_minmax_idx; } + const std::vector & getSubMinMaxIndexes() const { return split_minmax_idxes; } const std::unordered_set & getSkipSplits() const { return skip_splits; } void setSkipSplits(const std::unordered_set & skip_splits_) { skip_splits = skip_splits_; } @@ -125,17 +125,17 @@ public: virtual bool useFileMinMaxIndex() const { return false; } - virtual void loadMinMaxIndex() + virtual void loadFileMinMaxIndex() { - throw Exception("Method loadMinMaxIndex is not supported by hive file:" + getFormatName(), ErrorCodes::NOT_IMPLEMENTED); + throw Exception("Method loadFileMinMaxIndex is not supported by hive file:" + getFormatName(), ErrorCodes::NOT_IMPLEMENTED); } /// If hive query could use contains sub-file level minmax index? virtual bool useSplitMinMaxIndex() const { return false; } - virtual void loadSubMinMaxIndex() + virtual void loadSplitMinMaxIndex() { - throw Exception("Method loadSubMinMaxIndex is not supported by hive file:" + getFormatName(), ErrorCodes::NOT_IMPLEMENTED); + throw Exception("Method loadSplitMinMaxIndex is not supported by hive file:" + getFormatName(), ErrorCodes::NOT_IMPLEMENTED); } protected: @@ -145,8 +145,8 @@ protected: UInt64 last_modify_time; size_t size; NamesAndTypesList index_names_and_types; - MinMaxIndexPtr minmax_idx; - std::vector sub_minmax_idxes; + MinMaxIndexPtr file_minmax_idx; + std::vector split_minmax_idxes; /// Skip splits for this file after applying minmax index (if any) std::unordered_set skip_splits; std::shared_ptr storage_settings; @@ -192,10 +192,10 @@ public: FileFormat getFormat() const override { return FileFormat::ORC; } bool useFileMinMaxIndex() const override; - void loadMinMaxIndex() override; + void loadFileMinMaxIndex() override; bool useSplitMinMaxIndex() const override; - void loadSubMinMaxIndex() override; + void loadSplitMinMaxIndex() override; private: static Range buildRange(const orc::ColumnStatistics * col_stats); @@ -228,7 +228,7 @@ public: FileFormat getFormat() const override { return FileFormat::PARQUET; } bool useSplitMinMaxIndex() const override; - void loadSubMinMaxIndex() override; + void loadSplitMinMaxIndex() override; private: void prepareReader(); diff --git a/src/Storages/Hive/StorageHive.cpp b/src/Storages/Hive/StorageHive.cpp index c11db119ab7..6745a0f6ad0 100644 --- a/src/Storages/Hive/StorageHive.cpp +++ b/src/Storages/Hive/StorageHive.cpp @@ -545,7 +545,7 @@ HiveFilePtr StorageHive::createHiveFileIfNeeded( const KeyCondition hivefile_key_condition(query_info, getContext(), hivefile_name_types.getNames(), hivefile_minmax_idx_expr); if (hive_file->useFileMinMaxIndex()) { - hive_file->loadMinMaxIndex(); + hive_file->loadFileMinMaxIndex(); if (!hivefile_key_condition.checkInHyperrectangle(hive_file->getMinMaxIndex()->hyperrectangle, hivefile_name_types.getTypes()) .can_be_true) { @@ -559,7 +559,7 @@ HiveFilePtr StorageHive::createHiveFileIfNeeded( if (hive_file->useSplitMinMaxIndex()) { std::unordered_set skip_splits; - hive_file->loadSubMinMaxIndex(); + hive_file->loadSplitMinMaxIndex(); const auto & sub_minmax_idxes = hive_file->getSubMinMaxIndexes(); for (size_t i = 0; i < sub_minmax_idxes.size(); ++i) {