This is an automated email from the ASF dual-hosted git repository.
zhangyifan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 0c16aa9d4 [common] Remove unused field from
key_util::PushLowerBoundPrimaryKeyPredicates
0c16aa9d4 is described below
commit 0c16aa9d44f8fe0d93d2552053c7ad33fd98fe2a
Author: zhangyifan27 <[email protected]>
AuthorDate: Tue Aug 20 18:10:22 2024 +0800
[common] Remove unused field from
key_util::PushLowerBoundPrimaryKeyPredicates
This patch removes the unused field 'Arena* arena' from the method
key_util::PushLowerBoundPrimaryKeyPredicates and does not contain any
functional changes.
Change-Id: I1d45194fc427f9bd193952e0637e73c24b2e16c1
Reviewed-on: http://gerrit.cloudera.org:8080/21694
Reviewed-by: Yingchun Lai <[email protected]>
Reviewed-by: Mahesh Reddy <[email protected]>
Tested-by: Yifan Zhang <[email protected]>
---
src/kudu/common/key_util.cc | 16 ++++++----------
src/kudu/common/key_util.h | 12 ++++--------
src/kudu/common/partition_pruner.cc | 2 +-
src/kudu/common/scan_spec.cc | 4 ++--
4 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/src/kudu/common/key_util.cc b/src/kudu/common/key_util.cc
index 280804f48..c55b39b02 100644
--- a/src/kudu/common/key_util.cc
+++ b/src/kudu/common/key_util.cc
@@ -278,12 +278,11 @@ int PushUpperBoundKeyPredicates(ColIdxIter first,
return pushed_predicates;
}
-template<typename ColIdxIter>
+template <typename ColIdxIter>
int PushLowerBoundKeyPredicates(ColIdxIter first,
ColIdxIter last,
const unordered_map<string, ColumnPredicate>&
predicates,
- ContiguousRow* row,
- Arena* arena) {
+ ContiguousRow* row) {
const Schema& schema = *CHECK_NOTNULL(row->schema());
int pushed_predicates = 0;
@@ -409,9 +408,8 @@ bool TryDecrementCell(const ColumnSchema &col, void
*cell_ptr) {
int PushLowerBoundKeyPredicates(const vector<int32_t>& col_idxs,
const unordered_map<string, ColumnPredicate>&
predicates,
- ContiguousRow* row,
- Arena* arena) {
- return PushLowerBoundKeyPredicates(col_idxs.begin(), col_idxs.end(),
predicates, row, arena);
+ ContiguousRow* row) {
+ return PushLowerBoundKeyPredicates(col_idxs.begin(), col_idxs.end(),
predicates, row);
}
int PushUpperBoundKeyPredicates(const vector<int32_t>& col_idxs,
@@ -422,14 +420,12 @@ int PushUpperBoundKeyPredicates(const vector<int32_t>&
col_idxs,
}
int PushLowerBoundPrimaryKeyPredicates(const unordered_map<string,
ColumnPredicate>& predicates,
- ContiguousRow* row,
- Arena* arena) {
+ ContiguousRow* row) {
int32_t num_pk_cols = row->schema()->num_key_columns();
return PushLowerBoundKeyPredicates(boost::make_counting_iterator(0),
boost::make_counting_iterator(num_pk_cols),
predicates,
- row,
- arena);
+ row);
}
int PushUpperBoundPrimaryKeyPredicates(const unordered_map<string,
ColumnPredicate>& predicates,
diff --git a/src/kudu/common/key_util.h b/src/kudu/common/key_util.h
index 23cae7dcd..99e36ac69 100644
--- a/src/kudu/common/key_util.h
+++ b/src/kudu/common/key_util.h
@@ -71,11 +71,9 @@ bool TryDecrementCell(const ColumnSchema &col, void
*cell_ptr);
// Pushes lower bound key predicates into the row. Returns the number of pushed
// predicates. Unpushed predicate columns will be set to the minimum value
// (unless no predicates are pushed at all).
-int PushLowerBoundKeyPredicates(
- const std::vector<int32_t>& col_idxs,
- const std::unordered_map<std::string, ColumnPredicate>& predicates,
- ContiguousRow* row,
- Arena* arena);
+int PushLowerBoundKeyPredicates(const std::vector<int32_t>& col_idxs,
+ const std::unordered_map<std::string,
ColumnPredicate>& predicates,
+ ContiguousRow* row);
// Pushes upper bound key predicates into the row. Returns the number of pushed
// predicates. Unpushed predicate columns will be set to the minimum value
@@ -90,9 +88,7 @@ int PushUpperBoundKeyPredicates(
// predicates. Unpushed predicate columns will be set to the minimum value
// (unless no predicates are pushed at all).
int PushLowerBoundPrimaryKeyPredicates(
- const std::unordered_map<std::string, ColumnPredicate>& predicates,
- ContiguousRow* row,
- Arena* arena);
+ const std::unordered_map<std::string, ColumnPredicate>& predicates,
ContiguousRow* row);
// Pushes upper bound key predicates into the row. Returns the number of pushed
// predicates. Unpushed predicate columns will be set to the minimum value
diff --git a/src/kudu/common/partition_pruner.cc
b/src/kudu/common/partition_pruner.cc
index 4a2a6e17b..6a1c37751 100644
--- a/src/kudu/common/partition_pruner.cc
+++ b/src/kudu/common/partition_pruner.cc
@@ -168,7 +168,7 @@ void EncodeRangeKeysFromPredicates(const Schema& schema,
uint8_t* buf =
static_cast<uint8_t*>(CHECK_NOTNULL(arena.AllocateBytes(schema.key_byte_size())));
ContiguousRow row(&schema, buf);
- if (key_util::PushLowerBoundKeyPredicates(col_idxs, predicates, &row,
&arena) > 0) {
+ if (key_util::PushLowerBoundKeyPredicates(col_idxs, predicates, &row) > 0) {
key_util::EncodeKey(col_idxs, row, range_key_start);
}
diff --git a/src/kudu/common/scan_spec.cc b/src/kudu/common/scan_spec.cc
index c5e0b2e38..30719ee06 100644
--- a/src/kudu/common/scan_spec.cc
+++ b/src/kudu/common/scan_spec.cc
@@ -233,8 +233,8 @@ void ScanSpec::PushPredicatesIntoPrimaryKeyBounds(const
Schema& schema,
ContiguousRow lower_key(&schema, lower_buf);
ContiguousRow upper_key(&schema, upper_buf);
- int lower_bound_predicates_pushed =
key_util::PushLowerBoundPrimaryKeyPredicates(
- predicates_, &lower_key, arena);
+ int lower_bound_predicates_pushed =
+ key_util::PushLowerBoundPrimaryKeyPredicates(predicates_, &lower_key);
int upper_bound_predicates_pushed =
key_util::PushUpperBoundPrimaryKeyPredicates(
predicates_, &upper_key, arena);