Skip to content

Commit

Permalink
[fix][store] Fixup document datetime type error
Browse files Browse the repository at this point in the history
  • Loading branch information
visualYJD committed Nov 16, 2024
1 parent 5ad562e commit 1747642
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/client_v2/document_index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void SendDocumentAdd(DocumentAddOptions const& opt) {
document_value1.set_field_type(dingodb::pb::common::ScalarFieldType::DATETIME);
auto now = std::chrono::system_clock::now();
std::string time_str = ToRFC3339(now);
document_value1.mutable_field_value()->set_string_data(time_str);
document_value1.mutable_field_value()->set_datetime_data(time_str);
std::cout << "doc_id: " << opt.document_id << " ,time_str:" << time_str << std::endl;
(*document_data)["col5"] = document_value1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/document/document_index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ butil::Status DocumentIndex::Add(const std::vector<pb::common::DocumentWithId>&
break;
case pb::common::ScalarFieldType::DATETIME:
date_column_names.push_back(field_name);
date_column_docs.push_back(document_value.field_value().string_data());
date_column_docs.push_back(document_value.field_value().datetime_data());
break;
case pb::common::ScalarFieldType::BOOL:
bool_column_names.push_back(field_name);
Expand Down

0 comments on commit 1747642

Please sign in to comment.