| 750 | } |
| 751 | |
| 752 | bool Equals(const Statistics& raw_other) const override { |
| 753 | if (physical_type() != raw_other.physical_type()) return false; |
| 754 | |
| 755 | const auto other_logical_type = LogicalTypeId(raw_other); |
| 756 | // Only compare against logical types that influence the interpretation of the |
| 757 | // physical type |
| 758 | if (IsMeaningfulLogicalType(logical_type_)) { |
| 759 | if (logical_type_ != other_logical_type) return false; |
| 760 | } else if (IsMeaningfulLogicalType(other_logical_type)) { |
| 761 | return false; |
| 762 | } |
| 763 | |
| 764 | const auto& other = checked_cast<const TypedStatisticsImpl&>(raw_other); |
| 765 | |
| 766 | if (has_min_max_ != other.has_min_max_) return false; |
| 767 | if (has_min_max_) { |
| 768 | if (!MinMaxEqual(other)) return false; |
| 769 | } |
| 770 | |
| 771 | return null_count() == other.null_count() && |
| 772 | distinct_count() == other.distinct_count() && |
| 773 | num_values() == other.num_values() && |
| 774 | is_min_value_exact() == other.is_min_value_exact() && |
| 775 | is_max_value_exact() == other.is_max_value_exact(); |
| 776 | } |
| 777 | |
| 778 | bool MinMaxEqual(const TypedStatisticsImpl& other) const; |
| 779 |
nothing calls this directly
no test coverage detected