Skip to content

Commit 5c04441

Browse files
visualYJDrock-git
authored andcommitted
[fix][store] Fixup document datetime type error
1 parent 5ad562e commit 5c04441

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/client_v2/document_index.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void SendDocumentAdd(DocumentAddOptions const& opt) {
125125
document_value1.set_field_type(dingodb::pb::common::ScalarFieldType::DATETIME);
126126
auto now = std::chrono::system_clock::now();
127127
std::string time_str = ToRFC3339(now);
128-
document_value1.mutable_field_value()->set_string_data(time_str);
128+
document_value1.mutable_field_value()->set_datetime_data(time_str);
129129
std::cout << "doc_id: " << opt.document_id << " ,time_str:" << time_str << std::endl;
130130
(*document_data)["col5"] = document_value1;
131131
}

src/document/document_index.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ butil::Status DocumentIndex::Add(const std::vector<pb::common::DocumentWithId>&
265265
break;
266266
case pb::common::ScalarFieldType::DATETIME:
267267
date_column_names.push_back(field_name);
268-
date_column_docs.push_back(document_value.field_value().string_data());
268+
date_column_docs.push_back(document_value.field_value().datetime_data());
269269
break;
270270
case pb::common::ScalarFieldType::BOOL:
271271
bool_column_names.push_back(field_name);

0 commit comments

Comments
 (0)