Skip to content

Commit

Permalink
change non const Tuple::KeyFromTuple to const method #699 (#713)
Browse files Browse the repository at this point in the history
change non const Tuple::KeyFromTuple to const function #699

Co-authored-by: Prashanth Duvvada <[email protected]>
  • Loading branch information
gukj-spel and prashanthduvvada committed Aug 9, 2024
1 parent 3eabe03 commit f9ff9a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/include/storage/table/tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class Tuple {
auto GetValue(const Schema *schema, uint32_t column_idx) const -> Value;

// Generates a key tuple given schemas and attributes
auto KeyFromTuple(const Schema &schema, const Schema &key_schema, const std::vector<uint32_t> &key_attrs) -> Tuple;
auto KeyFromTuple(const Schema &schema, const Schema &key_schema, const std::vector<uint32_t> &key_attrs) const
-> Tuple;

// Is the column value null ?
inline auto IsNull(const Schema *schema, uint32_t column_idx) const -> bool {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/table/tuple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ auto Tuple::GetValue(const Schema *schema, const uint32_t column_idx) const -> V
return Value::DeserializeFrom(data_ptr, column_type);
}

auto Tuple::KeyFromTuple(const Schema &schema, const Schema &key_schema, const std::vector<uint32_t> &key_attrs)
auto Tuple::KeyFromTuple(const Schema &schema, const Schema &key_schema, const std::vector<uint32_t> &key_attrs) const
-> Tuple {
std::vector<Value> values;
values.reserve(key_attrs.size());
Expand Down

0 comments on commit f9ff9a8

Please sign in to comment.