Skip to content

Conversation

@worker24h
Copy link
Contributor

@worker24h worker24h commented Aug 8, 2019

Fix bug: function localtime is not thread-safe,then changed to localtime_r.
Issue: #1615

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (rawValue) {//is not null then get raw value
if (rawValue != nullptr) {//is not null then get raw value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

<< "while strict mode is " << std::boolalpha << _strict_mode;
_state->append_error_msg_to_file("", error_msg.str());
}
LOG(WARNING) << error_msg.str();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this log, we should not print error log for wrong data when load. This is a normal case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

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());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

&& !_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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
StringValue* rawValue = _src_tuple->get_string_slot(slotDescriptor->tuple_offset());
StringValue* raw_value = _src_tuple->get_string_slot(slotDescriptor->tuple_offset());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

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];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SlotDescriptor* slotDescriptor = _src_slot_descs_order_by_dest[dest_index];
SlotDescriptor* slot_descriptor = _src_slot_descs_order_by_dest[dest_index];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Copy link
Contributor

@imay imay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@imay imay merged commit a6d3099 into apache:master Aug 8, 2019
@imay imay mentioned this pull request Sep 26, 2019
luwei16 pushed a commit to luwei16/incubator-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants