From fe7eacb6c7f160d1a811865ae1446d7e3ae2e1a1 Mon Sep 17 00:00:00 2001 From: mwish Date: Thu, 9 Feb 2023 01:22:49 +0800 Subject: [PATCH] MINOR: [C++][Parquet] Fix some comments and style in Statistics (#33996) ### Rationale for this change Statistics uses some virtual functions in constructor, so here I change it to explicit call rather than implicit virtual fn call. And I also fixed some comments typo ### What changes are included in this PR? Some code style and comment fix in parquet statistics ### Are these changes tested? No, and no tests are need. ### Are there any user-facing changes? no Authored-by: mwish Signed-off-by: Will Jones --- cpp/src/parquet/statistics.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cpp/src/parquet/statistics.cc b/cpp/src/parquet/statistics.cc index 53312bf79a180..d0130605cd887 100644 --- a/cpp/src/parquet/statistics.cc +++ b/cpp/src/parquet/statistics.cc @@ -163,7 +163,7 @@ struct BinaryLikeComparer { int a_length = value_length(type_length, a); int b_length = value_length(type_length, b); // Unsigned comparison is used for non-numeric types so straight - // lexiographic comparison makes sense. (a.ptr is always unsigned).... + // lexicographic comparison makes sense. (a.ptr is always unsigned).... return std::lexicographical_compare(a.ptr, a.ptr + a_length, b.ptr, b.ptr + b_length); } }; @@ -186,7 +186,7 @@ struct BinaryLikeComparer { // We can short circuit for different signed numbers or // for equal length bytes arrays that have different first bytes. // The equality requirement is necessary for sign extension cases. - // 0xFF10 should be eqaul to 0x10 (due to big endian sign extension). + // 0xFF10 should be equal to 0x10 (due to big endian sign extension). if ((0x80 & first_a) != (0x80 & first_b) || (a_length == b_length && first_a != first_b)) { return first_a < first_b; @@ -228,7 +228,7 @@ struct BinaryLikeComparer { // a must be the lesser value: return true // // positive values: - // b is the longer value. + // b is the longer value. // values in b must be greater than a: return true // else: // values in a must be greater than b: return false @@ -470,7 +470,7 @@ class TypedStatisticsImpl : public TypedStatistics { max_buffer_(AllocateBuffer(pool_, 0)) { auto comp = Comparator::Make(descr); comparator_ = std::static_pointer_cast>(comp); - Reset(); + TypedStatisticsImpl::Reset(); has_null_count_ = true; has_distinct_count_ = true; } @@ -480,8 +480,8 @@ class TypedStatisticsImpl : public TypedStatistics { : pool_(default_memory_pool()), min_buffer_(AllocateBuffer(pool_, 0)), max_buffer_(AllocateBuffer(pool_, 0)) { - IncrementNumValues(num_values); - IncrementNullCount(null_count); + TypedStatisticsImpl::IncrementNumValues(num_values); + TypedStatisticsImpl::IncrementNullCount(null_count); IncrementDistinctCount(distinct_count); Copy(min, &min_, min_buffer_.get()); @@ -494,9 +494,9 @@ class TypedStatisticsImpl : public TypedStatistics { int64_t null_count, int64_t distinct_count, bool has_min_max, bool has_null_count, bool has_distinct_count, MemoryPool* pool) : TypedStatisticsImpl(descr, pool) { - IncrementNumValues(num_values); + TypedStatisticsImpl::IncrementNumValues(num_values); if (has_null_count_) { - IncrementNullCount(null_count); + TypedStatisticsImpl::IncrementNullCount(null_count); } if (has_distinct_count) { IncrementDistinctCount(distinct_count);