-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feature](hive)Support hive tables after alter type. #25138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5dfa577
632ce64
22df535
eb8263a
f83da19
f4a211a
bdaa927
961174f
1d542fb
b97e6f9
08009dd
8cad614
a6d0f86
9f827cf
63d65bf
516535b
cd54c6f
5911a4c
09f9a61
0139e3b
0adc21f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -125,56 +125,35 @@ Status ByteArrayDictDecoder::_decode_values(MutableColumnPtr& doris_column, Data | |||||
| return _decode_dict_values<has_filter>(doris_column, select_vector, is_dict_filter); | ||||||
| } | ||||||
|
|
||||||
| 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; | ||||||
| size_t dict_index = 0; | ||||||
|
|
||||||
| ColumnSelectVector::DataReadType read_type; | ||||||
| while (size_t run_length = select_vector.get_next_run<has_filter>(&read_type)) { | ||||||
| switch (read_type) { | ||||||
| case ColumnSelectVector::CONTENT: { | ||||||
| std::vector<StringRef> string_values; | ||||||
| string_values.reserve(run_length); | ||||||
| for (size_t i = 0; i < run_length; ++i) { | ||||||
| string_values.emplace_back(_dict_items[_indexes[dict_index++]]); | ||||||
| } | ||||||
| doris_column->insert_many_strings_overflow(&string_values[0], run_length, | ||||||
| _max_value_length); | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::NULL_DATA: { | ||||||
| doris_column->insert_many_defaults(run_length); | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::FILTERED_CONTENT: { | ||||||
| dict_index += run_length; | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::FILTERED_NULL: { | ||||||
| // do nothing | ||||||
| break; | ||||||
| } | ||||||
| ColumnSelectVector::DataReadType read_type; | ||||||
| while (size_t run_length = select_vector.get_next_run<has_filter>(&read_type)) { | ||||||
| switch (read_type) { | ||||||
| case ColumnSelectVector::CONTENT: { | ||||||
| std::vector<StringRef> string_values; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'string_values' is not initialized [cppcoreguidelines-init-variables]
Suggested change
|
||||||
| string_values.reserve(run_length); | ||||||
| for (size_t i = 0; i < run_length; ++i) { | ||||||
| string_values.emplace_back(_dict_items[_indexes[dict_index++]]); | ||||||
| } | ||||||
| doris_column->insert_many_strings_overflow(&string_values[0], run_length, | ||||||
| _max_value_length); | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::NULL_DATA: { | ||||||
| doris_column->insert_many_defaults(run_length); | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::FILTERED_CONTENT: { | ||||||
| dict_index += run_length; | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::FILTERED_NULL: { | ||||||
| // do nothing | ||||||
| break; | ||||||
| } | ||||||
| } | ||||||
| return Status::OK(); | ||||||
| } | ||||||
| case TypeIndex::Decimal32: | ||||||
| return _decode_binary_decimal<Int32, has_filter>(doris_column, data_type, select_vector); | ||||||
| case TypeIndex::Decimal64: | ||||||
| return _decode_binary_decimal<Int64, has_filter>(doris_column, data_type, select_vector); | ||||||
| case TypeIndex::Decimal128: | ||||||
| return _decode_binary_decimal<Int128, has_filter>(doris_column, data_type, select_vector); | ||||||
| case TypeIndex::Decimal128I: | ||||||
| return _decode_binary_decimal<Int128, has_filter>(doris_column, data_type, select_vector); | ||||||
| // TODO: decimal256 | ||||||
| default: | ||||||
| break; | ||||||
| } | ||||||
| return Status::InvalidArgument( | ||||||
| "Can't decode parquet physical type BYTE_ARRAY to doris logical type {}", | ||||||
| getTypeName(logical_type)); | ||||||
| return Status::OK(); | ||||||
| } | ||||||
| } // namespace doris::vectorized | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -56,74 +56,53 @@ template <bool has_filter> | |||||
| Status ByteArrayPlainDecoder::_decode_values(MutableColumnPtr& doris_column, DataTypePtr& data_type, | ||||||
| ColumnSelectVector& select_vector, | ||||||
| bool is_dict_filter) { | ||||||
| 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<has_filter>(&read_type)) { | ||||||
| switch (read_type) { | ||||||
| case ColumnSelectVector::CONTENT: { | ||||||
| std::vector<StringRef> string_values; | ||||||
| string_values.reserve(run_length); | ||||||
| for (size_t i = 0; i < run_length; ++i) { | ||||||
| if (UNLIKELY(_offset + 4 > _data->size)) { | ||||||
| return Status::IOError("Can't read byte array length from plain decoder"); | ||||||
| } | ||||||
| uint32_t length = decode_fixed32_le( | ||||||
| reinterpret_cast<const uint8_t*>(_data->data) + _offset); | ||||||
| _offset += 4; | ||||||
| if (UNLIKELY(_offset + length) > _data->size) { | ||||||
| return Status::IOError("Can't read enough bytes in plain decoder"); | ||||||
| } | ||||||
| string_values.emplace_back(_data->data + _offset, length); | ||||||
| _offset += length; | ||||||
| ColumnSelectVector::DataReadType read_type; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'read_type' is not initialized [cppcoreguidelines-init-variables] ColumnSelectVector::DataReadType read_type;
^ |
||||||
| while (size_t run_length = select_vector.get_next_run<has_filter>(&read_type)) { | ||||||
| switch (read_type) { | ||||||
| case ColumnSelectVector::CONTENT: { | ||||||
| std::vector<StringRef> string_values; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: variable 'string_values' is not initialized [cppcoreguidelines-init-variables]
Suggested change
|
||||||
| string_values.reserve(run_length); | ||||||
| for (size_t i = 0; i < run_length; ++i) { | ||||||
| if (UNLIKELY(_offset + 4 > _data->size)) { | ||||||
| return Status::IOError("Can't read byte array length from plain decoder"); | ||||||
| } | ||||||
| doris_column->insert_many_strings(&string_values[0], run_length); | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::NULL_DATA: { | ||||||
| doris_column->insert_many_defaults(run_length); | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::FILTERED_CONTENT: { | ||||||
| for (int i = 0; i < run_length; ++i) { | ||||||
| if (UNLIKELY(_offset + 4 > _data->size)) { | ||||||
| return Status::IOError("Can't read byte array length from plain decoder"); | ||||||
| } | ||||||
| uint32_t length = decode_fixed32_le( | ||||||
| reinterpret_cast<const uint8_t*>(_data->data) + _offset); | ||||||
| _offset += 4; | ||||||
| if (UNLIKELY(_offset + length) > _data->size) { | ||||||
| return Status::IOError("Can't read enough bytes in plain decoder"); | ||||||
| } | ||||||
| _offset += length; | ||||||
| uint32_t length = | ||||||
| decode_fixed32_le(reinterpret_cast<const uint8_t*>(_data->data) + _offset); | ||||||
| _offset += 4; | ||||||
| if (UNLIKELY(_offset + length) > _data->size) { | ||||||
| return Status::IOError("Can't read enough bytes in plain decoder"); | ||||||
| } | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::FILTERED_NULL: { | ||||||
| // do nothing | ||||||
| break; | ||||||
| string_values.emplace_back(_data->data + _offset, length); | ||||||
| _offset += length; | ||||||
| } | ||||||
| doris_column->insert_many_strings(&string_values[0], run_length); | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::NULL_DATA: { | ||||||
| doris_column->insert_many_defaults(run_length); | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::FILTERED_CONTENT: { | ||||||
| for (int i = 0; i < run_length; ++i) { | ||||||
| if (UNLIKELY(_offset + 4 > _data->size)) { | ||||||
| return Status::IOError("Can't read byte array length from plain decoder"); | ||||||
| } | ||||||
| uint32_t length = | ||||||
| decode_fixed32_le(reinterpret_cast<const uint8_t*>(_data->data) + _offset); | ||||||
| _offset += 4; | ||||||
| if (UNLIKELY(_offset + length) > _data->size) { | ||||||
| return Status::IOError("Can't read enough bytes in plain decoder"); | ||||||
| } | ||||||
| _offset += length; | ||||||
| } | ||||||
| break; | ||||||
| } | ||||||
| case ColumnSelectVector::FILTERED_NULL: { | ||||||
| // do nothing | ||||||
| break; | ||||||
| } | ||||||
| } | ||||||
| return Status::OK(); | ||||||
| } | ||||||
| case TypeIndex::Decimal32: | ||||||
| return _decode_binary_decimal<Int32, has_filter>(doris_column, data_type, select_vector); | ||||||
| case TypeIndex::Decimal64: | ||||||
| return _decode_binary_decimal<Int64, has_filter>(doris_column, data_type, select_vector); | ||||||
| case TypeIndex::Decimal128: | ||||||
| return _decode_binary_decimal<Int128, has_filter>(doris_column, data_type, select_vector); | ||||||
| case TypeIndex::Decimal128I: | ||||||
| return _decode_binary_decimal<Int128, has_filter>(doris_column, data_type, select_vector); | ||||||
| // TODO: decimal256 | ||||||
| default: | ||||||
| break; | ||||||
| } | ||||||
| return Status::InvalidArgument( | ||||||
| "Can't decode parquet physical type BYTE_ARRAY to doris logical type {}", | ||||||
| getTypeName(logical_type)); | ||||||
| return Status::OK(); | ||||||
| } | ||||||
| } // namespace doris::vectorized | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'read_type' is not initialized [cppcoreguidelines-init-variables]
ColumnSelectVector::DataReadType read_type; ^