This is an automated email from the ASF dual-hosted git repository.
kou 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 72cf412065 GH-38956: [Gandiva] Fix spelling (#38957)
72cf412065 is described below
commit 72cf412065a16f430551a51db4c2ecbab5cb700b
Author: Josh Soref <[email protected]>
AuthorDate: Sun Dec 10 10:19:18 2023 -0500
GH-38956: [Gandiva] Fix spelling (#38957)
### Rationale for this change
### What changes are included in this PR?
Spelling fixes to cpp/src/gandiva/
### Are these changes tested?
### Are there any user-facing changes?
* Closes: #38956
Authored-by: Josh Soref <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/src/gandiva/date_utils.cc | 2 +-
cpp/src/gandiva/expr_decomposer.cc | 2 +-
cpp/src/gandiva/expr_decomposer_test.cc | 6 +++---
cpp/src/gandiva/expr_validator.cc | 2 +-
cpp/src/gandiva/expression_cache_key.h | 22 +++++++++----------
cpp/src/gandiva/gdv_function_stubs.cc | 16 +++++++-------
cpp/src/gandiva/gdv_function_stubs.h | 5 +++--
cpp/src/gandiva/gdv_function_stubs_test.cc | 8 +++----
cpp/src/gandiva/gdv_string_function_stubs.cc | 4 ++--
cpp/src/gandiva/hash_utils_test.cc | 8 +++----
cpp/src/gandiva/interval_holder.cc | 6 +++---
cpp/src/gandiva/interval_holder.h | 14 ++++++------
cpp/src/gandiva/llvm_generator.h | 2 +-
cpp/src/gandiva/precompiled/decimal_ops.cc | 4 ++--
cpp/src/gandiva/precompiled/string_ops.cc | 8 +++----
cpp/src/gandiva/precompiled/string_ops_test.cc | 30 +++++++++++++-------------
16 files changed, 70 insertions(+), 69 deletions(-)
diff --git a/cpp/src/gandiva/date_utils.cc b/cpp/src/gandiva/date_utils.cc
index f0a80d3c95..9d9f500f12 100644
--- a/cpp/src/gandiva/date_utils.cc
+++ b/cpp/src/gandiva/date_utils.cc
@@ -26,7 +26,7 @@
namespace gandiva {
std::vector<std::string> DateUtils::GetMatches(std::string pattern, bool
exactMatch) {
- // we are case insensitive
+ // we are case-insensitive
std::transform(pattern.begin(), pattern.end(), pattern.begin(), ::tolower);
std::vector<std::string> matches;
diff --git a/cpp/src/gandiva/expr_decomposer.cc
b/cpp/src/gandiva/expr_decomposer.cc
index 42566ca035..df8eed5fd6 100644
--- a/cpp/src/gandiva/expr_decomposer.cc
+++ b/cpp/src/gandiva/expr_decomposer.cc
@@ -248,7 +248,7 @@ Status ExprDecomposer::Visit(const LiteralNode& node) {
return Status::OK();
}
-// The bolow functions use a stack to detect :
+// The below functions use a stack to detect :
// a. nested if-else expressions.
// In such cases, the local bitmap can be re-used.
// b. detect terminal else expressions
diff --git a/cpp/src/gandiva/expr_decomposer_test.cc
b/cpp/src/gandiva/expr_decomposer_test.cc
index 7681d9e646..194c13bc82 100644
--- a/cpp/src/gandiva/expr_decomposer_test.cc
+++ b/cpp/src/gandiva/expr_decomposer_test.cc
@@ -333,7 +333,7 @@ TEST_F(TestExprDecomposer, TestComplexIfCondition) {
int idx_cond_a_inner_if = decomposer.PushThenEntry(cond_node_a_inner_if,
true);
EXPECT_EQ(idx_cond_a_inner_if,
- 0); // expect bitmap to be resused since nested if else
+ 0); // expect bitmap to be reused since nested if else
decomposer.PopThenEntry(cond_node_a_inner_if);
decomposer.PushElseEntry(cond_node_a_inner_if, idx_cond_a_inner_if);
@@ -363,7 +363,7 @@ TEST_F(TestExprDecomposer, TestComplexIfCondition) {
int idx_then_a_inner_if = decomposer.PushThenEntry(then_node_a_inner_if,
true);
EXPECT_EQ(idx_then_a_inner_if,
- 2); // expect bitmap to be resused since nested if else
+ 2); // expect bitmap to be reused since nested if else
decomposer.PopThenEntry(then_node_a_inner_if);
decomposer.PushElseEntry(then_node_a_inner_if, idx_then_a_inner_if);
@@ -392,7 +392,7 @@ TEST_F(TestExprDecomposer, TestComplexIfCondition) {
int idx_else_a_inner_if = decomposer.PushThenEntry(else_node_a_inner_if,
true);
EXPECT_EQ(idx_else_a_inner_if,
- 1); // expect bitmap to be resused since nested if else
+ 1); // expect bitmap to be reused since nested if else
decomposer.PopThenEntry(else_node_a_inner_if);
decomposer.PushElseEntry(else_node_a_inner_if, idx_else_a_inner_if);
diff --git a/cpp/src/gandiva/expr_validator.cc
b/cpp/src/gandiva/expr_validator.cc
index 8a6f86e6f0..cd76ffe082 100644
--- a/cpp/src/gandiva/expr_validator.cc
+++ b/cpp/src/gandiva/expr_validator.cc
@@ -79,7 +79,7 @@ Status ExprValidator::Visit(const FieldNode& node) {
Status::ExpressionValidationError("Field ",
node.field()->name(),
" not in schema."));
- // Ensure that that the found field match.
+ // Ensure that the found field matches.
FieldPtr field_in_schema = field_in_schema_entry->second;
ARROW_RETURN_IF(!field_in_schema->Equals(node.field()),
Status::ExpressionValidationError(
diff --git a/cpp/src/gandiva/expression_cache_key.h
b/cpp/src/gandiva/expression_cache_key.h
index db174d0642..e7522042a7 100644
--- a/cpp/src/gandiva/expression_cache_key.h
+++ b/cpp/src/gandiva/expression_cache_key.h
@@ -34,19 +34,19 @@ class ExpressionCacheKey {
public:
ExpressionCacheKey(SchemaPtr schema, std::shared_ptr<Configuration>
configuration,
ExpressionVector expression_vector, SelectionVector::Mode
mode)
- : schema_(schema), mode_(mode), uniqifier_(0),
configuration_(configuration) {
+ : schema_(schema), mode_(mode), uniquifier_(0),
configuration_(configuration) {
static const int kSeedValue = 4;
size_t result = kSeedValue;
for (auto& expr : expression_vector) {
std::string expr_as_string = expr->ToString();
expressions_as_strings_.push_back(expr_as_string);
arrow::internal::hash_combine(result, expr_as_string);
- UpdateUniqifier(expr_as_string);
+ UpdateUniquifier(expr_as_string);
}
arrow::internal::hash_combine(result, static_cast<size_t>(mode));
arrow::internal::hash_combine(result, configuration->Hash());
arrow::internal::hash_combine(result, schema_->ToString());
- arrow::internal::hash_combine(result, uniqifier_);
+ arrow::internal::hash_combine(result, uniquifier_);
hash_code_ = result;
}
@@ -54,25 +54,25 @@ class ExpressionCacheKey {
Expression& expression)
: schema_(schema),
mode_(SelectionVector::MODE_NONE),
- uniqifier_(0),
+ uniquifier_(0),
configuration_(configuration) {
static const int kSeedValue = 4;
size_t result = kSeedValue;
expressions_as_strings_.push_back(expression.ToString());
- UpdateUniqifier(expression.ToString());
+ UpdateUniquifier(expression.ToString());
arrow::internal::hash_combine(result, configuration->Hash());
arrow::internal::hash_combine(result, schema_->ToString());
- arrow::internal::hash_combine(result, uniqifier_);
+ arrow::internal::hash_combine(result, uniquifier_);
hash_code_ = result;
}
- void UpdateUniqifier(const std::string& expr) {
- if (uniqifier_ == 0) {
+ void UpdateUniquifier(const std::string& expr) {
+ if (uniquifier_ == 0) {
// caching of expressions with re2 patterns causes lock contention. So,
use
// multiple instances to reduce contention.
if (expr.find(" like(") != std::string::npos) {
- uniqifier_ = std::hash<std::thread::id>()(std::this_thread::get_id())
% 16;
+ uniquifier_ = std::hash<std::thread::id>()(std::this_thread::get_id())
% 16;
}
}
}
@@ -100,7 +100,7 @@ class ExpressionCacheKey {
return false;
}
- if (uniqifier_ != other.uniqifier_) {
+ if (uniquifier_ != other.uniquifier_) {
return false;
}
@@ -114,7 +114,7 @@ class ExpressionCacheKey {
SchemaPtr schema_;
std::vector<std::string> expressions_as_strings_;
SelectionVector::Mode mode_;
- uint32_t uniqifier_;
+ uint32_t uniquifier_;
std::shared_ptr<Configuration> configuration_;
};
diff --git a/cpp/src/gandiva/gdv_function_stubs.cc
b/cpp/src/gandiva/gdv_function_stubs.cc
index 0ad3c1738e..bcef954a47 100644
--- a/cpp/src/gandiva/gdv_function_stubs.cc
+++ b/cpp/src/gandiva/gdv_function_stubs.cc
@@ -209,7 +209,7 @@ GANDIVA_EXPORT
const char* gdv_fn_base64_encode_binary(int64_t context, const char* in,
int32_t in_len,
int32_t* out_len) {
if (in_len < 0) {
- gdv_fn_context_set_error_msg(context, "Buffer length can not be negative");
+ gdv_fn_context_set_error_msg(context, "Buffer length cannot be negative");
*out_len = 0;
return "";
}
@@ -236,7 +236,7 @@ GANDIVA_EXPORT
const char* gdv_fn_base64_decode_utf8(int64_t context, const char* in, int32_t
in_len,
int32_t* out_len) {
if (in_len < 0) {
- gdv_fn_context_set_error_msg(context, "Buffer length can not be negative");
+ gdv_fn_context_set_error_msg(context, "Buffer length cannot be negative");
*out_len = 0;
return "";
}
@@ -743,17 +743,17 @@ int32_t gdv_fn_cast_intervalyear_utf8_int32(int64_t
context_ptr, int64_t holder_
}
GANDIVA_EXPORT
-gdv_timestamp to_utc_timezone_timestamp(int64_t context, gdv_timestamp
time_miliseconds,
+gdv_timestamp to_utc_timezone_timestamp(int64_t context, gdv_timestamp
time_milliseconds,
const char* timezone, gdv_int32
length) {
using arrow_vendored::date::locate_zone;
using arrow_vendored::date::sys_time;
using std::chrono::milliseconds;
- sys_time<milliseconds> tp{milliseconds{time_miliseconds}};
+ sys_time<milliseconds> tp{milliseconds{time_milliseconds}};
try {
const auto local_tz = locate_zone(std::string(timezone, length));
gdv_timestamp offset = local_tz->get_info(tp).offset.count() * 1000;
- return time_miliseconds - static_cast<gdv_timestamp>(offset);
+ return time_milliseconds - static_cast<gdv_timestamp>(offset);
} catch (...) {
std::string e_msg = std::string(timezone, length) + " is an invalid time
zone name.";
gdv_fn_context_set_error_msg(context, e_msg.c_str());
@@ -763,17 +763,17 @@ gdv_timestamp to_utc_timezone_timestamp(int64_t context,
gdv_timestamp time_mili
GANDIVA_EXPORT
gdv_timestamp from_utc_timezone_timestamp(gdv_int64 context,
- gdv_timestamp time_miliseconds,
+ gdv_timestamp time_milliseconds,
const char* timezone, gdv_int32
length) {
using arrow_vendored::date::sys_time;
using arrow_vendored::date::zoned_time;
using std::chrono::milliseconds;
- const sys_time<milliseconds> tp{milliseconds{time_miliseconds}};
+ const sys_time<milliseconds> tp{milliseconds{time_milliseconds}};
try {
const zoned_time<milliseconds> local_tz{std::string(timezone, length), tp};
gdv_timestamp offset =
local_tz.get_time_zone()->get_info(tp).offset.count() * 1000;
- return time_miliseconds + static_cast<gdv_timestamp>(offset);
+ return time_milliseconds + static_cast<gdv_timestamp>(offset);
} catch (...) {
std::string e_msg = std::string(timezone, length) + " is an invalid time
zone name.";
gdv_fn_context_set_error_msg(context, e_msg.c_str());
diff --git a/cpp/src/gandiva/gdv_function_stubs.h
b/cpp/src/gandiva/gdv_function_stubs.h
index 3f52537ee0..8e87bc5121 100644
--- a/cpp/src/gandiva/gdv_function_stubs.h
+++ b/cpp/src/gandiva/gdv_function_stubs.h
@@ -342,11 +342,12 @@ const char* translate_utf8_utf8_utf8(int64_t context,
const char* in, int32_t in
int32_t to_len, int32_t* out_len);
GANDIVA_EXPORT
-gdv_timestamp to_utc_timezone_timestamp(int64_t context, gdv_timestamp
time_miliseconds,
+gdv_timestamp to_utc_timezone_timestamp(int64_t context, gdv_timestamp
time_milliseconds,
const char* timezone, int32_t length);
GANDIVA_EXPORT
-gdv_timestamp from_utc_timezone_timestamp(int64_t context, gdv_timestamp
time_miliseconds,
+gdv_timestamp from_utc_timezone_timestamp(int64_t context,
+ gdv_timestamp time_milliseconds,
const char* timezone, int32_t
length);
GANDIVA_EXPORT
diff --git a/cpp/src/gandiva/gdv_function_stubs_test.cc
b/cpp/src/gandiva/gdv_function_stubs_test.cc
index a8dfcd088a..3e403828a4 100644
--- a/cpp/src/gandiva/gdv_function_stubs_test.cc
+++ b/cpp/src/gandiva/gdv_function_stubs_test.cc
@@ -73,7 +73,7 @@ TEST(TestGdvFnStubs, TestCastVarbinaryNumeric) {
EXPECT_FALSE(ctx.has_error());
gdv_fn_castVARBINARY_int32_int64(ctx_ptr, 347, -1, &out_len);
- EXPECT_THAT(ctx.get_error(), ::testing::HasSubstr("Buffer length can not be
negative"));
+ EXPECT_THAT(ctx.get_error(), ::testing::HasSubstr("Buffer length cannot be
negative"));
ctx.Reset();
// tests for big integer values as input
@@ -122,7 +122,7 @@ TEST(TestGdvFnStubs, TestBase64Encode) {
value = gdv_fn_base64_encode_binary(ctx_ptr, "test", -5, &out_len);
out_value = std::string(value, out_len);
EXPECT_EQ(out_value, "");
- EXPECT_THAT(ctx.get_error(), ::testing::HasSubstr("Buffer length can not be
negative"));
+ EXPECT_THAT(ctx.get_error(), ::testing::HasSubstr("Buffer length cannot be
negative"));
ctx.Reset();
}
@@ -151,7 +151,7 @@ TEST(TestGdvFnStubs, TestBase64Decode) {
value = gdv_fn_base64_decode_utf8(ctx_ptr, "test", -5, &out_len);
out_value = std::string(value, out_len);
EXPECT_EQ(out_value, "");
- EXPECT_THAT(ctx.get_error(), ::testing::HasSubstr("Buffer length can not be
negative"));
+ EXPECT_THAT(ctx.get_error(), ::testing::HasSubstr("Buffer length cannot be
negative"));
ctx.Reset();
}
@@ -323,7 +323,7 @@ TEST(TestGdvFnStubs, TestCastVARCHARFromInt32) {
EXPECT_FALSE(ctx.has_error());
out_str = gdv_fn_castVARCHAR_int32_int64(ctx_ptr, 347, -1, &out_len);
- EXPECT_THAT(ctx.get_error(), ::testing::HasSubstr("Buffer length can not be
negative"));
+ EXPECT_THAT(ctx.get_error(), ::testing::HasSubstr("Buffer length cannot be
negative"));
ctx.Reset();
}
diff --git a/cpp/src/gandiva/gdv_string_function_stubs.cc
b/cpp/src/gandiva/gdv_string_function_stubs.cc
index 9f5b5ce64b..17eefbe22e 100644
--- a/cpp/src/gandiva/gdv_string_function_stubs.cc
+++ b/cpp/src/gandiva/gdv_string_function_stubs.cc
@@ -84,7 +84,7 @@ const char* gdv_fn_regexp_extract_utf8_utf8_int32(int64_t
ptr, int64_t holder_pt
const char* gdv_fn_cast##CAST_NAME##_##IN_TYPE##_int64(
\
int64_t context, gdv_##IN_TYPE value, int64_t len, int32_t * out_len) {
\
if (len < 0) {
\
- gdv_fn_context_set_error_msg(context, "Buffer length can not be
negative"); \
+ gdv_fn_context_set_error_msg(context, "Buffer length cannot be
negative"); \
*out_len = 0;
\
return "";
\
}
\
@@ -120,7 +120,7 @@ const char* gdv_fn_regexp_extract_utf8_utf8_int32(int64_t
ptr, int64_t holder_pt
const char* gdv_fn_cast##CAST_NAME##_##IN_TYPE##_int64(
\
int64_t context, gdv_##IN_TYPE value, int64_t len, int32_t * out_len) {
\
if (len < 0) {
\
- gdv_fn_context_set_error_msg(context, "Buffer length can not be
negative"); \
+ gdv_fn_context_set_error_msg(context, "Buffer length cannot be
negative"); \
*out_len = 0;
\
return "";
\
}
\
diff --git a/cpp/src/gandiva/hash_utils_test.cc
b/cpp/src/gandiva/hash_utils_test.cc
index 96f9819e53..6538502332 100644
--- a/cpp/src/gandiva/hash_utils_test.cc
+++ b/cpp/src/gandiva/hash_utils_test.cc
@@ -50,7 +50,7 @@ TEST(TestShaHashUtils, TestSha1Numeric) {
std::string sha1_as_str(sha_1, out_length);
EXPECT_EQ(sha1_as_str.size(), sha1_size);
- // The value can not exists inside the set with the hash results
+ // The value cannot exists inside the set with the hash results
EXPECT_EQ(sha_values.find(sha1_as_str), sha_values.end());
sha_values.insert(sha1_as_str);
}
@@ -85,7 +85,7 @@ TEST(TestShaHashUtils, TestSha512Numeric) {
std::string sha512_as_str(sha_512, out_length);
EXPECT_EQ(sha512_as_str.size(), sha512_size);
- // The value can not exists inside the set with the hash results
+ // The value cannot exists inside the set with the hash results
EXPECT_EQ(sha_values.find(sha512_as_str), sha_values.end());
sha_values.insert(sha512_as_str);
}
@@ -120,7 +120,7 @@ TEST(TestShaHashUtils, TestSha256Numeric) {
std::string sha256_as_str(sha_256, out_length);
EXPECT_EQ(sha256_as_str.size(), sha256_size);
- // The value can not exists inside the set with the hash results
+ // The value cannot exists inside the set with the hash results
EXPECT_EQ(sha_values.find(sha256_as_str), sha_values.end());
sha_values.insert(sha256_as_str);
}
@@ -154,7 +154,7 @@ TEST(TestShaHashUtils, TestMD5Numeric) {
std::string md5_as_str(md5, out_length);
EXPECT_EQ(md5_as_str.size(), md5_size);
- // The value can not exists inside the set with the hash results
+ // The value cannot exists inside the set with the hash results
EXPECT_EQ(md5_values.find(md5_as_str), md5_values.end());
md5_values.insert(md5_as_str);
}
diff --git a/cpp/src/gandiva/interval_holder.cc
b/cpp/src/gandiva/interval_holder.cc
index 70f7792635..73e75009d5 100644
--- a/cpp/src/gandiva/interval_holder.cc
+++ b/cpp/src/gandiva/interval_holder.cc
@@ -48,7 +48,7 @@ static const RE2 iso8601_period_without_time(
static const std::regex period_not_contains_time(R"(^((?!T).)*$)");
// pre-compiled pattern for matching periods in 8601 formats that contains
weeks inside
-// them. The ISO8601 specification defines that if the string contains a week,
it can not
+// them. The ISO8601 specification defines that if the string contains a week,
it cannot
// have other time granularities information, like day, years and months.
static const RE2 iso8601_period_with_weeks(
R"(P(-?[[:digit:]]+W|-?[[:digit:]]+[,.][[:digit:]]+W){1})");
@@ -61,8 +61,8 @@ static const int64_t kMillisInAMinute = 60000;
static const int64_t kMillisInASecond = 1000;
static void return_error_with_cause(ExecutionContext* context, std::string&
data,
- int32_t supression_error) {
- if (supression_error != 0) {
+ int32_t suppression_error) {
+ if (suppression_error != 0) {
return;
}
diff --git a/cpp/src/gandiva/interval_holder.h
b/cpp/src/gandiva/interval_holder.h
index 0a6a988025..faa7c9f060 100644
--- a/cpp/src/gandiva/interval_holder.h
+++ b/cpp/src/gandiva/interval_holder.h
@@ -70,7 +70,7 @@ class GANDIVA_EXPORT IntervalHolder : public FunctionHolder {
return std::make_shared<INTERVAL_TYPE>(suppress_errors);
}
- explicit IntervalHolder(int32_t supress_errors) :
suppress_errors_(supress_errors) {}
+ explicit IntervalHolder(int32_t suppress_errors) :
suppress_errors_(suppress_errors) {}
// If the flag is equals to 0, the errors will not be suppressed, any other
value
// will made the errors being suppressed
@@ -99,17 +99,17 @@ class GANDIVA_EXPORT IntervalDaysHolder : public
IntervalHolder<IntervalDaysHold
int64_t operator()(ExecutionContext* ctx, const char* data, int32_t data_len,
bool in_valid, bool* out_valid);
- explicit IntervalDaysHolder(int32_t supress_errors)
- : IntervalHolder<IntervalDaysHolder>(supress_errors) {}
+ explicit IntervalDaysHolder(int32_t suppress_errors)
+ : IntervalHolder<IntervalDaysHolder>(suppress_errors) {}
private:
- /// Retrieves the day interval from the number of milliseconds enconded as
+ /// Retrieves the day interval from the number of milliseconds encoded as
/// a string
static int64_t GetIntervalDayFromMillis(ExecutionContext* context,
std::string& number_as_string,
int32_t suppress_errors, bool*
out_valid);
- /// Retrieves the day interval from the number of weeks enconded as
+ /// Retrieves the day interval from the number of weeks encoded as
/// a string.
static int64_t GetIntervalDayFromWeeks(ExecutionContext* context,
std::string& number_as_string,
@@ -134,8 +134,8 @@ class GANDIVA_EXPORT IntervalYearsHolder : public
IntervalHolder<IntervalYearsHo
int32_t operator()(ExecutionContext* ctx, const char* data, int32_t data_len,
bool in_valid, bool* out_valid);
- explicit IntervalYearsHolder(int32_t supress_errors)
- : IntervalHolder<IntervalYearsHolder>(supress_errors) {}
+ explicit IntervalYearsHolder(int32_t suppress_errors)
+ : IntervalHolder<IntervalYearsHolder>(suppress_errors) {}
private:
static int32_t GetIntervalYearFromNumber(ExecutionContext* context,
diff --git a/cpp/src/gandiva/llvm_generator.h b/cpp/src/gandiva/llvm_generator.h
index fae6ed48de..250ab78fbf 100644
--- a/cpp/src/gandiva/llvm_generator.h
+++ b/cpp/src/gandiva/llvm_generator.h
@@ -146,7 +146,7 @@ class GANDIVA_EXPORT LLVMGenerator {
const ValueValidityPairVector& args,
bool with_validity, bool
with_context);
- // Generate code to onvoke a function call.
+ // Generate code to invoke a function call.
LValuePtr BuildFunctionCall(const NativeFunction* func, DataTypePtr
arrow_return_type,
std::vector<llvm::Value*>* params);
diff --git a/cpp/src/gandiva/precompiled/decimal_ops.cc
b/cpp/src/gandiva/precompiled/decimal_ops.cc
index 61cac60624..6ecb9368fb 100644
--- a/cpp/src/gandiva/precompiled/decimal_ops.cc
+++ b/cpp/src/gandiva/precompiled/decimal_ops.cc
@@ -401,7 +401,7 @@ BasicDecimal128 Mod(int64_t context, const
BasicDecimalScalar128& x,
return 0;
}
- // Adsjust x and y to the same scale (higher one), and then, do a integer
mod.
+ // Adjust x and y to the same scale (higher one), and then, do a integer mod.
*overflow = false;
BasicDecimal128 result;
int32_t min_lz = MinLeadingZeros(x, y);
@@ -559,7 +559,7 @@ enum RoundType {
// else if -ve and trailing value is >= half of
base, -1.
};
-// Compute the rounding delta for the givven rounding type.
+// Compute the rounding delta for the given rounding type.
static int32_t ComputeRoundingDelta(const BasicDecimal128& x, int32_t x_scale,
int32_t out_scale, RoundType type) {
if (type == kRoundTypeTrunc || // no rounding for this type.
diff --git a/cpp/src/gandiva/precompiled/string_ops.cc
b/cpp/src/gandiva/precompiled/string_ops.cc
index c255b9a11c..5aa0eb38ea 100644
--- a/cpp/src/gandiva/precompiled/string_ops.cc
+++ b/cpp/src/gandiva/precompiled/string_ops.cc
@@ -1705,7 +1705,7 @@ gdv_int32 levenshtein(int64_t context, const char* in1,
int32_t in1_len, const c
return in1_len;
}
- // arr_larger and arr_smaller is one pointer for entrys
+ // arr_larger and arr_smaller is one pointer for entries
const char* arr_larger;
const char* arr_smaller;
// len_larger and len_smaller is one copy from lengths
@@ -1733,7 +1733,7 @@ gdv_int32 levenshtein(int64_t context, const char* in1,
int32_t in1_len, const c
return 0;
}
- // MEMORY ADRESS MALLOC
+ // MEMORY ADDRESS MALLOC
// v0 -> (0, ..., &ptr[in2_len])
// v1 -> (in2_len+1, ..., &ptr[in2_len * 2])
int* v0;
@@ -1742,7 +1742,7 @@ gdv_int32 levenshtein(int64_t context, const char* in1,
int32_t in1_len, const c
v0 = &ptr[0];
v1 = &ptr[len_smaller + 1];
- // Initializate v0
+ // Initialize v0
for (int i = 0; i <= len_smaller; i++) {
v0[i] = i;
}
@@ -1778,7 +1778,7 @@ gdv_int32 levenshtein(int64_t context, const char* in1,
int32_t in1_len, const c
v1[j + 1] = min;
}
- // Swaping v0 and v1
+ // Swapping v0 and v1
aux = v0;
v0 = v1;
v1 = aux;
diff --git a/cpp/src/gandiva/precompiled/string_ops_test.cc
b/cpp/src/gandiva/precompiled/string_ops_test.cc
index b84c51b3a6..89213592e7 100644
--- a/cpp/src/gandiva/precompiled/string_ops_test.cc
+++ b/cpp/src/gandiva/precompiled/string_ops_test.cc
@@ -2156,67 +2156,67 @@ TEST(TestStringOps, TestEltFunction) {
// gandiva::ExecutionContext ctx;
// int64_t ctx_ptr = reinterpret_cast<int64_t>(&ctx);
gdv_int32 out_len = 0;
- bool out_vality = false;
+ bool out_validity = false;
const char* word1 = "john";
auto word1_len = static_cast<int32_t>(strlen(word1));
const char* word2 = "";
auto word2_len = static_cast<int32_t>(strlen(word2));
auto out_string = elt_int32_utf8_utf8(1, true, word1, word1_len, true,
word2, word2_len,
- true, &out_vality, &out_len);
+ true, &out_validity, &out_len);
EXPECT_EQ("john", std::string(out_string, out_len));
- EXPECT_EQ(out_vality, true);
+ EXPECT_EQ(out_validity, true);
word1 = "hello";
word1_len = static_cast<int32_t>(strlen(word1));
word2 = "world";
word2_len = static_cast<int32_t>(strlen(word2));
out_string = elt_int32_utf8_utf8(2, true, word1, word1_len, true, word2,
word2_len,
- true, &out_vality, &out_len);
+ true, &out_validity, &out_len);
EXPECT_EQ("world", std::string(out_string, out_len));
- EXPECT_EQ(out_vality, true);
+ EXPECT_EQ(out_validity, true);
word1 = "goodbye";
word1_len = static_cast<int32_t>(strlen(word1));
word2 = "world";
word2_len = static_cast<int32_t>(strlen(word2));
out_string = elt_int32_utf8_utf8(4, true, word1, word1_len, true, word2,
word2_len,
- true, &out_vality, &out_len);
+ true, &out_validity, &out_len);
EXPECT_EQ("", std::string(out_string, out_len));
- EXPECT_EQ(out_vality, false);
+ EXPECT_EQ(out_validity, false);
word1 = "hi";
word1_len = static_cast<int32_t>(strlen(word1));
word2 = "yeah";
word2_len = static_cast<int32_t>(strlen(word2));
out_string = elt_int32_utf8_utf8(0, true, word1, word1_len, true, word2,
word2_len,
- true, &out_vality, &out_len);
+ true, &out_validity, &out_len);
EXPECT_EQ("", std::string(out_string, out_len));
- EXPECT_EQ(out_vality, false);
+ EXPECT_EQ(out_validity, false);
const char* word3 = "wow";
auto word3_len = static_cast<int32_t>(strlen(word3));
out_string =
elt_int32_utf8_utf8_utf8(3, true, word1, word1_len, true, word2,
word2_len, true,
- word3, word3_len, true, &out_vality, &out_len);
+ word3, word3_len, true, &out_validity,
&out_len);
EXPECT_EQ("wow", std::string(out_string, out_len));
- EXPECT_EQ(out_vality, true);
+ EXPECT_EQ(out_validity, true);
const char* word4 = "awesome";
auto word4_len = static_cast<int32_t>(strlen(word4));
out_string = elt_int32_utf8_utf8_utf8_utf8(
4, true, word1, word1_len, true, word2, word2_len, true, word3,
word3_len, true,
- word4, word4_len, true, &out_vality, &out_len);
+ word4, word4_len, true, &out_validity, &out_len);
EXPECT_EQ("awesome", std::string(out_string, out_len));
- EXPECT_EQ(out_vality, true);
+ EXPECT_EQ(out_validity, true);
const char* word5 = "not-empty";
auto word5_len = static_cast<int32_t>(strlen(word5));
out_string = elt_int32_utf8_utf8_utf8_utf8_utf8(
5, true, word1, word1_len, true, word2, word2_len, true, word3,
word3_len, true,
- word4, word4_len, true, word5, word5_len, true, &out_vality, &out_len);
+ word4, word4_len, true, word5, word5_len, true, &out_validity, &out_len);
EXPECT_EQ("not-empty", std::string(out_string, out_len));
- EXPECT_EQ(out_vality, true);
+ EXPECT_EQ(out_validity, true);
}
TEST(TestStringOps, TestToHex) {