github-actions[bot] commented on code in PR #26138:
URL: https://github.com/apache/doris/pull/26138#discussion_r1388273316
##########
be/src/vec/common/hash_table/hash_map.h:
##########
@@ -193,10 +198,261 @@ class HashMapTable : public HashTable<Key, Cell, Hash,
Grower, Allocator> {
bool has_null_key_data() const { return false; }
};
+template <typename Key, typename Cell, typename Hash = DefaultHash<Key>,
+ typename Grower = HashTableGrower<>, typename Allocator =
HashTableAllocator>
+class JoinHashMapTable : public HashMapTable<Key, Cell, Hash, Grower,
Allocator> {
+public:
+ using Self = JoinHashMapTable;
+ using Base = HashMapTable<Key, Cell, Hash, Grower, Allocator>;
+
+ using key_type = Key;
+ using value_type = typename Cell::value_type;
+ using mapped_type = typename Cell::Mapped;
+
+ using LookupResult = typename Base::LookupResult;
+
+ using HashMapTable<Key, Cell, Hash, Grower, Allocator>::HashMapTable;
+
+ static uint32_t calc_bucket_size(size_t num_elem) {
+ size_t expect_bucket_size = num_elem + (num_elem - 1) / 7;
Review Comment:
warning: 7 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
size_t expect_bucket_size = num_elem + (num_elem - 1) / 7;
^
```
##########
be/src/exprs/runtime_filter_slots.h:
##########
@@ -37,7 +37,7 @@ class VRuntimeFilterSlots {
const std::vector<TRuntimeFilterDesc>& runtime_filter_descs)
: _build_expr_context(build_expr_ctxs),
_runtime_filter_descs(runtime_filter_descs) {}
- Status init(RuntimeState* state, int64_t hash_table_size, size_t
build_bf_cardinality) {
+ Status init(RuntimeState* state, int64_t hash_table_size) {
Review Comment:
warning: method 'init' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status init(RuntimeState* state, int64_t hash_table_size) {
```
##########
be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp:
##########
@@ -60,17 +61,14 @@ Status
DataTypeDateTimeV2SerDe::serialize_one_cell_to_json(const IColumn& column
return Status::OK();
}
-Status DataTypeDateTimeV2SerDe::deserialize_column_from_json_vector(IColumn&
column,
-
std::vector<Slice>& slices,
- int*
num_deserialized,
- const
FormatOptions& options,
- int
nesting_level) const {
+Status DataTypeDateTimeV2SerDe::deserialize_column_from_json_vector(
Review Comment:
warning: method 'deserialize_column_from_json_vector' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status DataTypeDateTimeV2SerDe::deserialize_column_from_json_vector(
```
be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp:65:
```diff
- const FormatOptions& options) const {
+ const FormatOptions& options) {
```
##########
be/src/vec/data_types/serde/data_type_date64_serde.cpp:
##########
@@ -130,18 +127,15 @@ Status
DataTypeDateTimeSerDe::serialize_one_cell_to_json(const IColumn& column,
return Status::OK();
}
-Status DataTypeDateTimeSerDe::deserialize_column_from_json_vector(IColumn&
column,
-
std::vector<Slice>& slices,
- int*
num_deserialized,
- const
FormatOptions& options,
- int
nesting_level) const {
+Status DataTypeDateTimeSerDe::deserialize_column_from_json_vector(
Review Comment:
warning: method 'deserialize_column_from_json_vector' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status DataTypeDateTimeSerDe::deserialize_column_from_json_vector(
```
be/src/vec/data_types/serde/data_type_date64_serde.cpp:131:
```diff
- const FormatOptions& options) const {
+ const FormatOptions& options) {
```
##########
be/src/vec/data_types/serde/data_type_date64_serde.cpp:
##########
@@ -271,7 +277,8 @@
return _write_column_to_mysql(column, row_buffer, row_idx, col_const);
}
-Status DataTypeDate64SerDe::write_column_to_orc(const IColumn& column, const
NullMap* null_map,
+Status DataTypeDate64SerDe::write_column_to_orc(const std::string& timezone,
const IColumn& column,
Review Comment:
warning: method 'write_column_to_orc' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status DataTypeDate64SerDe::write_column_to_orc(const std::string&
timezone, const IColumn& column,
```
be/src/vec/data_types/serde/data_type_date64_serde.cpp:283:
```diff
- std::vector<StringRef>&
buffer_list) const {
+ std::vector<StringRef>&
buffer_list) {
```
##########
be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp:
##########
@@ -140,47 +150,37 @@
return _write_column_to_mysql(column, row_buffer, row_idx, col_const);
}
-Status DataTypeDateTimeV2SerDe::write_column_to_orc(const IColumn& column,
const NullMap* null_map,
+Status DataTypeDateTimeV2SerDe::write_column_to_orc(const std::string&
timezone,
Review Comment:
warning: method 'write_column_to_orc' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status DataTypeDateTimeV2SerDe::write_column_to_orc(const
std::string& timezone,
```
be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp:156:
```diff
-
std::vector<StringRef>& buffer_list) const {
+
std::vector<StringRef>& buffer_list) {
```
##########
be/src/vec/data_types/serde/data_type_datev2_serde.cpp:
##########
@@ -144,7 +152,8 @@
return _write_column_to_mysql(column, row_buffer, row_idx, col_const);
}
-Status DataTypeDateV2SerDe::write_column_to_orc(const IColumn& column, const
NullMap* null_map,
+Status DataTypeDateV2SerDe::write_column_to_orc(const std::string& timezone,
const IColumn& column,
Review Comment:
warning: method 'write_column_to_orc' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status DataTypeDateV2SerDe::write_column_to_orc(const std::string&
timezone, const IColumn& column,
```
be/src/vec/data_types/serde/data_type_datev2_serde.cpp:158:
```diff
- std::vector<StringRef>&
buffer_list) const {
+ std::vector<StringRef>&
buffer_list) {
```
##########
be/src/vec/data_types/serde/data_type_fixedlengthobject_serde.h:
##########
@@ -100,8 +99,9 @@ class DataTypeFixedLengthObjectSerDe : public DataTypeSerDe {
return Status::NotSupported("write_column_to_pb with type " +
column.get_name());
}
- Status write_column_to_orc(const IColumn& column, const NullMap* null_map,
- orc::ColumnVectorBatch* orc_col_batch, int
start, int end,
+ Status write_column_to_orc(const std::string& timezone, const IColumn&
column,
Review Comment:
warning: method 'write_column_to_orc' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status write_column_to_orc(const std::string& timezone, const
IColumn& column,
```
be/src/vec/data_types/serde/data_type_fixedlengthobject_serde.h:104:
```diff
- std::vector<StringRef>& buffer_list) const
override {
+ std::vector<StringRef>& buffer_list)
override {
```
##########
be/src/vec/data_types/serde/data_type_hll_serde.cpp:
##########
@@ -186,7 +184,8 @@ Status DataTypeHLLSerDe::write_column_to_mysql(const
IColumn& column,
return _write_column_to_mysql(column, row_buffer, row_idx, col_const);
}
-Status DataTypeHLLSerDe::write_column_to_orc(const IColumn& column, const
NullMap* null_map,
+Status DataTypeHLLSerDe::write_column_to_orc(const std::string& timezone,
const IColumn& column,
Review Comment:
warning: method 'write_column_to_orc' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status DataTypeHLLSerDe::write_column_to_orc(const std::string&
timezone, const IColumn& column,
```
be/src/vec/data_types/serde/data_type_hll_serde.cpp:189:
```diff
- int end,
std::vector<StringRef>& buffer_list) const {
+ int end,
std::vector<StringRef>& buffer_list) {
```
##########
be/src/vec/data_types/serde/data_type_datev2_serde.cpp:
##########
@@ -51,18 +50,15 @@ Status
DataTypeDateV2SerDe::serialize_one_cell_to_json(const IColumn& column, in
return Status::OK();
}
-Status DataTypeDateV2SerDe::deserialize_column_from_json_vector(IColumn&
column,
-
std::vector<Slice>& slices,
- int*
num_deserialized,
- const
FormatOptions& options,
- int
nesting_level) const {
+Status DataTypeDateV2SerDe::deserialize_column_from_json_vector(
Review Comment:
warning: method 'deserialize_column_from_json_vector' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status DataTypeDateV2SerDe::deserialize_column_from_json_vector(
```
be/src/vec/data_types/serde/data_type_datev2_serde.cpp:54:
```diff
- const FormatOptions& options) const {
+ const FormatOptions& options) {
```
##########
be/src/vec/data_types/serde/data_type_jsonb_serde.cpp:
##########
@@ -115,7 +112,8 @@ void DataTypeJsonbSerDe::write_column_to_arrow(const
IColumn& column, const Null
}
}
-Status DataTypeJsonbSerDe::write_column_to_orc(const IColumn& column, const
NullMap* null_map,
+Status DataTypeJsonbSerDe::write_column_to_orc(const std::string& timezone,
const IColumn& column,
Review Comment:
warning: method 'write_column_to_orc' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status DataTypeJsonbSerDe::write_column_to_orc(const std::string&
timezone, const IColumn& column,
```
be/src/vec/data_types/serde/data_type_jsonb_serde.cpp:117:
```diff
- int end,
std::vector<StringRef>& buffer_list) const {
+ int end,
std::vector<StringRef>& buffer_list) {
```
##########
be/src/vec/data_types/serde/data_type_map_serde.cpp:
##########
@@ -476,7 +477,8 @@ Status DataTypeMapSerDe::write_column_to_mysql(const
IColumn& column,
return _write_column_to_mysql(column, row_buffer, row_idx, col_const);
}
-Status DataTypeMapSerDe::write_column_to_orc(const IColumn& column, const
NullMap* null_map,
+Status DataTypeMapSerDe::write_column_to_orc(const std::string& timezone,
const IColumn& column,
Review Comment:
warning: method 'write_column_to_orc' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status DataTypeMapSerDe::write_column_to_orc(const std::string&
timezone, const IColumn& column,
```
be/src/vec/data_types/serde/data_type_map_serde.cpp:482:
```diff
- int end,
std::vector<StringRef>& buffer_list) const {
+ int end,
std::vector<StringRef>& buffer_list) {
```
##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -141,8 +141,10 @@ class DataTypeSerDe {
*/
bool _output_object_data = true;
- [[nodiscard]] char get_collection_delimiter(int nesting_level) const {
- CHECK(0 <= nesting_level && nesting_level <= 153);
+ [[nodiscard]] char get_collection_delimiter(
+ int hive_text_complex_type_delimiter_level) const {
+ CHECK(0 <= hive_text_complex_type_delimiter_level &&
+ hive_text_complex_type_delimiter_level <= 153);
Review Comment:
warning: 153 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
hive_text_complex_type_delimiter_level <= 153);
^
```
##########
be/src/vec/data_types/serde/data_type_nullable_serde.cpp:
##########
@@ -317,7 +312,8 @@
return _write_column_to_mysql(column, row_buffer, row_idx, col_const);
}
-Status DataTypeNullableSerDe::write_column_to_orc(const IColumn& column, const
NullMap* null_map,
+Status DataTypeNullableSerDe::write_column_to_orc(const std::string& timezone,
Review Comment:
warning: method 'write_column_to_orc' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static
```
be/src/vec/data_types/serde/data_type_nullable_serde.cpp:318:
```diff
- ,
- {
+ ,
+ {
```
##########
be/src/vec/data_types/serde/data_type_nullable_serde.cpp:
##########
@@ -177,18 +172,18 @@ Status
DataTypeNullableSerDe::deserialize_one_cell_from_json(IColumn& column, Sl
* and "null" literal will be stored in doris.
*
*/
- if (nesting_level >= 2 && slice.size == 4 && slice[0] == 'n' &&
slice[1] == 'u' &&
+ if (_nesting_level >= 2 && slice.size == 4 && slice[0] == 'n' &&
slice[1] == 'u' &&
slice[2] == 'l' && slice[3] == 'l') {
null_column.insert_data(nullptr, 0);
return Status::OK();
- } else if (nesting_level == 1 && slice.size == 2 && slice[0] == '\\'
&& slice[1] == 'N') {
+ } else if (_nesting_level == 1 && slice.size == 2 && slice[0] == '\\'
&& slice[1] == 'N') {
null_column.insert_data(nullptr, 0);
return Status::OK();
}
}
Review Comment:
warning: do not use 'else' after 'return' [readability-else-after-return]
```suggestion
;
{
;
;
}if (_nesting_level == 1 && slice.size == 2 && slice[0] == '\\' && slice[1]
== 'N') {
null_column.insert_data(nullptr, 0);
return Status::OK();
}
```
##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
// 13 (carriage return, CR, \r, ^M),
// 27 (escape, ESC, \e [GCC only], ^[).
- if (nesting_level == 1) {
+ if (hive_text_complex_type_delimiter_level == 1) {
ans = collection_delim;
- } else if (nesting_level == 2) {
+ } else if (hive_text_complex_type_delimiter_level == 2) {
ans = map_key_delim;
- } else if (nesting_level <= 7) {
+ } else if (hive_text_complex_type_delimiter_level <= 7) {
// [3, 7] -> [4, 8]
- ans = nesting_level + 1;
- } else if (nesting_level == 8) {
+ ans = hive_text_complex_type_delimiter_level + 1;
+ } else if (hive_text_complex_type_delimiter_level == 8) {
// [8] -> [11]
ans = 11;
- } else if (nesting_level <= 21) {
+ } else if (hive_text_complex_type_delimiter_level <= 21) {
Review Comment:
warning: 21 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
} else if (hive_text_complex_type_delimiter_level <= 21) {
^
```
##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
// 13 (carriage return, CR, \r, ^M),
// 27 (escape, ESC, \e [GCC only], ^[).
- if (nesting_level == 1) {
+ if (hive_text_complex_type_delimiter_level == 1) {
ans = collection_delim;
- } else if (nesting_level == 2) {
+ } else if (hive_text_complex_type_delimiter_level == 2) {
ans = map_key_delim;
- } else if (nesting_level <= 7) {
+ } else if (hive_text_complex_type_delimiter_level <= 7) {
// [3, 7] -> [4, 8]
- ans = nesting_level + 1;
- } else if (nesting_level == 8) {
+ ans = hive_text_complex_type_delimiter_level + 1;
+ } else if (hive_text_complex_type_delimiter_level == 8) {
Review Comment:
warning: 8 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
} else if (hive_text_complex_type_delimiter_level == 8) {
^
```
##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
// 13 (carriage return, CR, \r, ^M),
// 27 (escape, ESC, \e [GCC only], ^[).
- if (nesting_level == 1) {
+ if (hive_text_complex_type_delimiter_level == 1) {
ans = collection_delim;
- } else if (nesting_level == 2) {
+ } else if (hive_text_complex_type_delimiter_level == 2) {
ans = map_key_delim;
- } else if (nesting_level <= 7) {
+ } else if (hive_text_complex_type_delimiter_level <= 7) {
// [3, 7] -> [4, 8]
- ans = nesting_level + 1;
- } else if (nesting_level == 8) {
+ ans = hive_text_complex_type_delimiter_level + 1;
+ } else if (hive_text_complex_type_delimiter_level == 8) {
// [8] -> [11]
ans = 11;
- } else if (nesting_level <= 21) {
+ } else if (hive_text_complex_type_delimiter_level <= 21) {
// [9, 21] -> [14, 26]
- ans = nesting_level + 5;
- } else if (nesting_level <= 25) {
+ ans = hive_text_complex_type_delimiter_level + 5;
+ } else if (hive_text_complex_type_delimiter_level <= 25) {
Review Comment:
warning: 25 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
} else if (hive_text_complex_type_delimiter_level <= 25) {
^
```
##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
// 13 (carriage return, CR, \r, ^M),
// 27 (escape, ESC, \e [GCC only], ^[).
- if (nesting_level == 1) {
+ if (hive_text_complex_type_delimiter_level == 1) {
ans = collection_delim;
- } else if (nesting_level == 2) {
+ } else if (hive_text_complex_type_delimiter_level == 2) {
ans = map_key_delim;
- } else if (nesting_level <= 7) {
+ } else if (hive_text_complex_type_delimiter_level <= 7) {
// [3, 7] -> [4, 8]
- ans = nesting_level + 1;
- } else if (nesting_level == 8) {
+ ans = hive_text_complex_type_delimiter_level + 1;
+ } else if (hive_text_complex_type_delimiter_level == 8) {
// [8] -> [11]
ans = 11;
- } else if (nesting_level <= 21) {
+ } else if (hive_text_complex_type_delimiter_level <= 21) {
// [9, 21] -> [14, 26]
- ans = nesting_level + 5;
- } else if (nesting_level <= 25) {
+ ans = hive_text_complex_type_delimiter_level + 5;
+ } else if (hive_text_complex_type_delimiter_level <= 25) {
// [22, 25] -> [28, 31]
- ans = nesting_level + 6;
- } else if (nesting_level <= 153) {
+ ans = hive_text_complex_type_delimiter_level + 6;
+ } else if (hive_text_complex_type_delimiter_level <= 153) {
Review Comment:
warning: 153 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
} else if (hive_text_complex_type_delimiter_level <= 153) {
^
```
##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
// 13 (carriage return, CR, \r, ^M),
// 27 (escape, ESC, \e [GCC only], ^[).
- if (nesting_level == 1) {
+ if (hive_text_complex_type_delimiter_level == 1) {
ans = collection_delim;
- } else if (nesting_level == 2) {
+ } else if (hive_text_complex_type_delimiter_level == 2) {
ans = map_key_delim;
- } else if (nesting_level <= 7) {
+ } else if (hive_text_complex_type_delimiter_level <= 7) {
// [3, 7] -> [4, 8]
- ans = nesting_level + 1;
- } else if (nesting_level == 8) {
+ ans = hive_text_complex_type_delimiter_level + 1;
+ } else if (hive_text_complex_type_delimiter_level == 8) {
// [8] -> [11]
ans = 11;
- } else if (nesting_level <= 21) {
+ } else if (hive_text_complex_type_delimiter_level <= 21) {
// [9, 21] -> [14, 26]
- ans = nesting_level + 5;
- } else if (nesting_level <= 25) {
+ ans = hive_text_complex_type_delimiter_level + 5;
Review Comment:
warning: 5 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
ans = hive_text_complex_type_delimiter_level + 5;
^
```
##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
// 13 (carriage return, CR, \r, ^M),
// 27 (escape, ESC, \e [GCC only], ^[).
- if (nesting_level == 1) {
+ if (hive_text_complex_type_delimiter_level == 1) {
ans = collection_delim;
- } else if (nesting_level == 2) {
+ } else if (hive_text_complex_type_delimiter_level == 2) {
ans = map_key_delim;
- } else if (nesting_level <= 7) {
+ } else if (hive_text_complex_type_delimiter_level <= 7) {
// [3, 7] -> [4, 8]
- ans = nesting_level + 1;
- } else if (nesting_level == 8) {
+ ans = hive_text_complex_type_delimiter_level + 1;
+ } else if (hive_text_complex_type_delimiter_level == 8) {
// [8] -> [11]
ans = 11;
- } else if (nesting_level <= 21) {
+ } else if (hive_text_complex_type_delimiter_level <= 21) {
// [9, 21] -> [14, 26]
- ans = nesting_level + 5;
- } else if (nesting_level <= 25) {
+ ans = hive_text_complex_type_delimiter_level + 5;
+ } else if (hive_text_complex_type_delimiter_level <= 25) {
// [22, 25] -> [28, 31]
- ans = nesting_level + 6;
- } else if (nesting_level <= 153) {
+ ans = hive_text_complex_type_delimiter_level + 6;
+ } else if (hive_text_complex_type_delimiter_level <= 153) {
// [26, 153] -> [-128, -1]
- ans = nesting_level + (-26 - 128);
+ ans = hive_text_complex_type_delimiter_level + (-26 - 128);
Review Comment:
warning: 128 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
ans = hive_text_complex_type_delimiter_level + (-26 - 128);
^
```
##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
// 13 (carriage return, CR, \r, ^M),
// 27 (escape, ESC, \e [GCC only], ^[).
- if (nesting_level == 1) {
+ if (hive_text_complex_type_delimiter_level == 1) {
ans = collection_delim;
- } else if (nesting_level == 2) {
+ } else if (hive_text_complex_type_delimiter_level == 2) {
ans = map_key_delim;
- } else if (nesting_level <= 7) {
+ } else if (hive_text_complex_type_delimiter_level <= 7) {
// [3, 7] -> [4, 8]
- ans = nesting_level + 1;
- } else if (nesting_level == 8) {
+ ans = hive_text_complex_type_delimiter_level + 1;
+ } else if (hive_text_complex_type_delimiter_level == 8) {
// [8] -> [11]
ans = 11;
- } else if (nesting_level <= 21) {
+ } else if (hive_text_complex_type_delimiter_level <= 21) {
// [9, 21] -> [14, 26]
- ans = nesting_level + 5;
- } else if (nesting_level <= 25) {
+ ans = hive_text_complex_type_delimiter_level + 5;
+ } else if (hive_text_complex_type_delimiter_level <= 25) {
// [22, 25] -> [28, 31]
- ans = nesting_level + 6;
- } else if (nesting_level <= 153) {
+ ans = hive_text_complex_type_delimiter_level + 6;
Review Comment:
warning: 6 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
ans = hive_text_complex_type_delimiter_level + 6;
^
```
##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
// 13 (carriage return, CR, \r, ^M),
// 27 (escape, ESC, \e [GCC only], ^[).
- if (nesting_level == 1) {
+ if (hive_text_complex_type_delimiter_level == 1) {
ans = collection_delim;
- } else if (nesting_level == 2) {
+ } else if (hive_text_complex_type_delimiter_level == 2) {
ans = map_key_delim;
- } else if (nesting_level <= 7) {
+ } else if (hive_text_complex_type_delimiter_level <= 7) {
// [3, 7] -> [4, 8]
- ans = nesting_level + 1;
- } else if (nesting_level == 8) {
+ ans = hive_text_complex_type_delimiter_level + 1;
+ } else if (hive_text_complex_type_delimiter_level == 8) {
// [8] -> [11]
ans = 11;
- } else if (nesting_level <= 21) {
+ } else if (hive_text_complex_type_delimiter_level <= 21) {
// [9, 21] -> [14, 26]
- ans = nesting_level + 5;
- } else if (nesting_level <= 25) {
+ ans = hive_text_complex_type_delimiter_level + 5;
+ } else if (hive_text_complex_type_delimiter_level <= 25) {
// [22, 25] -> [28, 31]
- ans = nesting_level + 6;
- } else if (nesting_level <= 153) {
+ ans = hive_text_complex_type_delimiter_level + 6;
+ } else if (hive_text_complex_type_delimiter_level <= 153) {
// [26, 153] -> [-128, -1]
- ans = nesting_level + (-26 - 128);
+ ans = hive_text_complex_type_delimiter_level + (-26 - 128);
Review Comment:
warning: 26 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
ans = hive_text_complex_type_delimiter_level + (-26 - 128);
^
```
##########
be/src/vec/data_types/serde/data_type_quantilestate_serde.h:
##########
@@ -121,8 +120,9 @@ class DataTypeQuantileStateSerDe : public DataTypeSerDe {
return _write_column_to_mysql(column, row_buffer, row_idx, col_const);
}
- Status write_column_to_orc(const IColumn& column, const NullMap* null_map,
- orc::ColumnVectorBatch* orc_col_batch, int
start, int end,
+ Status write_column_to_orc(const std::string& timezone, const IColumn&
column,
Review Comment:
warning: method 'write_column_to_orc' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status write_column_to_orc(const std::string& timezone, const
IColumn& column,
```
be/src/vec/data_types/serde/data_type_quantilestate_serde.h:125:
```diff
- std::vector<StringRef>& buffer_list) const
override {
+ std::vector<StringRef>& buffer_list)
override {
```
##########
be/src/vec/data_types/serde/data_type_serde.h:
##########
@@ -154,25 +156,25 @@
// 13 (carriage return, CR, \r, ^M),
// 27 (escape, ESC, \e [GCC only], ^[).
- if (nesting_level == 1) {
+ if (hive_text_complex_type_delimiter_level == 1) {
ans = collection_delim;
- } else if (nesting_level == 2) {
+ } else if (hive_text_complex_type_delimiter_level == 2) {
ans = map_key_delim;
- } else if (nesting_level <= 7) {
+ } else if (hive_text_complex_type_delimiter_level <= 7) {
Review Comment:
warning: 7 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
} else if (hive_text_complex_type_delimiter_level <= 7) {
^
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]