Fix bug: localtime is not thread-safe,then changed to localtime_r.#1614
Merged
imay merged 1 commit intoapache:masterfrom Aug 8, 2019
worker24h:fix-parquet-bug
Merged
Fix bug: localtime is not thread-safe,then changed to localtime_r.#1614imay merged 1 commit intoapache:masterfrom worker24h:fix-parquet-bug
imay merged 1 commit intoapache:masterfrom
worker24h:fix-parquet-bug
Conversation
imay
requested changes
Aug 8, 2019
be/src/exec/base_scanner.cpp
Outdated
| error_msg << "column(" << slot_desc->col_name() << ") value is incorrect " | ||
| << "while strict mode is " << std::boolalpha << _strict_mode; | ||
| _state->append_error_msg_to_file("", error_msg.str()); | ||
| if (rawValue) {//is not null then get raw value |
Contributor
There was a problem hiding this comment.
Suggested change
| if (rawValue) {//is not null then get raw value | |
| if (rawValue != nullptr) {//is not null then get raw value |
be/src/exec/base_scanner.cpp
Outdated
| << "while strict mode is " << std::boolalpha << _strict_mode; | ||
| _state->append_error_msg_to_file("", error_msg.str()); | ||
| } | ||
| LOG(WARNING) << error_msg.str(); |
Contributor
There was a problem hiding this comment.
remove this log, we should not print error log for wrong data when load. This is a normal case.
| error_msg << " column(" << slot_desc->col_name() << ") value is incorrect " | ||
| << "while strict mode is " << std::boolalpha << _strict_mode; | ||
| _state->append_error_msg_to_file("", error_msg.str()); | ||
| } |
Contributor
There was a problem hiding this comment.
and I think you can reuse the append string logic.
std::string raw_string;
if (raw_value != nullptr) {
raw_string = raw_value->to_string();
}
error_msg << " column(" << slot_desc->col_name() << ") value is incorrect "
<< "while strict mode is " << std::boolalpha << _strict_mode;
_state->append_error_msg_to_file("", error_msg.str());
be/src/exec/base_scanner.cpp
Outdated
| && !_src_tuple->is_null(_src_slot_descs_order_by_dest[dest_index]->null_indicator_offset())) { | ||
| SlotDescriptor* slotDescriptor = _src_slot_descs_order_by_dest[dest_index]; | ||
| if (_strict_mode && (slotDescriptor != nullptr)&& !_src_tuple->is_null(slotDescriptor->null_indicator_offset())) { | ||
| StringValue* rawValue = _src_tuple->get_string_slot(slotDescriptor->tuple_offset()); |
Contributor
There was a problem hiding this comment.
Suggested change
| StringValue* rawValue = _src_tuple->get_string_slot(slotDescriptor->tuple_offset()); | |
| StringValue* raw_value = _src_tuple->get_string_slot(slotDescriptor->tuple_offset()); |
be/src/exec/base_scanner.cpp
Outdated
| if (value == nullptr) { | ||
| if (_strict_mode && (_src_slot_descs_order_by_dest[dest_index] != nullptr) | ||
| && !_src_tuple->is_null(_src_slot_descs_order_by_dest[dest_index]->null_indicator_offset())) { | ||
| SlotDescriptor* slotDescriptor = _src_slot_descs_order_by_dest[dest_index]; |
Contributor
There was a problem hiding this comment.
Suggested change
| SlotDescriptor* slotDescriptor = _src_slot_descs_order_by_dest[dest_index]; | |
| SlotDescriptor* slot_descriptor = _src_slot_descs_order_by_dest[dest_index]; |
Closed
luwei16
pushed a commit
to luwei16/Doris
that referenced
this pull request
Apr 7, 2023
swjtu-zhanglei
pushed a commit
to swjtu-zhanglei/incubator-doris
that referenced
this pull request
Jul 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix bug: function localtime is not thread-safe,then changed to localtime_r.
Issue: #1615