diff options
author | aneporada <aneporada@ydb.tech> | 2023-03-03 19:55:46 +0300 |
---|---|---|
committer | aneporada <aneporada@ydb.tech> | 2023-03-03 19:55:46 +0300 |
commit | 790e700992f79d88b2eebed52b7f43905896e034 (patch) | |
tree | 2eab4d7621900e95566f6779ead44465bcfaae2d | |
parent | 0e305e7c7afb573c264bf81388fe0ecd421a66bf (diff) | |
download | ydb-790e700992f79d88b2eebed52b7f43905896e034.tar.gz |
[refactoring] Remove unneded code
-rw-r--r-- | ydb/library/yql/public/udf/arrow/block_item_comparator.h | 56 |
1 files changed, 3 insertions, 53 deletions
diff --git a/ydb/library/yql/public/udf/arrow/block_item_comparator.h b/ydb/library/yql/public/udf/arrow/block_item_comparator.h index da868faa707..b0a4843768e 100644 --- a/ydb/library/yql/public/udf/arrow/block_item_comparator.h +++ b/ydb/library/yql/public/udf/arrow/block_item_comparator.h @@ -14,7 +14,9 @@ public: virtual i64 Compare(TBlockItem lhs, TBlockItem rhs) const = 0; virtual bool Equals(TBlockItem lhs, TBlockItem rhs) const = 0; virtual bool Less(TBlockItem lhs, TBlockItem rhs) const = 0; - virtual bool Greater(TBlockItem lhs, TBlockItem rhs) const = 0; + inline bool Greater(TBlockItem lhs, TBlockItem rhs) const { + return Less(rhs, lhs); + } }; @@ -86,26 +88,6 @@ public: return Derived()->DoLess(lhs, rhs); } } - - bool Greater(TBlockItem lhs, TBlockItem rhs) const final { - if constexpr (Nullable) { - if (lhs) { - if (rhs) { - return Derived()->DoGreater(lhs, rhs); - } else { - return true; - } - } else { - if (rhs) { - return false; - } else { - return false; - } - } - } else { - return Derived()->DoGreater(lhs, rhs); - } - } }; template <typename T, bool Nullable> @@ -142,15 +124,6 @@ public: } return lhs.As<T>() < rhs.As<T>(); } - - bool DoGreater(TBlockItem lhs, TBlockItem rhs) const { - if constexpr (std::is_floating_point<T>::value) { - if (std::isunordered(lhs.As<T>(), rhs.As<T>())) { - return std::isnan(lhs.As<T>()) > std::isnan(rhs.As<T>()); - } - } - return lhs.As<T>() > rhs.As<T>(); - } }; template <typename TStringType, bool Nullable> @@ -167,10 +140,6 @@ public: bool DoLess(TBlockItem lhs, TBlockItem rhs) const { return lhs.AsStringRef() < rhs.AsStringRef(); } - - bool DoGreater(TBlockItem lhs, TBlockItem rhs) const { - return lhs.AsStringRef() > rhs.AsStringRef(); - } }; template <bool Nullable> @@ -217,21 +186,6 @@ public: return false; } - bool DoGreater(TBlockItem lhs, TBlockItem rhs) const { - for (ui32 i = 0; i < Children_.size(); ++i) { - auto res = Children_[i]->Compare(lhs.AsTuple()[i], rhs.AsTuple()[i]); - if (res > 0) { - return true; - } - - if (res < 0) { - return false; - } - } - - return false; - } - private: const TVector<std::unique_ptr<IBlockItemComparator>> Children_; }; @@ -254,10 +208,6 @@ public: return Inner_->Less(lhs.GetOptionalValue(), rhs.GetOptionalValue()); } - bool DoGreater(TBlockItem lhs, TBlockItem rhs) const { - return Inner_->Greater(lhs.GetOptionalValue(), rhs.GetOptionalValue()); - } - private: std::unique_ptr<IBlockItemComparator> Inner_; }; |