This is an automated email from the ASF dual-hosted git repository.
panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new a46941c684 [Fix](multi-catalog) Fix switch-case fall-through issue in
multi-catalog module. (#16931)
a46941c684 is described below
commit a46941c684a7dc3610ce09eafb9130bc764ca8a6
Author: Qi Chen <[email protected]>
AuthorDate: Mon Feb 20 21:35:41 2023 +0800
[Fix](multi-catalog) Fix switch-case fall-through issue in multi-catalog
module. (#16931)
Fix switch-case fall-through issue in multi-catalog module.
---
be/src/vec/exec/format/csv/csv_reader.cpp | 6 ++++++
.../vec/exec/format/file_reader/new_plain_binary_line_reader.cpp | 2 ++
be/src/vec/exec/format/json/new_json_reader.cpp | 2 ++
be/src/vec/exec/format/orc/vorc_reader.cpp | 3 +++
be/src/vec/exec/format/parquet/byte_array_dict_decoder.cpp | 1 +
be/src/vec/exec/format/parquet/byte_array_plain_decoder.cpp | 1 +
be/src/vec/exec/format/parquet/decoder.cpp | 9 ++++++---
be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp | 2 ++
be/src/vec/exec/format/parquet/fix_length_plain_decoder.cpp | 1 +
be/src/vec/exec/format/parquet/parquet_pred_cmp.h | 6 ++++++
be/src/vec/exec/format/parquet/schema_desc.cpp | 7 +++++++
be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp | 2 ++
12 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/be/src/vec/exec/format/csv/csv_reader.cpp
b/be/src/vec/exec/format/csv/csv_reader.cpp
index cbd8954207..f4cb13e85d 100644
--- a/be/src/vec/exec/format/csv/csv_reader.cpp
+++ b/be/src/vec/exec/format/csv/csv_reader.cpp
@@ -155,10 +155,15 @@ Status CsvReader::init_reader(bool is_load) {
switch (_file_format_type) {
case TFileFormatType::FORMAT_CSV_PLAIN:
+ [[fallthrough]];
case TFileFormatType::FORMAT_CSV_GZ:
+ [[fallthrough]];
case TFileFormatType::FORMAT_CSV_BZ2:
+ [[fallthrough]];
case TFileFormatType::FORMAT_CSV_LZ4FRAME:
+ [[fallthrough]];
case TFileFormatType::FORMAT_CSV_LZOP:
+ [[fallthrough]];
case TFileFormatType::FORMAT_CSV_DEFLATE:
_line_reader.reset(new NewPlainTextLineReader(_profile, _file_reader,
_decompressor.get(),
_size, _line_delimiter,
@@ -298,6 +303,7 @@ Status CsvReader::_create_decompressor() {
} else {
switch (_file_format_type) {
case TFileFormatType::FORMAT_PROTO:
+ [[fallthrough]];
case TFileFormatType::FORMAT_CSV_PLAIN:
compress_type = CompressType::UNCOMPRESSED;
break;
diff --git
a/be/src/vec/exec/format/file_reader/new_plain_binary_line_reader.cpp
b/be/src/vec/exec/format/file_reader/new_plain_binary_line_reader.cpp
index ca80428c38..493fad180a 100644
--- a/be/src/vec/exec/format/file_reader/new_plain_binary_line_reader.cpp
+++ b/be/src/vec/exec/format/file_reader/new_plain_binary_line_reader.cpp
@@ -40,7 +40,9 @@ Status NewPlainBinaryLineReader::read_line(const uint8_t**
ptr, size_t* size, bo
size_t read_size = 0;
switch (_file_type) {
case TFileType::FILE_LOCAL:
+ [[fallthrough]];
case TFileType::FILE_HDFS:
+ [[fallthrough]];
case TFileType::FILE_S3: {
size_t file_size = _file_reader->size();
file_buf.reset(new uint8_t[file_size]);
diff --git a/be/src/vec/exec/format/json/new_json_reader.cpp
b/be/src/vec/exec/format/json/new_json_reader.cpp
index ce6d371658..f321a43d9c 100644
--- a/be/src/vec/exec/format/json/new_json_reader.cpp
+++ b/be/src/vec/exec/format/json/new_json_reader.cpp
@@ -988,7 +988,9 @@ std::string NewJsonReader::_print_json_value(const
rapidjson::Value& value) {
Status NewJsonReader::_read_one_message(std::unique_ptr<uint8_t[]>* file_buf,
size_t* read_size) {
switch (_params.file_type) {
case TFileType::FILE_LOCAL:
+ [[fallthrough]];
case TFileType::FILE_HDFS:
+ [[fallthrough]];
case TFileType::FILE_S3: {
size_t file_size = _file_reader->size();
file_buf->reset(new uint8_t[file_size]);
diff --git a/be/src/vec/exec/format/orc/vorc_reader.cpp
b/be/src/vec/exec/format/orc/vorc_reader.cpp
index 6710642834..8662f52ebf 100644
--- a/be/src/vec/exec/format/orc/vorc_reader.cpp
+++ b/be/src/vec/exec/format/orc/vorc_reader.cpp
@@ -331,8 +331,11 @@ static std::tuple<bool, orc::Literal>
convert_to_orc_literal(const orc::Type* ty
case orc::TypeKind::DOUBLE:
return std::make_tuple(true, orc::Literal(*((double*)value)));
case orc::TypeKind::STRING:
+ [[fallthrough]];
case orc::TypeKind::BINARY:
+ [[fallthrough]];
case orc::TypeKind::CHAR:
+ [[fallthrough]];
case orc::TypeKind::VARCHAR: {
StringRef* string_value = (StringRef*)value;
return std::make_tuple(true, orc::Literal(string_value->data,
string_value->size));
diff --git a/be/src/vec/exec/format/parquet/byte_array_dict_decoder.cpp
b/be/src/vec/exec/format/parquet/byte_array_dict_decoder.cpp
index c30d74b19d..e5a86c5061 100644
--- a/be/src/vec/exec/format/parquet/byte_array_dict_decoder.cpp
+++ b/be/src/vec/exec/format/parquet/byte_array_dict_decoder.cpp
@@ -81,6 +81,7 @@ Status ByteArrayDictDecoder::decode_values(MutableColumnPtr&
doris_column, DataT
TypeIndex logical_type = remove_nullable(data_type)->get_type_id();
switch (logical_type) {
case TypeIndex::String:
+ [[fallthrough]];
case TypeIndex::FixedString: {
size_t dict_index = 0;
diff --git a/be/src/vec/exec/format/parquet/byte_array_plain_decoder.cpp
b/be/src/vec/exec/format/parquet/byte_array_plain_decoder.cpp
index aac4fcb4a2..acc977dbe5 100644
--- a/be/src/vec/exec/format/parquet/byte_array_plain_decoder.cpp
+++ b/be/src/vec/exec/format/parquet/byte_array_plain_decoder.cpp
@@ -42,6 +42,7 @@ Status ByteArrayPlainDecoder::decode_values(MutableColumnPtr&
doris_column, Data
TypeIndex logical_type = remove_nullable(data_type)->get_type_id();
switch (logical_type) {
case TypeIndex::String:
+ [[fallthrough]];
case TypeIndex::FixedString: {
ColumnSelectVector::DataReadType read_type;
while (size_t run_length = select_vector.get_next_run(&read_type)) {
diff --git a/be/src/vec/exec/format/parquet/decoder.cpp
b/be/src/vec/exec/format/parquet/decoder.cpp
index 41313cf327..1e9d1eff9d 100644
--- a/be/src/vec/exec/format/parquet/decoder.cpp
+++ b/be/src/vec/exec/format/parquet/decoder.cpp
@@ -41,10 +41,15 @@ Status Decoder::get_decoder(tparquet::Type::type type,
tparquet::Encoding::type
decoder.reset(new ByteArrayPlainDecoder());
break;
case tparquet::Type::INT32:
+ [[fallthrough]];
case tparquet::Type::INT64:
+ [[fallthrough]];
case tparquet::Type::INT96:
+ [[fallthrough]];
case tparquet::Type::FLOAT:
+ [[fallthrough]];
case tparquet::Type::DOUBLE:
+ [[fallthrough]];
case tparquet::Type::FIXED_LEN_BYTE_ARRAY:
decoder.reset(new FixLengthPlainDecoder(type));
break;
@@ -56,9 +61,7 @@ Status Decoder::get_decoder(tparquet::Type::type type,
tparquet::Encoding::type
case tparquet::Encoding::RLE_DICTIONARY:
switch (type) {
case tparquet::Type::BOOLEAN:
- if (encoding != tparquet::Encoding::PLAIN) {
- return Status::InternalError("Bool type can't has dictionary
page");
- }
+ return Status::InternalError("Bool type can't has dictionary
page");
case tparquet::Type::BYTE_ARRAY:
decoder.reset(new ByteArrayDictDecoder());
break;
diff --git a/be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp
b/be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp
index 8df7a864ac..e581a65d10 100644
--- a/be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp
+++ b/be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp
@@ -125,6 +125,7 @@ public:
}
break;
case TypeIndex::String:
+ [[fallthrough]];
case TypeIndex::FixedString:
break;
default:
@@ -405,6 +406,7 @@ public:
}
break;
case TypeIndex::String:
+ [[fallthrough]];
case TypeIndex::FixedString:
if (_physical_type == tparquet::Type::FIXED_LEN_BYTE_ARRAY) {
return _decode_string(doris_column, select_vector);
diff --git a/be/src/vec/exec/format/parquet/fix_length_plain_decoder.cpp
b/be/src/vec/exec/format/parquet/fix_length_plain_decoder.cpp
index 0bf505f230..e50fcc627b 100644
--- a/be/src/vec/exec/format/parquet/fix_length_plain_decoder.cpp
+++ b/be/src/vec/exec/format/parquet/fix_length_plain_decoder.cpp
@@ -109,6 +109,7 @@ Status
FixLengthPlainDecoder::decode_values(MutableColumnPtr& doris_column, Data
}
break;
case TypeIndex::String:
+ [[fallthrough]];
case TypeIndex::FixedString:
if (_physical_type == tparquet::Type::FIXED_LEN_BYTE_ARRAY) {
return _decode_string(doris_column, select_vector);
diff --git a/be/src/vec/exec/format/parquet/parquet_pred_cmp.h
b/be/src/vec/exec/format/parquet/parquet_pred_cmp.h
index 8dc3bd6b32..d3a01734cf 100644
--- a/be/src/vec/exec/format/parquet/parquet_pred_cmp.h
+++ b/be/src/vec/exec/format/parquet/parquet_pred_cmp.h
@@ -139,7 +139,9 @@ private:
FOR_REINTERPRET_TYPES(DISPATCH)
#undef DISPATCH
case TYPE_VARCHAR:
+ [[fallthrough]];
case TYPE_CHAR:
+ [[fallthrough]];
case TYPE_STRING:
if constexpr (std::is_same_v<CppType, StringRef>) {
min_value = StringRef(encoded_min);
@@ -180,7 +182,9 @@ private:
}
break;
case TYPE_DECIMAL32:
+ [[fallthrough]];
case TYPE_DECIMAL64:
+ [[fallthrough]];
case TYPE_DECIMAL128I:
if constexpr (std::is_same_v<CppType, int32_t> ||
std::is_same_v<CppType, int64_t> ||
std::is_same_v<CppType, __int128_t>) {
@@ -213,6 +217,7 @@ private:
}
break;
case TYPE_DATE:
+ [[fallthrough]];
case TYPE_DATEV2:
if (physical_type == tparquet::Type::INT32) {
int64_t min_date_value =
@@ -231,6 +236,7 @@ private:
}
break;
case TYPE_DATETIME:
+ [[fallthrough]];
case TYPE_DATETIMEV2:
if (physical_type == tparquet::Type::INT96) {
ParquetInt96 datetime96_min =
diff --git a/be/src/vec/exec/format/parquet/schema_desc.cpp
b/be/src/vec/exec/format/parquet/schema_desc.cpp
index e1a5225ff8..70af1ddbba 100644
--- a/be/src/vec/exec/format/parquet/schema_desc.cpp
+++ b/be/src/vec/exec/format/parquet/schema_desc.cpp
@@ -190,6 +190,7 @@ TypeDescriptor FieldDescriptor::get_doris_type(const
tparquet::SchemaElement& ph
type = TypeDescriptor(TYPE_DOUBLE);
break;
case tparquet::Type::BYTE_ARRAY:
+ [[fallthrough]];
case tparquet::Type::FIXED_LEN_BYTE_ARRAY:
type = TypeDescriptor(TYPE_STRING);
break;
@@ -245,10 +246,12 @@ TypeDescriptor
FieldDescriptor::convert_to_doris_type(tparquet::ConvertedType::t
type = TypeDescriptor(TYPE_DATEV2);
break;
case tparquet::ConvertedType::type::TIME_MILLIS:
+ [[fallthrough]];
case tparquet::ConvertedType::type::TIME_MICROS:
type = TypeDescriptor(TYPE_TIMEV2);
break;
case tparquet::ConvertedType::type::TIMESTAMP_MILLIS:
+ [[fallthrough]];
case tparquet::ConvertedType::type::TIMESTAMP_MICROS:
type = TypeDescriptor(TYPE_DATETIMEV2);
break;
@@ -256,15 +259,19 @@ TypeDescriptor
FieldDescriptor::convert_to_doris_type(tparquet::ConvertedType::t
type = TypeDescriptor(TYPE_TINYINT);
break;
case tparquet::ConvertedType::type::UINT_8:
+ [[fallthrough]];
case tparquet::ConvertedType::type::INT_16:
type = TypeDescriptor(TYPE_SMALLINT);
break;
case tparquet::ConvertedType::type::UINT_16:
+ [[fallthrough]];
case tparquet::ConvertedType::type::INT_32:
type = TypeDescriptor(TYPE_INT);
break;
case tparquet::ConvertedType::type::UINT_32:
+ [[fallthrough]];
case tparquet::ConvertedType::type::UINT_64:
+ [[fallthrough]];
case tparquet::ConvertedType::type::INT_64:
type = TypeDescriptor(TYPE_BIGINT);
break;
diff --git a/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp
b/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp
index e1c2c0af64..2bfe74628d 100644
--- a/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp
+++ b/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp
@@ -232,9 +232,11 @@ Status ColumnChunkReader::decode_values(MutableColumnPtr&
doris_column, DataType
int32_t ColumnChunkReader::_get_type_length() {
switch (_field_schema->physical_type) {
case tparquet::Type::INT32:
+ [[fallthrough]];
case tparquet::Type::FLOAT:
return 4;
case tparquet::Type::INT64:
+ [[fallthrough]];
case tparquet::Type::DOUBLE:
return 8;
case tparquet::Type::INT96:
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]