This is an automated email from the ASF dual-hosted git repository.
apitrou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new b3e607b6d5 GH-38966: [C++] Fix spelling (util) (#38967)
b3e607b6d5 is described below
commit b3e607b6d53ba7d26791ba6c2b5bda64d9b0e709
Author: Josh Soref <[email protected]>
AuthorDate: Tue Dec 5 11:56:19 2023 -0500
GH-38966: [C++] Fix spelling (util) (#38967)
### Rationale for this change
### What changes are included in this PR?
Spelling fixes to cpp/src/arrow/util/
### Are these changes tested?
### Are there any user-facing changes?
* Closes: #38966
Authored-by: Josh Soref <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
---
cpp/src/arrow/util/align_util.h | 2 +-
cpp/src/arrow/util/async_generator.h | 4 ++--
cpp/src/arrow/util/async_generator_test.cc | 4 ++--
cpp/src/arrow/util/benchmark_util.h | 2 +-
cpp/src/arrow/util/bit_block_counter.h | 2 +-
cpp/src/arrow/util/bit_util_test.cc | 2 +-
cpp/src/arrow/util/bitmap_reader.h | 2 +-
cpp/src/arrow/util/byte_stream_split_internal.h | 4 ++--
cpp/src/arrow/util/byte_stream_split_test.cc | 6 +++---
cpp/src/arrow/util/decimal.cc | 4 ++--
cpp/src/arrow/util/future.h | 4 ++--
cpp/src/arrow/util/int_util.h | 2 +-
cpp/src/arrow/util/io_util.cc | 2 +-
cpp/src/arrow/util/iterator.h | 2 +-
cpp/src/arrow/util/list_util.h | 2 +-
cpp/src/arrow/util/logging.cc | 2 +-
cpp/src/arrow/util/ree_util.cc | 2 +-
cpp/src/arrow/util/ree_util.h | 4 ++--
cpp/src/arrow/util/ree_util_test.cc | 4 ++--
cpp/src/arrow/util/rle_encoding.h | 2 +-
cpp/src/arrow/util/string_test.cc | 2 +-
cpp/src/arrow/util/tdigest.cc | 2 +-
cpp/src/arrow/util/tdigest_test.cc | 2 +-
cpp/src/arrow/util/thread_pool_test.cc | 2 +-
24 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/cpp/src/arrow/util/align_util.h b/cpp/src/arrow/util/align_util.h
index 63df63749c..71920e49f4 100644
--- a/cpp/src/arrow/util/align_util.h
+++ b/cpp/src/arrow/util/align_util.h
@@ -74,7 +74,7 @@ namespace util {
/// \brief Special alignment value to use data type-specific alignment
///
/// If this is passed as the `alignment` in one of the CheckAlignment or
EnsureAlignment
-/// functions, then the function will ensure ensure each buffer is suitably
aligned
+/// functions, then the function will ensure each buffer is suitably aligned
/// for the data type of the array. For example, given an int32 buffer the
values
/// buffer's address must be a multiple of 4. Given a large_string buffer the
offsets
/// buffer's address must be a multiple of 8.
diff --git a/cpp/src/arrow/util/async_generator.h
b/cpp/src/arrow/util/async_generator.h
index a06be707f2..f9bcd53456 100644
--- a/cpp/src/arrow/util/async_generator.h
+++ b/cpp/src/arrow/util/async_generator.h
@@ -715,7 +715,7 @@ AsyncGenerator<T>
MakeSerialReadaheadGenerator(AsyncGenerator<T> source_generato
/// generator() once before it returns. The returned generator will otherwise
/// mirror the source.
///
-/// This generator forwards aysnc-reentrant pressure to the source
+/// This generator forwards async-reentrant pressure to the source
/// This generator buffers one item (the first result) until it is delivered.
template <typename T>
AsyncGenerator<T> MakeAutoStartingGenerator(AsyncGenerator<T> generator) {
@@ -1843,7 +1843,7 @@ constexpr int kDefaultBackgroundQRestart = 16;
/// active background thread task at any given time. You MUST transfer away
from this
/// background generator. Otherwise there could be a race condition if a
callback on the
/// background thread deletes the last consumer reference to the background
generator. You
-/// can transfer onto the same executor as the background thread, it is only
neccesary to
+/// can transfer onto the same executor as the background thread, it is only
necessary to
/// create a new thread task, not to switch executors.
///
/// This generator is not async-reentrant
diff --git a/cpp/src/arrow/util/async_generator_test.cc
b/cpp/src/arrow/util/async_generator_test.cc
index 7fb99f167c..2b74313db2 100644
--- a/cpp/src/arrow/util/async_generator_test.cc
+++ b/cpp/src/arrow/util/async_generator_test.cc
@@ -719,7 +719,7 @@ TEST_P(MergedGeneratorTestFixture, MergedStress) {
sources.push_back(source);
}
AsyncGenerator<AsyncGenerator<TestInt>> source_gen =
util::AsyncVectorIt(sources);
- auto outer_gaurd = ExpectNotAccessedReentrantly(&source_gen);
+ auto outer_guard = ExpectNotAccessedReentrantly(&source_gen);
auto merged = MakeMergedGenerator(source_gen, 4);
ASSERT_FINISHES_OK_AND_ASSIGN(auto items, CollectAsyncGenerator(merged));
@@ -1095,7 +1095,7 @@ TEST_P(BackgroundGeneratorTestFixture, BadResult) {
ASSERT_FINISHES_OK_AND_EQ(TestInt(1), generator());
// Next three results may or may not be valid.
// The typical case is the call for TestInt(2) restarts a full queue and
then maybe
- // TestInt(3) and TestInt(4) arrive quickly enough to not get pre-empted or
maybe
+ // TestInt(3) and TestInt(4) arrive quickly enough to not get preempted or
maybe
// they don't.
//
// A more bizarre, but possible, case is the checking thread falls behind
the producer
diff --git a/cpp/src/arrow/util/benchmark_util.h
b/cpp/src/arrow/util/benchmark_util.h
index 2a3dcf56f8..75639ac11a 100644
--- a/cpp/src/arrow/util/benchmark_util.h
+++ b/cpp/src/arrow/util/benchmark_util.h
@@ -161,7 +161,7 @@ class MemoryPoolMemoryManager : public
benchmark::MemoryManager {
int64_t new_default_allocations =
default_pool->num_allocations() - global_allocations_start;
- // Only record metrics metrics if (1) there were allocations and (2) we
+ // Only record metrics if (1) there were allocations and (2) we
// recorded at least one.
if (new_default_allocations > 0 && memory_pool->num_allocations() > 0) {
if (new_default_allocations > memory_pool->num_allocations()) {
diff --git a/cpp/src/arrow/util/bit_block_counter.h
b/cpp/src/arrow/util/bit_block_counter.h
index f77cc31936..73a1ee8600 100644
--- a/cpp/src/arrow/util/bit_block_counter.h
+++ b/cpp/src/arrow/util/bit_block_counter.h
@@ -200,7 +200,7 @@ class ARROW_EXPORT BitBlockCounter {
int64_t offset_;
};
-/// \brief A tool to iterate through a possibly non-existent validity bitmap,
+/// \brief A tool to iterate through a possibly nonexistent validity bitmap,
/// to allow us to write one code path for both the with-nulls and no-nulls
/// cases without giving up a lot of performance.
class ARROW_EXPORT OptionalBitBlockCounter {
diff --git a/cpp/src/arrow/util/bit_util_test.cc
b/cpp/src/arrow/util/bit_util_test.cc
index 15eadc9f2e..e026dfec24 100644
--- a/cpp/src/arrow/util/bit_util_test.cc
+++ b/cpp/src/arrow/util/bit_util_test.cc
@@ -924,7 +924,7 @@ TEST(FirstTimeBitmapWriter,
AppendWordOffsetOverwritesCorrectBitsOnExistingByte)
writer.Finish();
EXPECT_EQ(BitmapToString(valid_bits, kBitsAfterAppend), expected_bits);
};
- // 0ffset zero would not be a valid mask.
+ // Offset zero would not be a valid mask.
check_with_set("11111111", 1);
check_with_set("10111111", 2);
check_with_set("10011111", 3);
diff --git a/cpp/src/arrow/util/bitmap_reader.h
b/cpp/src/arrow/util/bitmap_reader.h
index 89006ba887..5526c87dbc 100644
--- a/cpp/src/arrow/util/bitmap_reader.h
+++ b/cpp/src/arrow/util/bitmap_reader.h
@@ -256,7 +256,7 @@ class BitmapWordReader {
}
};
-/// \brief Index into a possibly non-existent bitmap
+/// \brief Index into a possibly nonexistent bitmap
struct OptionalBitIndexer {
const uint8_t* bitmap;
const int64_t offset;
diff --git a/cpp/src/arrow/util/byte_stream_split_internal.h
b/cpp/src/arrow/util/byte_stream_split_internal.h
index ae85e2cfa8..4bc732ec24 100644
--- a/cpp/src/arrow/util/byte_stream_split_internal.h
+++ b/cpp/src/arrow/util/byte_stream_split_internal.h
@@ -298,7 +298,7 @@ void ByteStreamSplitEncodeAvx2(const uint8_t* raw_values,
const size_t num_value
}
// Path for float.
- // 1. Processed hierarchically to 32i blcok using the unpack intrinsics.
+ // 1. Processed hierarchically to 32i block using the unpack intrinsics.
// 2. Pack 128i block using _mm256_permutevar8x32_epi32.
// 3. Pack final 256i block with _mm256_permute2x128_si256.
constexpr size_t kNumUnpack = 3U;
@@ -534,7 +534,7 @@ void ByteStreamSplitEncodeAvx512(const uint8_t* raw_values,
const size_t num_val
final_result[7] = _mm512_shuffle_i32x4(shuffle[6], shuffle[7],
0b11011101);
} else {
// Path for float.
- // 1. Processed hierarchically to 32i blcok using the unpack intrinsics.
+ // 1. Processed hierarchically to 32i block using the unpack intrinsics.
// 2. Pack 128i block using _mm256_permutevar8x32_epi32.
// 3. Pack final 256i block with _mm256_permute2x128_si256.
for (size_t i = 0; i < kNumStreams; ++i)
diff --git a/cpp/src/arrow/util/byte_stream_split_test.cc
b/cpp/src/arrow/util/byte_stream_split_test.cc
index 3ea27f57da..c98f0a0867 100644
--- a/cpp/src/arrow/util/byte_stream_split_test.cc
+++ b/cpp/src/arrow/util/byte_stream_split_test.cc
@@ -49,8 +49,8 @@ struct NamedFunc {
};
// A simplistic reference implementation for validation
-void RefererenceByteStreamSplitEncode(const uint8_t* src, int width,
- const int64_t num_values, uint8_t* dest)
{
+void ReferenceByteStreamSplitEncode(const uint8_t* src, int width,
+ const int64_t num_values, uint8_t* dest) {
for (int64_t i = 0; i < num_values; ++i) {
for (int stream = 0; stream < width; ++stream) {
dest[stream * num_values + i] = *src++;
@@ -129,7 +129,7 @@ class TestByteStreamSplitSpecialized : public
::testing::Test {
protected:
static void ReferenceEncode(const uint8_t* raw_values, const int64_t
num_values,
uint8_t* output_buffer_raw) {
- RefererenceByteStreamSplitEncode(raw_values, kWidth, num_values,
output_buffer_raw);
+ ReferenceByteStreamSplitEncode(raw_values, kWidth, num_values,
output_buffer_raw);
}
static std::vector<T> MakeRandomInput(int64_t num_values) {
diff --git a/cpp/src/arrow/util/decimal.cc b/cpp/src/arrow/util/decimal.cc
index 13709aa2f0..ce71def497 100644
--- a/cpp/src/arrow/util/decimal.cc
+++ b/cpp/src/arrow/util/decimal.cc
@@ -312,7 +312,7 @@ struct Decimal128RealConversion
return x;
}
- /// An appoximate conversion from Decimal128 to Real that guarantees:
+ /// An approximate conversion from Decimal128 to Real that guarantees:
/// 1. If the decimal is an integer, the conversion is exact.
/// 2. If the number of fractional digits is <=
RealTraits<Real>::kMantissaDigits (e.g.
/// 8 for float and 16 for double), the conversion is within 1 ULP of the
exact
@@ -1006,7 +1006,7 @@ struct Decimal256RealConversion
return x;
}
- /// An appoximate conversion from Decimal256 to Real that guarantees:
+ /// An approximate conversion from Decimal256 to Real that guarantees:
/// 1. If the decimal is an integer, the conversion is exact.
/// 2. If the number of fractional digits is <=
RealTraits<Real>::kMantissaDigits (e.g.
/// 8 for float and 16 for double), the conversion is within 1 ULP of the
exact
diff --git a/cpp/src/arrow/util/future.h b/cpp/src/arrow/util/future.h
index 17c641c31c..283b581a51 100644
--- a/cpp/src/arrow/util/future.h
+++ b/cpp/src/arrow/util/future.h
@@ -435,7 +435,7 @@ class [[nodiscard]] Future {
return MakeFinished(E::ToResult(std::move(s)));
}
- struct WrapResultyOnComplete {
+ struct WrapResultOnComplete {
template <typename OnComplete>
struct Callback {
void operator()(const FutureImpl& impl) && {
@@ -461,7 +461,7 @@ class [[nodiscard]] Future {
template <typename OnComplete>
using WrapOnComplete = typename std::conditional<
detail::first_arg_is_status<OnComplete>::value, WrapStatusyOnComplete,
- WrapResultyOnComplete>::type::template Callback<OnComplete>;
+ WrapResultOnComplete>::type::template Callback<OnComplete>;
/// \brief Consumer API: Register a callback to run when this future
completes
///
diff --git a/cpp/src/arrow/util/int_util.h b/cpp/src/arrow/util/int_util.h
index 5ce9dc2820..59a2ac7109 100644
--- a/cpp/src/arrow/util/int_util.h
+++ b/cpp/src/arrow/util/int_util.h
@@ -113,7 +113,7 @@ Status CheckIntegersInRange(const ArraySpan& values, const
Scalar& bound_lower,
ARROW_EXPORT
Status IntegersCanFit(const ArraySpan& values, const DataType& target_type);
-/// \brief Convenience for boundschecking a single Scalar vlue
+/// \brief Convenience for boundschecking a single Scalar value
ARROW_EXPORT
Status IntegersCanFit(const Scalar& value, const DataType& target_type);
diff --git a/cpp/src/arrow/util/io_util.cc b/cpp/src/arrow/util/io_util.cc
index ac92618ff6..751ef28d41 100644
--- a/cpp/src/arrow/util/io_util.cc
+++ b/cpp/src/arrow/util/io_util.cc
@@ -1466,7 +1466,7 @@ Status MemoryMapRemap(void* addr, size_t old_size, size_t
new_size, int fildes,
return StatusFromMmapErrno("ftruncate failed");
}
// we set READ / WRITE flags on the new map, since we could only have
- // unlarged a RW map in the first place
+ // enlarged a RW map in the first place
*new_addr = mmap(NULL, new_size, PROT_READ | PROT_WRITE, MAP_SHARED, fildes,
0);
if (*new_addr == MAP_FAILED) {
return StatusFromMmapErrno("mmap failed");
diff --git a/cpp/src/arrow/util/iterator.h b/cpp/src/arrow/util/iterator.h
index 0eae7f6a85..5e716d0fd1 100644
--- a/cpp/src/arrow/util/iterator.h
+++ b/cpp/src/arrow/util/iterator.h
@@ -50,7 +50,7 @@ struct IterationTraits {
static T End() { return T(NULLPTR); }
/// \brief Checks to see if the value is a terminal value.
- /// A method is used here since T is not neccesarily comparable in many
+ /// A method is used here since T is not necessarily comparable in many
/// cases even though it has a distinct final value
static bool IsEnd(const T& val) { return val == End(); }
};
diff --git a/cpp/src/arrow/util/list_util.h b/cpp/src/arrow/util/list_util.h
index 467f4eb15e..58deb8019d 100644
--- a/cpp/src/arrow/util/list_util.h
+++ b/cpp/src/arrow/util/list_util.h
@@ -40,7 +40,7 @@ ARROW_EXPORT Result<std::pair<int64_t, int64_t>>
RangeOfValuesUsed(
///
/// This is usually the same as the length of the RangeOfValuesUsed() range,
but
/// it can be:
-/// - Smaller: when the child array constains many values that are not
+/// - Smaller: when the child array contains many values that are not
/// referenced by the lists or list-views in the parent array
/// - Greater: when the list-views share child array ranges
///
diff --git a/cpp/src/arrow/util/logging.cc b/cpp/src/arrow/util/logging.cc
index 6d275fa286..9c68982a3d 100644
--- a/cpp/src/arrow/util/logging.cc
+++ b/cpp/src/arrow/util/logging.cc
@@ -148,7 +148,7 @@ void ArrowLog::StartArrowLog(const std::string& app_name,
#ifdef ARROW_USE_GLOG
int mapped_severity_threshold = GetMappedSeverity(severity_threshold_);
google::SetStderrLogging(mapped_severity_threshold);
- // Enble log file if log_dir is not empty.
+ // Enable log file if log_dir is not empty.
if (!log_dir.empty()) {
auto dir_ends_with_slash = log_dir;
if (log_dir[log_dir.length() - 1] != '/') {
diff --git a/cpp/src/arrow/util/ree_util.cc b/cpp/src/arrow/util/ree_util.cc
index 819de5eb60..83fb4d3a9a 100644
--- a/cpp/src/arrow/util/ree_util.cc
+++ b/cpp/src/arrow/util/ree_util.cc
@@ -69,7 +69,7 @@ int64_t
FindPhysicalIndexImpl(PhysicalIndexFinder<RunEndCType>& self, int64_t i)
DCHECK_LT(i, self.array_span.length);
const int64_t run_ends_size = ree_util::RunEndsArray(self.array_span).length;
DCHECK_LT(self.last_physical_index, run_ends_size);
- // This access to self.run_ends[last_physical_index] is alwas safe because:
+ // This access to self.run_ends[last_physical_index] is always safe because:
// 1. 0 <= i < array_span.length() implies there is at least one run and the
initial
// value 0 will be safe to index with.
// 2. last_physical_index > 0 is always the result of a valid call to
diff --git a/cpp/src/arrow/util/ree_util.h b/cpp/src/arrow/util/ree_util.h
index 2b7940154a..a3e745ba83 100644
--- a/cpp/src/arrow/util/ree_util.h
+++ b/cpp/src/arrow/util/ree_util.h
@@ -128,7 +128,7 @@ int64_t FindPhysicalIndex(const ArraySpan& span, int64_t i,
int64_t absolute_off
/// run-ends) necessary to represent the logical range of values from
/// offset to length.
///
-/// Avoid calling this function if the physical length can be estabilished in
+/// Avoid calling this function if the physical length can be established in
/// some other way (e.g. when iterating over the runs sequentially until the
/// end). This function uses binary-search, so it has a O(log N) cost.
template <typename RunEndCType>
@@ -217,7 +217,7 @@ ARROW_EXPORT int64_t FindPhysicalIndex(const ArraySpan&
span, int64_t i,
/// run-ends) necessary to represent the logical range of values from
/// offset to length.
///
-/// Avoid calling this function if the physical length can be estabilished in
+/// Avoid calling this function if the physical length can be established in
/// some other way (e.g. when iterating over the runs sequentially until the
/// end). This function uses binary-search, so it has a O(log N) cost.
ARROW_EXPORT int64_t FindPhysicalLength(const ArraySpan& span);
diff --git a/cpp/src/arrow/util/ree_util_test.cc
b/cpp/src/arrow/util/ree_util_test.cc
index 966cbd8f38..08a6a39b98 100644
--- a/cpp/src/arrow/util/ree_util_test.cc
+++ b/cpp/src/arrow/util/ree_util_test.cc
@@ -101,7 +101,7 @@ TYPED_TEST_P(ReeUtilTest, PhysicalLength) {
ASSERT_EQ(internal::FindPhysicalLength(run_ends246, 4, 0, 7), 0);
}
-TYPED_TEST_P(ReeUtilTest, MergedRunsInterator) {
+TYPED_TEST_P(ReeUtilTest, MergedRunsIteratorTest) {
// Construct the following two test arrays with a lot of different offsets
to test the
// REE iterator: left:
//
@@ -387,7 +387,7 @@ TYPED_TEST_P(ReeUtilTest, MergedRunsInterator) {
}
REGISTER_TYPED_TEST_SUITE_P(ReeUtilTest, PhysicalIndex, PhysicalLength,
- MergedRunsInterator);
+ MergedRunsIteratorTest);
using RunEndsTypes = testing::Types<int16_t, int32_t, int64_t>;
INSTANTIATE_TYPED_TEST_SUITE_P(ReeUtilTest, ReeUtilTest, RunEndsTypes);
diff --git a/cpp/src/arrow/util/rle_encoding.h
b/cpp/src/arrow/util/rle_encoding.h
index 3a517d24b4..e0f5690062 100644
--- a/cpp/src/arrow/util/rle_encoding.h
+++ b/cpp/src/arrow/util/rle_encoding.h
@@ -61,7 +61,7 @@ namespace util {
/// on a byte boundary without padding.
/// Given that we know it is a multiple of 8, we store the number of 8-groups
rather than
/// the actual number of encoded ints. (This means that the total number of
encoded values
-/// can not be determined from the encoded data, since the number of values in
the last
+/// cannot be determined from the encoded data, since the number of values in
the last
/// group may not be a multiple of 8). For the last group of literal runs, we
pad
/// the group to 8 with zeros. This allows for 8 at a time decoding on the
read side
/// without the need for additional checks.
diff --git a/cpp/src/arrow/util/string_test.cc
b/cpp/src/arrow/util/string_test.cc
index 5f8054f121..f222b938d5 100644
--- a/cpp/src/arrow/util/string_test.cc
+++ b/cpp/src/arrow/util/string_test.cc
@@ -136,7 +136,7 @@ TEST(SplitString, OuterLeftAndOuterRightDelimiter) {
EXPECT_EQ(parts[4], "");
}
-TEST(SplitString, OnlyDemiliter) {
+TEST(SplitString, OnlyDelimiter) {
std::string input = ":";
auto parts = SplitString(input, ':');
ASSERT_EQ(parts.size(), 2);
diff --git a/cpp/src/arrow/util/tdigest.cc b/cpp/src/arrow/util/tdigest.cc
index ee84a5ef6b..ca864d9836 100644
--- a/cpp/src/arrow/util/tdigest.cc
+++ b/cpp/src/arrow/util/tdigest.cc
@@ -341,7 +341,7 @@ class TDigest::TDigestImpl {
double total_weight() const { return total_weight_; }
private:
- // must be delcared before merger_, see constructor initialization list
+ // must be declared before merger_, see constructor initialization list
const uint32_t delta_;
TDigestMerger<> merger_;
diff --git a/cpp/src/arrow/util/tdigest_test.cc
b/cpp/src/arrow/util/tdigest_test.cc
index f501285b34..63395b676a 100644
--- a/cpp/src/arrow/util/tdigest_test.cc
+++ b/cpp/src/arrow/util/tdigest_test.cc
@@ -44,7 +44,7 @@ TEST(TDigestTest, SingleValue) {
TDigest td;
td.Add(value);
ASSERT_OK(td.Validate());
- // all quantiles equal to same single vaue
+ // all quantiles equal to same single value
for (double q = 0; q <= 1; q += 0.1) {
EXPECT_EQ(td.Quantile(q), value);
}
diff --git a/cpp/src/arrow/util/thread_pool_test.cc
b/cpp/src/arrow/util/thread_pool_test.cc
index ad30ca2e80..8f43bb8dec 100644
--- a/cpp/src/arrow/util/thread_pool_test.cc
+++ b/cpp/src/arrow/util/thread_pool_test.cc
@@ -699,7 +699,7 @@ TEST_F(TestThreadPool, SetCapacity) {
}
ASSERT_OK(gating_task->WaitForRunning(3));
SleepFor(0.001); // Sleep a bit just to make sure it isn't making any
threads
- ASSERT_EQ(pool->GetActualCapacity(), 3); // maxxed out
+ ASSERT_EQ(pool->GetActualCapacity(), 3); // maxed out
// The tasks have not finished yet, increasing the desired capacity
// should spawn threads immediately.