amorynan commented on code in PR #21109: URL: https://github.com/apache/doris/pull/21109#discussion_r1250190815
########## be/src/vec/data_types/serde/data_type_date64_serde.cpp: ########## @@ -23,10 +23,122 @@ #include "gutil/casts.h" #include "vec/columns/column_const.h" +#include "vec/io/io_helper.h" namespace doris { namespace vectorized { +void DataTypeDate64SerDe::serialize_one_cell_to_text(const IColumn& column, int row_num, + BufferWritable& bw, + const FormatOptions& options) const { + auto result = check_column_const_set_readability(column, row_num); + ColumnPtr ptr = result.first; + row_num = result.second; + + Int64 int_val = assert_cast<const ColumnInt64&>(*ptr).get_element(row_num); + if (options.use_lib_format) { + tm time_tm; + memset(&time_tm, 0, sizeof(time_tm)); + time_tm.tm_mday = static_cast<int>(int_val & 31); + time_tm.tm_mon = static_cast<int>(int_val >> 5 & 15) - 1; + time_tm.tm_year = static_cast<int>(int_val >> 9) - 1900; + char buf[20] = {'\0'}; Review Comment: just make same code with type.h to_string() , so not suggest use this if -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org