eldenmoon commented on code in PR #39258: URL: https://github.com/apache/doris/pull/39258#discussion_r1714558695
########## be/src/vec/data_types/serde/data_type_ipv6_serde.cpp: ########## @@ -68,6 +68,28 @@ Status DataTypeIPv6SerDe::write_column_to_mysql(const IColumn& column, return _write_column_to_mysql(column, row_buffer, row_idx, col_const, options); } +void DataTypeIPv6SerDe::read_one_cell_from_jsonb(IColumn& column, const JsonbValue* arg) const { + IPv6 val = 0; + const auto* str_value = static_cast<const JsonbStringVal*>(arg); + ReadBuffer rb(reinterpret_cast<const unsigned char*>(str_value->getBlob()), + str_value->getBlobLen()); + if (!read_ipv6_text_impl(val, rb)) { + throw doris::Exception(ErrorCode::INVALID_ARGUMENT, "parse ipv6 fail, string: '{}'", + rb.to_string()); + } + assert_cast<ColumnIPv6&>(column).insert_value(val); +} + +void DataTypeIPv6SerDe::write_one_cell_to_jsonb(const IColumn& column, + JsonbWriterT<JsonbOutStream>& result, + Arena* mem_pool, int col_id, int row_num) const { + // we make ipv6 as string in jsonb Review Comment: we better use uint128_t in jsonb, but jsonb does not support uint128_t, so string is ok. -- 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