@@ -190,7 +190,7 @@ Status get_int_value(const rapidjson::Value& col, PrimitiveType type, void* slot
190190
191191template <PrimitiveType T>
192192Status get_date_value_int (const rapidjson::Value& col, PrimitiveType type, bool is_date_str,
193- typename PrimitiveTypeTraits<T>::ColumnItemType * slot,
193+ typename PrimitiveTypeTraits<T>::CppType * slot,
194194 const cctz::time_zone& time_zone) {
195195 constexpr bool is_datetime_v1 = T == TYPE_DATE || T == TYPE_DATETIME;
196196 typename PrimitiveTypeTraits<T>::CppType dt_val;
@@ -271,16 +271,13 @@ Status get_date_value_int(const rapidjson::Value& col, PrimitiveType type, bool
271271 }
272272 }
273273
274- *reinterpret_cast <typename PrimitiveTypeTraits<T>::ColumnItemType*>(slot) =
275- binary_cast<typename PrimitiveTypeTraits<T>::CppType,
276- typename PrimitiveTypeTraits<T>::ColumnItemType>(
277- *reinterpret_cast <typename PrimitiveTypeTraits<T>::CppType*>(&dt_val));
274+ *slot = *reinterpret_cast <typename PrimitiveTypeTraits<T>::CppType*>(&dt_val);
278275 return Status::OK ();
279276}
280277
281278template <PrimitiveType T>
282279Status get_date_int (const rapidjson::Value& col, PrimitiveType type, bool pure_doc_value,
283- typename PrimitiveTypeTraits<T>::ColumnItemType * slot,
280+ typename PrimitiveTypeTraits<T>::CppType * slot,
284281 const cctz::time_zone& time_zone) {
285282 // this would happend just only when `enable_docvalue_scan = false`, and field has timestamp format date from _source
286283 if (col.IsNumber ()) {
@@ -309,7 +306,7 @@ Status get_date_int(const rapidjson::Value& col, PrimitiveType type, bool pure_d
309306template <PrimitiveType T>
310307Status fill_date_int (const rapidjson::Value& col, PrimitiveType type, bool pure_doc_value,
311308 vectorized::IColumn* col_ptr, const cctz::time_zone& time_zone) {
312- typename PrimitiveTypeTraits<T>::ColumnItemType data;
309+ typename PrimitiveTypeTraits<T>::CppType data;
313310 RETURN_IF_ERROR ((get_date_int<T>(col, type, pure_doc_value, &data, time_zone)));
314311 col_ptr->insert_data (const_cast <const char *>(reinterpret_cast <char *>(&data)), 0 );
315312 return Status::OK ();
@@ -426,11 +423,11 @@ Status insert_int_value(const rapidjson::Value& col, PrimitiveType type,
426423
427424template <PrimitiveType T>
428425Status handle_value (const rapidjson::Value& col, PrimitiveType sub_type, bool pure_doc_value,
429- typename PrimitiveTypeTraits<T>::ColumnItemType & val) {
426+ typename PrimitiveTypeTraits<T>::CppType & val) {
430427 if constexpr (T == TYPE_TINYINT || T == TYPE_SMALLINT || T == TYPE_INT || T == TYPE_BIGINT ||
431428 T == TYPE_LARGEINT) {
432- RETURN_IF_ERROR (get_int_value<typename PrimitiveTypeTraits<T>::ColumnItemType>(
433- col, sub_type, &val, pure_doc_value));
429+ RETURN_IF_ERROR (get_int_value<typename PrimitiveTypeTraits<T>::CppType>(col, sub_type, &val,
430+ pure_doc_value));
434431 return Status::OK ();
435432 }
436433 if constexpr (T == TYPE_FLOAT) {
@@ -457,7 +454,7 @@ Status handle_value(const rapidjson::Value& col, PrimitiveType sub_type, bool pu
457454 }
458455
459456 if (col.IsNumber ()) {
460- val = static_cast <typename PrimitiveTypeTraits<T>::ColumnItemType >(col.GetInt ());
457+ val = static_cast <typename PrimitiveTypeTraits<T>::CppType >(col.GetInt ());
461458 return Status::OK ();
462459 }
463460
@@ -485,7 +482,7 @@ Status handle_value(const rapidjson::Value& col, PrimitiveType sub_type, bool pu
485482template <PrimitiveType T>
486483Status process_single_column (const rapidjson::Value& col, PrimitiveType sub_type,
487484 bool pure_doc_value, vectorized::Array& array) {
488- typename PrimitiveTypeTraits<T>::ColumnItemType val;
485+ typename PrimitiveTypeTraits<T>::CppType val;
489486 RETURN_IF_ERROR (handle_value<T>(col, sub_type, pure_doc_value, val));
490487 array.push_back (vectorized::Field::create_field<T>(val));
491488 return Status::OK ();
@@ -514,12 +511,12 @@ template <PrimitiveType T>
514511Status process_date_column (const rapidjson::Value& col, PrimitiveType sub_type, bool pure_doc_value,
515512 vectorized::Array& array, const cctz::time_zone& time_zone) {
516513 if (!col.IsArray ()) {
517- typename PrimitiveTypeTraits<T>::ColumnItemType data;
514+ typename PrimitiveTypeTraits<T>::CppType data;
518515 RETURN_IF_ERROR ((get_date_int<T>(col, sub_type, pure_doc_value, &data, time_zone)));
519516 array.push_back (vectorized::Field::create_field<T>(data));
520517 } else {
521518 for (const auto & sub_col : col.GetArray ()) {
522- typename PrimitiveTypeTraits<T>::ColumnItemType data;
519+ typename PrimitiveTypeTraits<T>::CppType data;
523520 RETURN_IF_ERROR ((get_date_int<T>(sub_col, sub_type, pure_doc_value, &data, time_zone)));
524521 array.push_back (vectorized::Field::create_field<T>(data));
525522 }
@@ -533,7 +530,7 @@ Status process_jsonb_column(const rapidjson::Value& col, PrimitiveType sub_type,
533530 JsonBinaryValue jsonb_value;
534531 RETURN_IF_ERROR (jsonb_value.from_json_string (json_value_to_string (col)));
535532 vectorized::JsonbField json (jsonb_value.value (), jsonb_value.size ());
536- array.push_back (vectorized::Field::create_field<TYPE_JSONB>(json));
533+ array.push_back (vectorized::Field::create_field<TYPE_JSONB>(std::move ( json) ));
537534 } else {
538535 for (const auto & sub_col : col.GetArray ()) {
539536 JsonBinaryValue jsonb_value;
0 commit comments