This is an automated email from the ASF dual-hosted git repository.

panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 335110dd884 [chore](code) Remove the code of ReadBuffer (#54493)
335110dd884 is described below

commit 335110dd884f1bf9c7482d04bc240bb7183b2100
Author: Mryange <[email protected]>
AuthorDate: Tue Aug 12 11:29:56 2025 +0800

    [chore](code) Remove the code of ReadBuffer (#54493)
    
    In the past, we used ReadBuffer because we needed a streaming interface.
    A string could be parsed into an element without being completely read,
    and then the next element could continue to be parsed (similar to
    Top-down parsing).
    However, in practice, we always end up using it as a StringRef.
---
 be/src/olap/rowset/segment_v2/segment_writer.cpp   |  1 -
 .../rowset/segment_v2/vertical_segment_writer.cpp  |  1 -
 be/src/vec/columns/column_variant.h                |  1 -
 be/src/vec/data_types/data_type.cpp                |  1 -
 be/src/vec/data_types/data_type.h                  |  6 +-
 be/src/vec/data_types/data_type_array.cpp          |  1 -
 be/src/vec/data_types/data_type_array.h            |  1 -
 be/src/vec/data_types/data_type_date.cpp           |  1 -
 be/src/vec/data_types/data_type_date.h             |  1 -
 .../data_types/data_type_date_or_datetime_v2.cpp   |  1 -
 .../vec/data_types/data_type_date_or_datetime_v2.h |  1 -
 be/src/vec/data_types/data_type_date_time.cpp      |  1 -
 be/src/vec/data_types/data_type_date_time.h        |  1 -
 be/src/vec/data_types/data_type_decimal.cpp        |  1 -
 be/src/vec/data_types/data_type_decimal.h          |  1 -
 be/src/vec/data_types/data_type_ipv4.cpp           |  1 -
 be/src/vec/data_types/data_type_ipv4.h             |  1 -
 be/src/vec/data_types/data_type_ipv6.cpp           |  1 -
 be/src/vec/data_types/data_type_ipv6.h             |  1 -
 be/src/vec/data_types/data_type_jsonb.cpp          |  1 -
 be/src/vec/data_types/data_type_jsonb.h            |  1 -
 be/src/vec/data_types/data_type_map.cpp            |  1 -
 be/src/vec/data_types/data_type_map.h              |  1 -
 be/src/vec/data_types/data_type_nullable.cpp       |  1 -
 be/src/vec/data_types/data_type_nullable.h         |  1 -
 be/src/vec/data_types/data_type_number_base.cpp    |  1 -
 be/src/vec/data_types/data_type_number_base.h      |  1 -
 be/src/vec/data_types/data_type_string.cpp         |  1 -
 be/src/vec/data_types/data_type_string.h           |  1 -
 be/src/vec/data_types/data_type_struct.cpp         |  1 -
 be/src/vec/data_types/data_type_struct.h           |  1 -
 .../serde/data_type_date_or_datetime_serde.cpp     | 10 ++-
 .../serde/data_type_datetimev2_serde.cpp           |  7 +-
 .../data_types/serde/data_type_datev2_serde.cpp    |  5 +-
 .../vec/data_types/serde/data_type_ipv4_serde.cpp  |  7 +-
 .../vec/data_types/serde/data_type_ipv6_serde.cpp  |  7 +-
 .../vec/data_types/serde/data_type_struct_serde.h  | 73 --------------------
 be/src/vec/exec/format/column_type_convert.h       |  8 +--
 be/src/vec/functions/cast/cast_to_jsonb.h          |  1 -
 be/src/vec/io/io_helper.h                          | 78 +++++++++-------------
 be/src/vec/io/reader_buffer.h                      | 45 -------------
 be/src/vec/jsonb/serialize.cpp                     |  1 -
 be/test/common/check_overflow.cpp                  |  1 -
 be/test/vec/data_types/common_data_type_test.h     |  5 +-
 .../vec/data_types/data_type_agg_state_test.cpp    |  4 +-
 be/test/vec/data_types/data_type_bitmap_test.cpp   |  4 +-
 .../vec/data_types/data_type_datetime_v1_test.cpp  |  8 +--
 be/test/vec/data_types/data_type_decimal_test.cpp  |  9 ++-
 be/test/vec/data_types/data_type_hll_test.cpp      |  4 +-
 be/test/vec/data_types/data_type_jsonb_test.cpp    |  7 +-
 be/test/vec/data_types/data_type_number_test.cpp   |  9 ++-
 be/test/vec/data_types/data_type_string_test.cpp   |  7 +-
 be/test/vec/data_types/data_type_struct_test.cpp   |  2 +-
 be/test/vec/data_types/data_type_time_v2_test.cpp  |  8 +--
 be/test/vec/data_types/datetime_round_test.cpp     |  7 +-
 be/test/vec/data_types/from_string_test.cpp        | 13 ++--
 .../data_types/serde/data_type_serde_csv_test.cpp  |  1 -
 .../serde/data_type_serde_string_test.cpp          |  1 -
 .../data_types/serde/data_type_serde_text_test.cpp | 13 ++--
 be/test/vec/exec/column_type_convert_test.cpp      |  2 +-
 60 files changed, 98 insertions(+), 285 deletions(-)

diff --git a/be/src/olap/rowset/segment_v2/segment_writer.cpp 
b/be/src/olap/rowset/segment_v2/segment_writer.cpp
index 9356c34ff3b..136da1f7f94 100644
--- a/be/src/olap/rowset/segment_v2/segment_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_writer.cpp
@@ -69,7 +69,6 @@
 #include "vec/core/block.h"
 #include "vec/core/column_with_type_and_name.h"
 #include "vec/core/types.h"
-#include "vec/io/reader_buffer.h"
 #include "vec/jsonb/serialize.h"
 #include "vec/olap/olap_data_convertor.h"
 #include "vec/runtime/vdatetime_value.h"
diff --git a/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp 
b/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
index f5e904fd016..45ebb660756 100644
--- a/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
@@ -75,7 +75,6 @@
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/data_types/data_type_number.h" // IWYU pragma: keep
-#include "vec/io/reader_buffer.h"
 #include "vec/json/path_in_data.h"
 #include "vec/jsonb/serialize.h"
 #include "vec/olap/olap_data_convertor.h"
diff --git a/be/src/vec/columns/column_variant.h 
b/be/src/vec/columns/column_variant.h
index b1ac405b624..db0abf31c17 100644
--- a/be/src/vec/columns/column_variant.h
+++ b/be/src/vec/columns/column_variant.h
@@ -51,7 +51,6 @@
 #include "vec/data_types/data_type_nullable.h"
 #include "vec/data_types/data_type_variant.h"
 #include "vec/data_types/serde/data_type_serde.h"
-#include "vec/io/reader_buffer.h"
 #include "vec/json/path_in_data.h"
 
 class SipHash;
diff --git a/be/src/vec/data_types/data_type.cpp 
b/be/src/vec/data_types/data_type.cpp
index 5cb761c7036..4b90d6d0434 100644
--- a/be/src/vec/data_types/data_type.cpp
+++ b/be/src/vec/data_types/data_type.cpp
@@ -36,7 +36,6 @@
 namespace doris {
 namespace vectorized {
 class BufferWritable;
-class ReadBuffer;
 } // namespace vectorized
 } // namespace doris
 
diff --git a/be/src/vec/data_types/data_type.h 
b/be/src/vec/data_types/data_type.h
index 891db5a6f3e..7ff811b7de6 100644
--- a/be/src/vec/data_types/data_type.h
+++ b/be/src/vec/data_types/data_type.h
@@ -40,9 +40,9 @@
 #include "vec/columns/column_nothing.h"
 #include "vec/columns/column_string.h"
 #include "vec/common/cow.h"
+#include "vec/common/string_ref.h"
 #include "vec/core/types.h"
 #include "vec/data_types/serde/data_type_serde.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris {
 class PColumnMeta;
@@ -53,7 +53,6 @@ namespace vectorized {
 class IDataType;
 class IColumn;
 class BufferWritable;
-class ReadBuffer;
 
 using ColumnPtr = COW<IColumn>::Ptr;
 using MutableColumnPtr = COW<IColumn>::MutablePtr;
@@ -227,8 +226,7 @@ public:
     }
 #ifdef BE_TEST
     // only used in beut
-    Status from_string(ReadBuffer& rb, IColumn* column) const {
-        StringRef str = {rb.position(), rb.count()};
+    Status from_string(StringRef& str, IColumn* column) const {
         return get_serde()->default_from_string(str, *column);
     }
 
diff --git a/be/src/vec/data_types/data_type_array.cpp 
b/be/src/vec/data_types/data_type_array.cpp
index eebd8b5147a..0c0bc9f5d13 100644
--- a/be/src/vec/data_types/data_type_array.cpp
+++ b/be/src/vec/data_types/data_type_array.cpp
@@ -40,7 +40,6 @@
 #include "vec/common/string_ref.h"
 #include "vec/common/typeid_cast.h"
 #include "vec/data_types/data_type_nullable.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 
diff --git a/be/src/vec/data_types/data_type_array.h 
b/be/src/vec/data_types/data_type_array.h
index 7072183144c..026882796db 100644
--- a/be/src/vec/data_types/data_type_array.h
+++ b/be/src/vec/data_types/data_type_array.h
@@ -42,7 +42,6 @@ class PColumnMeta;
 namespace vectorized {
 class BufferWritable;
 class IColumn;
-class ReadBuffer;
 } // namespace vectorized
 } // namespace doris
 
diff --git a/be/src/vec/data_types/data_type_date.cpp 
b/be/src/vec/data_types/data_type_date.cpp
index 1df08306422..6b834a1f51f 100644
--- a/be/src/vec/data_types/data_type_date.cpp
+++ b/be/src/vec/data_types/data_type_date.cpp
@@ -33,7 +33,6 @@
 #include "vec/data_types/data_type.h"
 #include "vec/functions/cast/cast_to_string.h"
 #include "vec/io/io_helper.h"
-#include "vec/io/reader_buffer.h"
 #include "vec/runtime/vdatetime_value.h"
 
 namespace doris::vectorized {
diff --git a/be/src/vec/data_types/data_type_date.h 
b/be/src/vec/data_types/data_type_date.h
index 80627ed1441..5147228c743 100644
--- a/be/src/vec/data_types/data_type_date.h
+++ b/be/src/vec/data_types/data_type_date.h
@@ -36,7 +36,6 @@
 namespace doris::vectorized {
 #include "common/compile_check_begin.h"
 class BufferWritable;
-class ReadBuffer;
 class IColumn;
 
 class DataTypeDate final : public DataTypeNumberBase<PrimitiveType::TYPE_DATE> 
{
diff --git a/be/src/vec/data_types/data_type_date_or_datetime_v2.cpp 
b/be/src/vec/data_types/data_type_date_or_datetime_v2.cpp
index 1e3db42befb..c95bc025b54 100644
--- a/be/src/vec/data_types/data_type_date_or_datetime_v2.cpp
+++ b/be/src/vec/data_types/data_type_date_or_datetime_v2.cpp
@@ -33,7 +33,6 @@
 #include "vec/core/types.h"
 #include "vec/functions/cast/cast_to_string.h"
 #include "vec/io/io_helper.h"
-#include "vec/io/reader_buffer.h"
 #include "vec/runtime/vdatetime_value.h"
 
 namespace doris {
diff --git a/be/src/vec/data_types/data_type_date_or_datetime_v2.h 
b/be/src/vec/data_types/data_type_date_or_datetime_v2.h
index 53007c6762c..aad0e0be4eb 100644
--- a/be/src/vec/data_types/data_type_date_or_datetime_v2.h
+++ b/be/src/vec/data_types/data_type_date_or_datetime_v2.h
@@ -42,7 +42,6 @@ class PColumnMeta;
 
 namespace vectorized {
 class BufferWritable;
-class ReadBuffer;
 class IColumn;
 } // namespace vectorized
 } // namespace doris
diff --git a/be/src/vec/data_types/data_type_date_time.cpp 
b/be/src/vec/data_types/data_type_date_time.cpp
index 60c6c970b9f..56332092bc7 100644
--- a/be/src/vec/data_types/data_type_date_time.cpp
+++ b/be/src/vec/data_types/data_type_date_time.cpp
@@ -33,7 +33,6 @@
 #include "vec/data_types/data_type.h"
 #include "vec/functions/cast/cast_to_string.h"
 #include "vec/io/io_helper.h"
-#include "vec/io/reader_buffer.h"
 #include "vec/runtime/vdatetime_value.h"
 
 namespace doris::vectorized {
diff --git a/be/src/vec/data_types/data_type_date_time.h 
b/be/src/vec/data_types/data_type_date_time.h
index 5f66b3c5c97..f8b3d1d01e8 100644
--- a/be/src/vec/data_types/data_type_date_time.h
+++ b/be/src/vec/data_types/data_type_date_time.h
@@ -36,7 +36,6 @@
 
 namespace doris::vectorized {
 class BufferWritable;
-class ReadBuffer;
 class IColumn;
 class DataTypeDate;
 class DataTypeDateV2;
diff --git a/be/src/vec/data_types/data_type_decimal.cpp 
b/be/src/vec/data_types/data_type_decimal.cpp
index 14eceae8a4b..da3eecc9dc3 100644
--- a/be/src/vec/data_types/data_type_decimal.cpp
+++ b/be/src/vec/data_types/data_type_decimal.cpp
@@ -48,7 +48,6 @@
 #include "vec/data_types/data_type_struct.h"
 #include "vec/functions/cast/cast_to_string.h"
 #include "vec/io/io_helper.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 #include "common/compile_check_begin.h"
diff --git a/be/src/vec/data_types/data_type_decimal.h 
b/be/src/vec/data_types/data_type_decimal.h
index cc13f342454..b6a11897deb 100644
--- a/be/src/vec/data_types/data_type_decimal.h
+++ b/be/src/vec/data_types/data_type_decimal.h
@@ -56,7 +56,6 @@ class PColumnMeta;
 namespace vectorized {
 class BufferWritable;
 class IColumn;
-class ReadBuffer;
 } // namespace vectorized
 } // namespace doris
 
diff --git a/be/src/vec/data_types/data_type_ipv4.cpp 
b/be/src/vec/data_types/data_type_ipv4.cpp
index 8bd53e8abd5..4a28c751629 100644
--- a/be/src/vec/data_types/data_type_ipv4.cpp
+++ b/be/src/vec/data_types/data_type_ipv4.cpp
@@ -26,7 +26,6 @@
 #include "vec/data_types/data_type.h"
 #include "vec/functions/cast/cast_to_string.h"
 #include "vec/io/io_helper.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 
diff --git a/be/src/vec/data_types/data_type_ipv4.h 
b/be/src/vec/data_types/data_type_ipv4.h
index 4b7fa0d531a..f802f8a341c 100644
--- a/be/src/vec/data_types/data_type_ipv4.h
+++ b/be/src/vec/data_types/data_type_ipv4.h
@@ -35,7 +35,6 @@
 namespace doris {
 namespace vectorized {
 class BufferWritable;
-class ReadBuffer;
 class IColumn;
 } // namespace vectorized
 } // namespace doris
diff --git a/be/src/vec/data_types/data_type_ipv6.cpp 
b/be/src/vec/data_types/data_type_ipv6.cpp
index 0bff199cdde..47ca09fbde6 100755
--- a/be/src/vec/data_types/data_type_ipv6.cpp
+++ b/be/src/vec/data_types/data_type_ipv6.cpp
@@ -26,7 +26,6 @@
 #include "vec/data_types/data_type.h"
 #include "vec/functions/cast/cast_to_string.h"
 #include "vec/io/io_helper.h"
-#include "vec/io/reader_buffer.h"
 #include "vec/runtime/ipv6_value.h"
 
 namespace doris::vectorized {
diff --git a/be/src/vec/data_types/data_type_ipv6.h 
b/be/src/vec/data_types/data_type_ipv6.h
index 64305939aba..1182e0905a3 100755
--- a/be/src/vec/data_types/data_type_ipv6.h
+++ b/be/src/vec/data_types/data_type_ipv6.h
@@ -35,7 +35,6 @@
 namespace doris {
 namespace vectorized {
 class BufferWritable;
-class ReadBuffer;
 class IColumn;
 } // namespace vectorized
 } // namespace doris
diff --git a/be/src/vec/data_types/data_type_jsonb.cpp 
b/be/src/vec/data_types/data_type_jsonb.cpp
index 221809ea298..d474956906c 100644
--- a/be/src/vec/data_types/data_type_jsonb.cpp
+++ b/be/src/vec/data_types/data_type_jsonb.cpp
@@ -28,7 +28,6 @@
 #include "vec/common/string_buffer.hpp"
 #include "vec/common/string_ref.h"
 #include "vec/core/types.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris {
 namespace vectorized {
diff --git a/be/src/vec/data_types/data_type_jsonb.h 
b/be/src/vec/data_types/data_type_jsonb.h
index 35322cb1c01..fadcd719047 100644
--- a/be/src/vec/data_types/data_type_jsonb.h
+++ b/be/src/vec/data_types/data_type_jsonb.h
@@ -41,7 +41,6 @@ namespace doris::vectorized {
 
 class BufferWritable;
 class IColumn;
-class ReadBuffer;
 
 class DataTypeJsonb final : public IDataType {
 public:
diff --git a/be/src/vec/data_types/data_type_map.cpp 
b/be/src/vec/data_types/data_type_map.cpp
index fe168c80cf7..a0eea7e74f2 100644
--- a/be/src/vec/data_types/data_type_map.cpp
+++ b/be/src/vec/data_types/data_type_map.cpp
@@ -36,7 +36,6 @@
 #include "vec/common/string_buffer.hpp"
 #include "vec/common/string_ref.h"
 #include "vec/data_types/data_type_nullable.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 
diff --git a/be/src/vec/data_types/data_type_map.h 
b/be/src/vec/data_types/data_type_map.h
index b1b439efe37..0c99dab8b3b 100644
--- a/be/src/vec/data_types/data_type_map.h
+++ b/be/src/vec/data_types/data_type_map.h
@@ -41,7 +41,6 @@ class PColumnMeta;
 namespace vectorized {
 class BufferWritable;
 class IColumn;
-class ReadBuffer;
 } // namespace vectorized
 } // namespace doris
 
diff --git a/be/src/vec/data_types/data_type_nullable.cpp 
b/be/src/vec/data_types/data_type_nullable.cpp
index 3d547a31f20..0850c46ae3a 100644
--- a/be/src/vec/data_types/data_type_nullable.cpp
+++ b/be/src/vec/data_types/data_type_nullable.cpp
@@ -40,7 +40,6 @@
 #include "vec/core/types.h"
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_nothing.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 #include "common/compile_check_begin.h"
diff --git a/be/src/vec/data_types/data_type_nullable.h 
b/be/src/vec/data_types/data_type_nullable.h
index cf415238c0c..53d359008a6 100644
--- a/be/src/vec/data_types/data_type_nullable.h
+++ b/be/src/vec/data_types/data_type_nullable.h
@@ -42,7 +42,6 @@ class PColumnMeta;
 namespace vectorized {
 class BufferWritable;
 class IColumn;
-class ReadBuffer;
 } // namespace vectorized
 } // namespace doris
 
diff --git a/be/src/vec/data_types/data_type_number_base.cpp 
b/be/src/vec/data_types/data_type_number_base.cpp
index a0faf65c293..ce564fd83dd 100644
--- a/be/src/vec/data_types/data_type_number_base.cpp
+++ b/be/src/vec/data_types/data_type_number_base.cpp
@@ -43,7 +43,6 @@
 #include "vec/common/string_buffer.hpp"
 #include "vec/core/types.h"
 #include "vec/io/io_helper.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 #include "common/compile_check_begin.h"
diff --git a/be/src/vec/data_types/data_type_number_base.h 
b/be/src/vec/data_types/data_type_number_base.h
index 0fc69319257..ffab211b8bc 100644
--- a/be/src/vec/data_types/data_type_number_base.h
+++ b/be/src/vec/data_types/data_type_number_base.h
@@ -43,7 +43,6 @@ namespace doris::vectorized {
 
 class BufferWritable;
 class IColumn;
-class ReadBuffer;
 
 /** Implements part of the IDataType interface, common to all numbers and for 
Date and DateTime.
   */
diff --git a/be/src/vec/data_types/data_type_string.cpp 
b/be/src/vec/data_types/data_type_string.cpp
index 1de4733d466..717de6ccdee 100644
--- a/be/src/vec/data_types/data_type_string.cpp
+++ b/be/src/vec/data_types/data_type_string.cpp
@@ -40,7 +40,6 @@
 #include "vec/common/string_ref.h"
 #include "vec/core/field.h"
 #include "vec/core/types.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 #include "common/compile_check_begin.h"
diff --git a/be/src/vec/data_types/data_type_string.h 
b/be/src/vec/data_types/data_type_string.h
index 4b80356f9d6..1ac21fd1eaf 100644
--- a/be/src/vec/data_types/data_type_string.h
+++ b/be/src/vec/data_types/data_type_string.h
@@ -39,7 +39,6 @@
 namespace doris::vectorized {
 class BufferWritable;
 class IColumn;
-class ReadBuffer;
 
 class DataTypeString : public IDataType {
 public:
diff --git a/be/src/vec/data_types/data_type_struct.cpp 
b/be/src/vec/data_types/data_type_struct.cpp
index c0bd3785444..92f1268202d 100644
--- a/be/src/vec/data_types/data_type_struct.cpp
+++ b/be/src/vec/data_types/data_type_struct.cpp
@@ -44,7 +44,6 @@
 #include "vec/common/assert_cast.h"
 #include "vec/common/string_buffer.hpp"
 #include "vec/common/string_ref.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 
diff --git a/be/src/vec/data_types/data_type_struct.h 
b/be/src/vec/data_types/data_type_struct.h
index 9b9ccfc73da..c9dab82649a 100644
--- a/be/src/vec/data_types/data_type_struct.h
+++ b/be/src/vec/data_types/data_type_struct.h
@@ -43,7 +43,6 @@ class PColumnMeta;
 namespace vectorized {
 class BufferWritable;
 class IColumn;
-class ReadBuffer;
 } // namespace vectorized
 } // namespace doris
 
diff --git a/be/src/vec/data_types/serde/data_type_date_or_datetime_serde.cpp 
b/be/src/vec/data_types/serde/data_type_date_or_datetime_serde.cpp
index b959d39e6ca..3c4de20d958 100644
--- a/be/src/vec/data_types/serde/data_type_date_or_datetime_serde.cpp
+++ b/be/src/vec/data_types/serde/data_type_date_or_datetime_serde.cpp
@@ -78,9 +78,8 @@ Status DataTypeDateSerDe<T>::deserialize_one_cell_from_json(
         slice.trim_quote();
     }
     Int64 val = 0;
-    if (ReadBuffer rb(slice.data, slice.size); 
!read_date_text_impl<Int64>(val, rb)) {
-        return Status::InvalidArgument("parse date fail, string: '{}'",
-                                       std::string(rb.position(), 
rb.count()).c_str());
+    if (StringRef str(slice.data, slice.size); 
!read_date_text_impl<Int64>(val, str)) {
+        return Status::InvalidArgument("parse date fail, string: '{}'", 
str.to_string());
     }
     column_data.insert_value(val);
     return Status::OK();
@@ -127,9 +126,8 @@ Status 
DataTypeDateTimeSerDe::deserialize_one_cell_from_json(IColumn& column, Sl
         slice.trim_quote();
     }
     Int64 val = 0;
-    if (ReadBuffer rb(slice.data, slice.size); 
!read_datetime_text_impl<Int64>(val, rb)) {
-        return Status::InvalidArgument("parse datetime fail, string: '{}'",
-                                       std::string(rb.position(), 
rb.count()).c_str());
+    if (StringRef str(slice.data, slice.size); 
!read_datetime_text_impl<Int64>(val, str)) {
+        return Status::InvalidArgument("parse datetime fail, string: '{}'", 
str.to_string());
     }
     column_data.insert_value(val);
     return Status::OK();
diff --git a/be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp 
b/be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp
index 2bf24368e8b..aaac2807491 100644
--- a/be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp
+++ b/be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp
@@ -322,10 +322,9 @@ Status 
DataTypeDateTimeV2SerDe::deserialize_one_cell_from_json(IColumn& column,
         slice.trim_quote();
     }
     UInt64 val = 0;
-    if (ReadBuffer rb(slice.data, slice.size);
-        !read_datetime_v2_text_impl<UInt64>(val, rb, _scale)) {
-        return Status::InvalidArgument("parse date fail, string: '{}'",
-                                       std::string(rb.position(), 
rb.count()).c_str());
+    if (StringRef str(slice.data, slice.size);
+        !read_datetime_v2_text_impl<UInt64>(val, str, _scale)) {
+        return Status::InvalidArgument("parse date fail, string: '{}'", 
str.to_string());
     }
     column_data.insert_value(val);
     return Status::OK();
diff --git a/be/src/vec/data_types/serde/data_type_datev2_serde.cpp 
b/be/src/vec/data_types/serde/data_type_datev2_serde.cpp
index 360aa7cd59f..e0fe070e686 100644
--- a/be/src/vec/data_types/serde/data_type_datev2_serde.cpp
+++ b/be/src/vec/data_types/serde/data_type_datev2_serde.cpp
@@ -82,9 +82,8 @@ Status 
DataTypeDateV2SerDe::deserialize_one_cell_from_json(IColumn& column, Slic
     }
     auto& column_data = assert_cast<ColumnDateV2&>(column);
     UInt32 val = 0;
-    if (ReadBuffer rb(slice.data, slice.size); 
!read_date_v2_text_impl<UInt32>(val, rb)) {
-        return Status::InvalidArgument("parse date fail, string: '{}'",
-                                       std::string(rb.position(), 
rb.count()).c_str());
+    if (StringRef str(slice.data, slice.size); 
!read_date_v2_text_impl<UInt32>(val, str)) {
+        return Status::InvalidArgument("parse date fail, string: '{}'", 
str.to_string());
     }
     column_data.insert_value(val);
     return Status::OK();
diff --git a/be/src/vec/data_types/serde/data_type_ipv4_serde.cpp 
b/be/src/vec/data_types/serde/data_type_ipv4_serde.cpp
index b0ea515eca7..407be5cb230 100644
--- a/be/src/vec/data_types/serde/data_type_ipv4_serde.cpp
+++ b/be/src/vec/data_types/serde/data_type_ipv4_serde.cpp
@@ -92,11 +92,10 @@ Status 
DataTypeIPv4SerDe::deserialize_one_cell_from_json(IColumn& column, Slice&
         slice.trim_quote();
     }
     auto& column_data = reinterpret_cast<ColumnIPv4&>(column);
-    ReadBuffer rb(slice.data, slice.size);
+    StringRef str(slice.data, slice.size);
     IPv4 val = 0;
-    if (!read_ipv4_text_impl(val, rb)) {
-        return Status::InvalidArgument("parse ipv4 fail, string: '{}'",
-                                       std::string(rb.position(), 
rb.count()).c_str());
+    if (!read_ipv4_text_impl(val, str)) {
+        return Status::InvalidArgument("parse ipv4 fail, string: '{}'", 
str.to_string());
     }
     column_data.insert_value(val);
     return Status::OK();
diff --git a/be/src/vec/data_types/serde/data_type_ipv6_serde.cpp 
b/be/src/vec/data_types/serde/data_type_ipv6_serde.cpp
index 496d2d647c6..cabf5a3d275 100644
--- a/be/src/vec/data_types/serde/data_type_ipv6_serde.cpp
+++ b/be/src/vec/data_types/serde/data_type_ipv6_serde.cpp
@@ -114,11 +114,10 @@ Status 
DataTypeIPv6SerDe::deserialize_one_cell_from_json(IColumn& column, Slice&
         slice.trim_quote();
     }
     auto& column_data = reinterpret_cast<ColumnIPv6&>(column);
-    ReadBuffer rb(slice.data, slice.size);
+    StringRef str(slice.data, slice.size);
     IPv6 val = 0;
-    if (!read_ipv6_text_impl(val, rb)) {
-        return Status::InvalidArgument("parse ipv6 fail, string: '{}'",
-                                       std::string(rb.position(), 
rb.count()).c_str());
+    if (!read_ipv6_text_impl(val, str)) {
+        return Status::InvalidArgument("parse ipv6 fail, string: '{}'", 
str.to_string());
     }
     column_data.insert_value(val);
     return Status::OK();
diff --git a/be/src/vec/data_types/serde/data_type_struct_serde.h 
b/be/src/vec/data_types/serde/data_type_struct_serde.h
index c2bee3ec483..a6a5d36dc13 100644
--- a/be/src/vec/data_types/serde/data_type_struct_serde.h
+++ b/be/src/vec/data_types/serde/data_type_struct_serde.h
@@ -23,7 +23,6 @@
 
 #include "common/status.h"
 #include "data_type_serde.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris {
 class PValues;
@@ -36,78 +35,6 @@ class Arena;
 
 class DataTypeStructSerDe : public DataTypeSerDe {
 public:
-    static bool next_slot_from_string(ReadBuffer& rb, StringRef& output, bool& 
is_name,
-                                      bool& has_quota) {
-        StringRef element(rb.position(), 0);
-        has_quota = false;
-        is_name = false;
-        if (rb.eof()) {
-            return false;
-        }
-
-        // ltrim
-        while (!rb.eof() && isspace(*rb.position())) {
-            ++rb.position();
-            element.data = rb.position();
-        }
-
-        // parse string
-        if (*rb.position() == '"' || *rb.position() == '\'') {
-            const char str_sep = *rb.position();
-            size_t str_len = 1;
-            // search until next '"' or '\''
-            while (str_len < rb.count() && *(rb.position() + str_len) != 
str_sep) {
-                if (*(rb.position() + str_len) == '\\' && str_len + 1 < 
rb.count()) {
-                    ++str_len;
-                }
-                ++str_len;
-            }
-            // invalid string
-            if (str_len >= rb.count()) {
-                rb.position() = rb.end();
-                return false;
-            }
-            has_quota = true;
-            rb.position() += str_len + 1;
-            element.size += str_len + 1;
-        }
-
-        // parse element until separator ':' or ',' or end '}'
-        while (!rb.eof() && (*rb.position() != ':') && (*rb.position() != ',') 
&&
-               (rb.count() != 1 || *rb.position() != '}')) {
-            if (has_quota && !isspace(*rb.position())) {
-                return false;
-            }
-            ++rb.position();
-            ++element.size;
-        }
-        // invalid element
-        if (rb.eof()) {
-            return false;
-        }
-
-        if (*rb.position() == ':') {
-            is_name = true;
-        }
-
-        // adjust read buffer position to first char of next element
-        ++rb.position();
-
-        // rtrim
-        while (element.size > 0 && isspace(element.data[element.size - 1])) {
-            --element.size;
-        }
-
-        // trim '"' and '\'' for string
-        if (element.size >= 2 && (element.data[0] == '"' || element.data[0] == 
'\'') &&
-            element.data[0] == element.data[element.size - 1]) {
-            ++element.data;
-            element.size -= 2;
-        }
-        output = element;
-        return true;
-    }
-
     DataTypeStructSerDe(const DataTypeSerDeSPtrs& _elem_serdes_ptrs, const 
Strings names,
                         int nesting_level = 1)
             : DataTypeSerDe(nesting_level),
diff --git a/be/src/vec/exec/format/column_type_convert.h 
b/be/src/vec/exec/format/column_type_convert.h
index be16c26c8f5..621bea12316 100644
--- a/be/src/vec/exec/format/column_type_convert.h
+++ b/be/src/vec/exec/format/column_type_convert.h
@@ -485,7 +485,7 @@ struct SafeCastString<TYPE_DATETIME> {
     static bool safe_cast_string(
             const char* startptr, size_t buffer_size,
             PrimitiveTypeTraits<TYPE_DATETIME>::ColumnType::value_type* value) 
{
-        ReadBuffer buffer(reinterpret_cast<const unsigned char*>(startptr), 
buffer_size);
+        StringRef buffer(reinterpret_cast<const unsigned char*>(startptr), 
buffer_size);
         return read_datetime_text_impl<Int64>(*value, buffer);
     }
 };
@@ -495,7 +495,7 @@ struct SafeCastString<TYPE_DATETIMEV2> {
     static bool safe_cast_string(
             const char* startptr, size_t buffer_size,
             PrimitiveTypeTraits<TYPE_DATETIMEV2>::ColumnType::value_type* 
value, int scale) {
-        ReadBuffer buffer(reinterpret_cast<const unsigned char*>(startptr), 
buffer_size);
+        StringRef buffer(reinterpret_cast<const unsigned char*>(startptr), 
buffer_size);
         return read_datetime_v2_text_impl<UInt64>(*value, buffer, scale);
     }
 };
@@ -504,7 +504,7 @@ template <>
 struct SafeCastString<TYPE_DATE> {
     static bool safe_cast_string(const char* startptr, size_t buffer_size,
                                  
PrimitiveTypeTraits<TYPE_DATE>::ColumnType::value_type* value) {
-        ReadBuffer buffer(reinterpret_cast<const unsigned char*>(startptr), 
buffer_size);
+        StringRef buffer(reinterpret_cast<const unsigned char*>(startptr), 
buffer_size);
         return read_date_text_impl<Int64>(*value, buffer);
     }
 };
@@ -513,7 +513,7 @@ template <>
 struct SafeCastString<TYPE_DATEV2> {
     static bool safe_cast_string(const char* startptr, size_t buffer_size,
                                  
PrimitiveTypeTraits<TYPE_DATEV2>::ColumnType::value_type* value) {
-        ReadBuffer buffer(reinterpret_cast<const unsigned char*>(startptr), 
buffer_size);
+        StringRef buffer(reinterpret_cast<const unsigned char*>(startptr), 
buffer_size);
         return read_date_v2_text_impl<UInt32>(*value, buffer);
     }
 };
diff --git a/be/src/vec/functions/cast/cast_to_jsonb.h 
b/be/src/vec/functions/cast/cast_to_jsonb.h
index c7e4d959c22..a1170d209f3 100644
--- a/be/src/vec/functions/cast/cast_to_jsonb.h
+++ b/be/src/vec/functions/cast/cast_to_jsonb.h
@@ -26,7 +26,6 @@
 #include "vec/data_types/serde/data_type_serde.h"
 #include "vec/functions/cast/cast_to_string.h"
 #include "vec/io/io_helper.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized::CastWrapper {
 #include "common/compile_check_begin.h"
diff --git a/be/src/vec/io/io_helper.h b/be/src/vec/io/io_helper.h
index 665ecf5719c..b61f3b9e077 100644
--- a/be/src/vec/io/io_helper.h
+++ b/be/src/vec/io/io_helper.h
@@ -33,7 +33,6 @@
 #include "vec/common/uint128.h"
 #include "vec/core/field.h"
 #include "vec/core/types.h"
-#include "vec/io/reader_buffer.h"
 #include "vec/io/var_int.h"
 #include "vec/runtime/ipv4_value.h"
 #include "vec/runtime/ipv6_value.h"
@@ -113,120 +112,103 @@ bool try_read_int_text(T& x, const StringRef& buf) {
 }
 
 template <typename T>
-bool read_date_text_impl(T& x, ReadBuffer& buf) {
+bool read_date_text_impl(T& x, StringRef& buf) {
     static_assert(std::is_same_v<Int64, T>);
     auto dv = binary_cast<Int64, VecDateTimeValue>(x);
-    auto ans = dv.from_date_str(buf.position(), buf.count());
+    auto ans = dv.from_date_str(buf.data, buf.size);
     dv.cast_to_date();
 
-    // only to match the is_all_read() check to prevent return null
-    buf.position() = buf.end();
     x = binary_cast<VecDateTimeValue, Int64>(dv);
     return ans;
 }
 
 template <typename T>
-bool read_date_text_impl(T& x, ReadBuffer& buf, const cctz::time_zone& 
local_time_zone) {
+bool read_date_text_impl(T& x, StringRef& buf, const cctz::time_zone& 
local_time_zone) {
     static_assert(std::is_same_v<Int64, T>);
     auto dv = binary_cast<Int64, VecDateTimeValue>(x);
-    auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone);
+    auto ans = dv.from_date_str(buf.data, buf.size, local_time_zone);
     dv.cast_to_date();
-
-    // only to match the is_all_read() check to prevent return null
-    buf.position() = buf.end();
     x = binary_cast<VecDateTimeValue, Int64>(dv);
     return ans;
 }
 
 template <typename T>
-bool read_ipv4_text_impl(T& x, ReadBuffer& buf) {
+bool read_ipv4_text_impl(T& x, StringRef& buf) {
     static_assert(std::is_same_v<IPv4, T>);
-    bool res = IPv4Value::from_string(x, buf.position(), buf.count());
-    buf.position() = buf.end();
+    bool res = IPv4Value::from_string(x, buf.data, buf.size);
     return res;
 }
 
 template <typename T>
-bool read_ipv6_text_impl(T& x, ReadBuffer& buf) {
+bool read_ipv6_text_impl(T& x, StringRef& buf) {
     static_assert(std::is_same_v<IPv6, T>);
-    bool res = IPv6Value::from_string(x, buf.position(), buf.count());
-    buf.position() = buf.end();
+    bool res = IPv6Value::from_string(x, buf.data, buf.size);
     return res;
 }
 
 template <typename T>
-bool read_datetime_text_impl(T& x, ReadBuffer& buf) {
+bool read_datetime_text_impl(T& x, StringRef& buf) {
     static_assert(std::is_same_v<Int64, T>);
     auto dv = binary_cast<Int64, VecDateTimeValue>(x);
-    auto ans = dv.from_date_str(buf.position(), buf.count());
+    auto ans = dv.from_date_str(buf.data, buf.size);
     dv.to_datetime();
-
-    // only to match the is_all_read() check to prevent return null
-    buf.position() = buf.end();
     x = binary_cast<VecDateTimeValue, Int64>(dv);
     return ans;
 }
 
 template <typename T>
-bool read_datetime_text_impl(T& x, ReadBuffer& buf, const cctz::time_zone& 
local_time_zone) {
+bool read_datetime_text_impl(T& x, StringRef& buf, const cctz::time_zone& 
local_time_zone) {
     static_assert(std::is_same_v<Int64, T>);
     auto dv = binary_cast<Int64, VecDateTimeValue>(x);
-    auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone);
+    auto ans = dv.from_date_str(buf.data, buf.size, local_time_zone);
     dv.to_datetime();
-
-    // only to match the is_all_read() check to prevent return null
-    buf.position() = buf.end();
     x = binary_cast<VecDateTimeValue, Int64>(dv);
     return ans;
 }
 
 template <typename T>
-bool read_date_v2_text_impl(T& x, ReadBuffer& buf) {
+bool read_date_v2_text_impl(T& x, StringRef& buf) {
     static_assert(std::is_same_v<UInt32, T>);
     auto dv = binary_cast<UInt32, DateV2Value<DateV2ValueType>>(x);
-    auto ans = dv.from_date_str(buf.position(), (int)buf.count(), 
config::allow_zero_date);
+    auto ans = dv.from_date_str(buf.data, (int)buf.size, 
config::allow_zero_date);
 
     // only to match the is_all_read() check to prevent return null
-    buf.position() = buf.end();
+
     x = binary_cast<DateV2Value<DateV2ValueType>, UInt32>(dv);
     return ans;
 }
 
 template <typename T>
-bool read_date_v2_text_impl(T& x, ReadBuffer& buf, const cctz::time_zone& 
local_time_zone) {
+bool read_date_v2_text_impl(T& x, StringRef& buf, const cctz::time_zone& 
local_time_zone) {
     static_assert(std::is_same_v<UInt32, T>);
     auto dv = binary_cast<UInt32, DateV2Value<DateV2ValueType>>(x);
-    auto ans =
-            dv.from_date_str(buf.position(), buf.count(), local_time_zone, 
config::allow_zero_date);
+    auto ans = dv.from_date_str(buf.data, buf.size, local_time_zone, 
config::allow_zero_date);
 
     // only to match the is_all_read() check to prevent return null
-    buf.position() = buf.end();
+
     x = binary_cast<DateV2Value<DateV2ValueType>, UInt32>(dv);
     return ans;
 }
 
 template <typename T>
-bool read_datetime_v2_text_impl(T& x, ReadBuffer& buf, UInt32 scale = -1) {
+bool read_datetime_v2_text_impl(T& x, StringRef& buf, UInt32 scale = -1) {
     static_assert(std::is_same_v<UInt64, T>);
     auto dv = binary_cast<UInt64, DateV2Value<DateTimeV2ValueType>>(x);
-    auto ans = dv.from_date_str(buf.position(), (int)buf.count(), scale, 
config::allow_zero_date);
+    auto ans = dv.from_date_str(buf.data, (int)buf.size, scale, 
config::allow_zero_date);
 
     // only to match the is_all_read() check to prevent return null
-    buf.position() = buf.end();
+
     x = binary_cast<DateV2Value<DateTimeV2ValueType>, UInt64>(dv);
     return ans;
 }
 
 template <typename T>
-bool read_datetime_v2_text_impl(T& x, ReadBuffer& buf, const cctz::time_zone& 
local_time_zone,
+bool read_datetime_v2_text_impl(T& x, StringRef& buf, const cctz::time_zone& 
local_time_zone,
                                 UInt32 scale = -1) {
     static_assert(std::is_same_v<UInt64, T>);
     auto dv = binary_cast<UInt64, DateV2Value<DateTimeV2ValueType>>(x);
-    auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone, 
scale,
-                                config::allow_zero_date);
-
-    // only to match the is_all_read() check to prevent return null
-    buf.position() = buf.end();
+    auto ans =
+            dv.from_date_str(buf.data, buf.size, local_time_zone, scale, 
config::allow_zero_date);
     x = binary_cast<DateV2Value<DateTimeV2ValueType>, UInt64>(dv);
     return ans;
 }
@@ -273,32 +255,32 @@ StringParser::ParseResult try_read_decimal_text(T& x, 
const StringRef& in, UInt3
 }
 
 template <typename T>
-bool try_read_ipv4_text(T& x, ReadBuffer& in) {
+bool try_read_ipv4_text(T& x, StringRef& in) {
     return read_ipv4_text_impl<T>(x, in);
 }
 
 template <typename T>
-bool try_read_ipv6_text(T& x, ReadBuffer& in) {
+bool try_read_ipv6_text(T& x, StringRef& in) {
     return read_ipv6_text_impl<T>(x, in);
 }
 
 template <typename T>
-bool try_read_datetime_text(T& x, ReadBuffer& in, const cctz::time_zone& 
local_time_zone) {
+bool try_read_datetime_text(T& x, StringRef& in, const cctz::time_zone& 
local_time_zone) {
     return read_datetime_text_impl<T>(x, in, local_time_zone);
 }
 
 template <typename T>
-bool try_read_date_text(T& x, ReadBuffer& in, const cctz::time_zone& 
local_time_zone) {
+bool try_read_date_text(T& x, StringRef& in, const cctz::time_zone& 
local_time_zone) {
     return read_date_text_impl<T>(x, in, local_time_zone);
 }
 
 template <typename T>
-bool try_read_date_v2_text(T& x, ReadBuffer& in, const cctz::time_zone& 
local_time_zone) {
+bool try_read_date_v2_text(T& x, StringRef& in, const cctz::time_zone& 
local_time_zone) {
     return read_date_v2_text_impl<T>(x, in, local_time_zone);
 }
 
 template <typename T>
-bool try_read_datetime_v2_text(T& x, ReadBuffer& in, const cctz::time_zone& 
local_time_zone,
+bool try_read_datetime_v2_text(T& x, StringRef& in, const cctz::time_zone& 
local_time_zone,
                                UInt32 scale) {
     return read_datetime_v2_text_impl<T>(x, in, local_time_zone, scale);
 }
diff --git a/be/src/vec/io/reader_buffer.h b/be/src/vec/io/reader_buffer.h
deleted file mode 100644
index abee9246474..00000000000
--- a/be/src/vec/io/reader_buffer.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#pragma once
-
-#include "vec/common/string_utils/string_utils.h"
-
-namespace doris::vectorized {
-
-class ReadBuffer {
-public:
-    ReadBuffer(char* d, size_t n) : _start(d), _end(d + n) {}
-
-    ReadBuffer(const unsigned char* d, size_t n) : _start((char*)(d)), 
_end((char*)(d) + n) {}
-
-    bool eof() { return _start == _end; }
-
-    char*& position() { return _start; }
-
-    char* end() { return _end; }
-
-    size_t count() { return _end - _start; }
-
-    std::string to_string() { return std::string(_start, (_end - _start)); }
-
-private:
-    char* _start = nullptr;
-    char* _end = nullptr;
-};
-
-} // namespace doris::vectorized
diff --git a/be/src/vec/jsonb/serialize.cpp b/be/src/vec/jsonb/serialize.cpp
index cd25b14a46f..afafbe6d217 100644
--- a/be/src/vec/jsonb/serialize.cpp
+++ b/be/src/vec/jsonb/serialize.cpp
@@ -40,7 +40,6 @@
 #include "vec/core/columns_with_type_and_name.h"
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/serde/data_type_serde.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 
diff --git a/be/test/common/check_overflow.cpp 
b/be/test/common/check_overflow.cpp
index 16c50504bd2..b78e8b6ed6b 100644
--- a/be/test/common/check_overflow.cpp
+++ b/be/test/common/check_overflow.cpp
@@ -20,7 +20,6 @@
 #include "vec/common/arithmetic_overflow.h"
 #include "vec/core/types.h"
 #include "vec/io/io_helper.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 
diff --git a/be/test/vec/data_types/common_data_type_test.h 
b/be/test/vec/data_types/common_data_type_test.h
index 889b3b64736..ce6c61ec91f 100644
--- a/be/test/vec/data_types/common_data_type_test.h
+++ b/be/test/vec/data_types/common_data_type_test.h
@@ -31,7 +31,6 @@
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_array.h"
 #include "vec/data_types/data_type_map.h"
-#include "vec/io/reader_buffer.h"
 
 // this test is gonna to be a data type test template for all DataType which 
should make ut test to coverage the function defined
 // for example DataTypeIPv4 should test this function:
@@ -211,7 +210,7 @@ public:
             auto assert_column = data_type->create_column();
             for (int i = 0; i < col_to->size(); ++i) {
                 std::string s = col_to->get_data_at(i).to_string();
-                ReadBuffer rb(s.data(), s.size());
+                StringRef rb(s.data(), s.size());
                 ASSERT_EQ(Status::OK(), data_type->from_string(rb, 
assert_column.get()));
                 ASSERT_EQ(assert_column->operator[](i), 
mutableColumn->operator[](i))
                         << "i: " << i << " s: " << s << " datatype: " << 
data_type->get_name()
@@ -236,7 +235,7 @@ public:
             auto assert_column_1 = data_type->create_column();
             for (int i = 0; i < ser_col->size(); ++i) {
                 std::string s = ser_col->get_data_at(i).to_string();
-                ReadBuffer rb(s.data(), s.size());
+                StringRef rb(s.data(), s.size());
                 ASSERT_EQ(Status::OK(), data_type->from_string(rb, 
assert_column_1.get()));
                 ASSERT_EQ(assert_column_1->operator[](i), 
mutableColumn->operator[](i));
             }
diff --git a/be/test/vec/data_types/data_type_agg_state_test.cpp 
b/be/test/vec/data_types/data_type_agg_state_test.cpp
index 9f4fe228250..0897a333e16 100644
--- a/be/test/vec/data_types/data_type_agg_state_test.cpp
+++ b/be/test/vec/data_types/data_type_agg_state_test.cpp
@@ -171,7 +171,7 @@ TEST_P(DataTypeAggStateTest, FromAndToStringTest) {
         for (int i = 0; i < col_to->size(); ++i) {
             std::string s = col_to->get_data_at(i).to_string();
             std::cout << "s: " << s << std::endl;
-            ReadBuffer rb(s.data(), s.size());
+            StringRef rb(s.data(), s.size());
             ASSERT_EQ(Status::OK(),
                       datatype_agg_state_hll_union->from_string(rb, 
assert_column.get()));
             ASSERT_EQ(assert_column->operator[](i), 
agg_state_cols[0]->get_ptr()->operator[](i))
@@ -200,7 +200,7 @@ TEST_P(DataTypeAggStateTest, FromAndToStringTest) {
         auto assert_column_1 = datatype_agg_state_hll_union->create_column();
         for (int i = 0; i < ser_col->size(); ++i) {
             std::string s = ser_col->get_data_at(i).to_string();
-            ReadBuffer rb(s.data(), s.size());
+            StringRef rb(s.data(), s.size());
             ASSERT_EQ(Status::OK(),
                       datatype_agg_state_hll_union->from_string(rb, 
assert_column_1.get()));
             auto aaa = assert_column_1->operator[](i);
diff --git a/be/test/vec/data_types/data_type_bitmap_test.cpp 
b/be/test/vec/data_types/data_type_bitmap_test.cpp
index 7d10e6b8ed4..a05af25d975 100644
--- a/be/test/vec/data_types/data_type_bitmap_test.cpp
+++ b/be/test/vec/data_types/data_type_bitmap_test.cpp
@@ -133,7 +133,7 @@ TEST_P(DataTypeBitMapTest, FromAndToStringTest) {
         auto assert_column = dt_bitmap->create_column();
         for (int i = 0; i < col_to->size(); ++i) {
             std::string s = col_to->get_data_at(i).to_string();
-            ReadBuffer rb(s.data(), s.size());
+            StringRef rb(s.data(), s.size());
             ASSERT_EQ(Status::OK(), dt_bitmap->from_string(rb, 
assert_column.get()));
             ASSERT_EQ(assert_column->operator[](i), 
bitmap_cols[0]->get_ptr()->operator[](i))
                     << "i: " << i << " s: " << s << " datatype: " << 
dt_bitmap->get_name()
@@ -158,7 +158,7 @@ TEST_P(DataTypeBitMapTest, FromAndToStringTest) {
         auto assert_column_1 = dt_bitmap->create_column();
         for (int i = 0; i < ser_col->size(); ++i) {
             std::string s = ser_col->get_data_at(i).to_string();
-            ReadBuffer rb(s.data(), s.size());
+            StringRef rb(s.data(), s.size());
             ASSERT_EQ(Status::OK(), dt_bitmap->from_string(rb, 
assert_column_1.get()));
             auto aaa = assert_column_1->operator[](i);
             ASSERT_EQ(assert_column_1->operator[](i), 
bitmap_cols[0]->get_ptr()->operator[](i));
diff --git a/be/test/vec/data_types/data_type_datetime_v1_test.cpp 
b/be/test/vec/data_types/data_type_datetime_v1_test.cpp
index 18507f9e219..d7470bb7311 100644
--- a/be/test/vec/data_types/data_type_datetime_v1_test.cpp
+++ b/be/test/vec/data_types/data_type_datetime_v1_test.cpp
@@ -488,7 +488,7 @@ TEST_F(DataTypeDateTimeV1Test, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto item = col_str_to_str.get_data_at(i);
-                ReadBuffer rb((char*)item.data, item.size);
+                StringRef rb((char*)item.data, item.size);
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -498,7 +498,7 @@ TEST_F(DataTypeDateTimeV1Test, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto str = dt.to_string(source_column, i);
-                ReadBuffer rb(str.data(), str.size());
+                StringRef rb(str.data(), str.size());
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -508,7 +508,7 @@ TEST_F(DataTypeDateTimeV1Test, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto str = dt.to_string(col_with_type->get_element(i));
-                ReadBuffer rb(str.data(), str.size());
+                StringRef rb(str.data(), str.size());
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -523,7 +523,7 @@ TEST_F(DataTypeDateTimeV1Test, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto item = col_str_to_str.get_data_at(i);
-                ReadBuffer rb((char*)item.data, item.size);
+                StringRef rb((char*)item.data, item.size);
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
diff --git a/be/test/vec/data_types/data_type_decimal_test.cpp 
b/be/test/vec/data_types/data_type_decimal_test.cpp
index 1afe6920a09..8678e2600b2 100644
--- a/be/test/vec/data_types/data_type_decimal_test.cpp
+++ b/be/test/vec/data_types/data_type_decimal_test.cpp
@@ -39,7 +39,6 @@
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/data_types/data_type_number.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 static std::string test_data_dir;
@@ -594,7 +593,7 @@ TEST_F(DataTypeDecimalTest, to_string) {
             ColumnType col_from_str(0, dt.get_scale());
             for (size_t i = 0; i != row_count; ++i) {
                 auto item = col_str_to_str.get_data_at(i);
-                ReadBuffer rb((char*)item.data, item.size);
+                StringRef rb((char*)item.data, item.size);
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -604,7 +603,7 @@ TEST_F(DataTypeDecimalTest, to_string) {
             ColumnType col_from_str(0, dt.get_scale());
             for (size_t i = 0; i != row_count; ++i) {
                 auto str = dt.to_string(source_column, i);
-                ReadBuffer rb(str.data(), str.size());
+                StringRef rb(str.data(), str.size());
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -614,7 +613,7 @@ TEST_F(DataTypeDecimalTest, to_string) {
             ColumnType col_from_str(0, dt.get_scale());
             for (size_t i = 0; i != row_count; ++i) {
                 auto str = dt.to_string(col_with_type->get_element(i));
-                ReadBuffer rb(str.data(), str.size());
+                StringRef rb(str.data(), str.size());
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -629,7 +628,7 @@ TEST_F(DataTypeDecimalTest, to_string) {
             ColumnType col_from_str(0, dt.get_scale());
             for (size_t i = 0; i != row_count; ++i) {
                 auto item = col_str_to_str.get_data_at(i);
-                ReadBuffer rb((char*)item.data, item.size);
+                StringRef rb((char*)item.data, item.size);
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
diff --git a/be/test/vec/data_types/data_type_hll_test.cpp 
b/be/test/vec/data_types/data_type_hll_test.cpp
index 42071cfe069..53fc4ffbb63 100644
--- a/be/test/vec/data_types/data_type_hll_test.cpp
+++ b/be/test/vec/data_types/data_type_hll_test.cpp
@@ -132,7 +132,7 @@ TEST_P(DataTypeHLLTest, FromAndToStringTest) {
         auto assert_column = dt_hll->create_column();
         for (int i = 0; i < col_to->size(); ++i) {
             std::string s = col_to->get_data_at(i).to_string();
-            ReadBuffer rb(s.data(), s.size());
+            StringRef rb(s.data(), s.size());
             ASSERT_EQ(Status::OK(), dt_hll->from_string(rb, 
assert_column.get()));
             ASSERT_EQ(assert_column->operator[](i), 
hll_cols[0]->get_ptr()->operator[](i))
                     << "i: " << i << " s: " << s << " datatype: " << 
dt_hll->get_name()
@@ -157,7 +157,7 @@ TEST_P(DataTypeHLLTest, FromAndToStringTest) {
         auto assert_column_1 = dt_hll->create_column();
         for (int i = 0; i < ser_col->size(); ++i) {
             std::string s = ser_col->get_data_at(i).to_string();
-            ReadBuffer rb(s.data(), s.size());
+            StringRef rb(s.data(), s.size());
             ASSERT_EQ(Status::OK(), dt_hll->from_string(rb, 
assert_column_1.get()));
             auto aaa = assert_column_1->operator[](i);
             ASSERT_EQ(assert_column_1->operator[](i), 
hll_cols[0]->get_ptr()->operator[](i));
diff --git a/be/test/vec/data_types/data_type_jsonb_test.cpp 
b/be/test/vec/data_types/data_type_jsonb_test.cpp
index 284aa1cbadf..33ae72af807 100644
--- a/be/test/vec/data_types/data_type_jsonb_test.cpp
+++ b/be/test/vec/data_types/data_type_jsonb_test.cpp
@@ -43,7 +43,6 @@
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/data_types/data_type_nullable.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 static std::string test_data_dir;
@@ -301,7 +300,7 @@ TEST_F(DataTypeJsonbTest, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count - 1; ++i) {
                 auto item = col_str_to_str.get_data_at(i);
-                ReadBuffer rb((char*)item.data, item.size);
+                StringRef rb((char*)item.data, item.size);
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_EQ(col_from_str.get_data_at(i), 
source_column.get_data_at(i));
             }
@@ -311,7 +310,7 @@ TEST_F(DataTypeJsonbTest, to_string) {
             // now default Jsonb value is empty. use from_string will 
throw:[INVALID_ARGUMENT]json parse error: Empty document for value
             for (size_t i = 0; i != row_count; ++i) {
                 auto str = dt.to_string(source_column, i);
-                ReadBuffer rb(str.data(), str.size());
+                StringRef rb(str.data(), str.size());
                 if (i == row_count - 1) {
                     continue;
                 } else {
@@ -330,7 +329,7 @@ TEST_F(DataTypeJsonbTest, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count - 1; ++i) {
                 auto item = col_str_to_str.get_data_at(i);
-                ReadBuffer rb((char*)item.data, item.size);
+                StringRef rb((char*)item.data, item.size);
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_data_at(i), 
source_column.get_data_at(i));
diff --git a/be/test/vec/data_types/data_type_number_test.cpp 
b/be/test/vec/data_types/data_type_number_test.cpp
index 50c82ac6056..b76229c1c65 100644
--- a/be/test/vec/data_types/data_type_number_test.cpp
+++ b/be/test/vec/data_types/data_type_number_test.cpp
@@ -40,7 +40,6 @@
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/data_types/data_type_nullable.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 static std::string test_data_dir;
@@ -386,7 +385,7 @@ TEST_F(DataTypeNumberTest, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto item = col_str_to_str.get_data_at(i);
-                ReadBuffer rb((char*)item.data, item.size);
+                StringRef rb((char*)item.data, item.size);
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -396,7 +395,7 @@ TEST_F(DataTypeNumberTest, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto str = dt.to_string(source_column, i);
-                ReadBuffer rb(str.data(), str.size());
+                StringRef rb(str.data(), str.size());
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -406,7 +405,7 @@ TEST_F(DataTypeNumberTest, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto str = dt.to_string(col_with_type->get_element(i));
-                ReadBuffer rb(str.data(), str.size());
+                StringRef rb(str.data(), str.size());
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -421,7 +420,7 @@ TEST_F(DataTypeNumberTest, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto item = col_str_to_str.get_data_at(i);
-                ReadBuffer rb((char*)item.data, item.size);
+                StringRef rb((char*)item.data, item.size);
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
diff --git a/be/test/vec/data_types/data_type_string_test.cpp 
b/be/test/vec/data_types/data_type_string_test.cpp
index 194f26df9f6..8d03c98dc87 100644
--- a/be/test/vec/data_types/data_type_string_test.cpp
+++ b/be/test/vec/data_types/data_type_string_test.cpp
@@ -42,7 +42,6 @@
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/data_types/data_type_nullable.h"
 #include "vec/data_types/serde/data_type_string_serde.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 static std::string test_data_dir;
@@ -298,7 +297,7 @@ TEST_F(DataTypeStringTest, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto item = col_str_to_str.get_data_at(i);
-                ReadBuffer rb((char*)item.data, item.size);
+                StringRef rb((char*)item.data, item.size);
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_data_at(i), 
source_column.get_data_at(i));
@@ -308,7 +307,7 @@ TEST_F(DataTypeStringTest, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto str = dt.to_string(source_column, i);
-                ReadBuffer rb(str.data(), str.size());
+                StringRef rb(str.data(), str.size());
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_data_at(i), 
source_column.get_data_at(i));
@@ -323,7 +322,7 @@ TEST_F(DataTypeStringTest, to_string) {
             ColumnType col_from_str;
             for (size_t i = 0; i != row_count; ++i) {
                 auto item = col_str_to_str.get_data_at(i);
-                ReadBuffer rb((char*)item.data, item.size);
+                StringRef rb((char*)item.data, item.size);
                 auto status = dt.from_string(rb, &col_from_str);
                 EXPECT_TRUE(status.ok());
                 EXPECT_EQ(col_from_str.get_data_at(i), 
source_column.get_data_at(i));
diff --git a/be/test/vec/data_types/data_type_struct_test.cpp 
b/be/test/vec/data_types/data_type_struct_test.cpp
index b82fd587496..daf610c705b 100644
--- a/be/test/vec/data_types/data_type_struct_test.cpp
+++ b/be/test/vec/data_types/data_type_struct_test.cpp
@@ -476,7 +476,7 @@ TEST_F(DataTypeStructTest, formString) {
     std::cout << "res_to_string: " << res_to_string << std::endl
               << "expect: {100, asd}" << std::endl;
     EXPECT_EQ(res_to_string, "{100, asd}");
-    ReadBuffer buffer(res_to_string.data(), res_to_string.size());
+    StringRef buffer(res_to_string.data(), res_to_string.size());
     auto status = st->from_string(buffer, res_column.get());
     EXPECT_EQ(status, Status::OK()) << "Failed to from_string: " << status;
     EXPECT_EQ(res_column->size(), 1) << "Failed to from_string, size is not 1";
diff --git a/be/test/vec/data_types/data_type_time_v2_test.cpp 
b/be/test/vec/data_types/data_type_time_v2_test.cpp
index cdddc98d512..4ca5b7dd61e 100644
--- a/be/test/vec/data_types/data_type_time_v2_test.cpp
+++ b/be/test/vec/data_types/data_type_time_v2_test.cpp
@@ -812,7 +812,7 @@ TEST_F(DataTypeDateTimeV2Test, to_string) {
                 ColumnType col_from_str;
                 for (size_t i = 0; i != row_count; ++i) {
                     auto item = col_str_to_str.get_data_at(i);
-                    ReadBuffer rb((char*)item.data, item.size);
+                    StringRef rb((char*)item.data, item.size);
                     auto status = dt.from_string(rb, &col_from_str);
                     EXPECT_TRUE(status.ok());
                     EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -827,7 +827,7 @@ TEST_F(DataTypeDateTimeV2Test, to_string) {
                 if constexpr (std::is_same_v<ColumnType, ColumnTimeV2>) {
                     res_column.push_back(str);
                 } else {
-                    ReadBuffer rb(str.data(), str.size());
+                    StringRef rb(str.data(), str.size());
                     auto status = dt.from_string(rb, &col_from_str);
                     EXPECT_TRUE(status.ok());
                     EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -848,7 +848,7 @@ TEST_F(DataTypeDateTimeV2Test, to_string) {
                 if constexpr (std::is_same_v<ColumnType, ColumnTimeV2>) {
                     res_column.push_back(str);
                 } else {
-                    ReadBuffer rb(str.data(), str.size());
+                    StringRef rb(str.data(), str.size());
                     auto status = dt.from_string(rb, &col_from_str);
                     EXPECT_TRUE(status.ok());
                     EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
@@ -874,7 +874,7 @@ TEST_F(DataTypeDateTimeV2Test, to_string) {
                 if constexpr (std::is_same_v<ColumnType, ColumnTimeV2>) {
                     res_column.push_back(item.to_string());
                 } else {
-                    ReadBuffer rb((char*)item.data, item.size);
+                    StringRef rb((char*)item.data, item.size);
                     auto status = dt.from_string(rb, &col_from_str);
                     EXPECT_TRUE(status.ok());
                     EXPECT_EQ(col_from_str.get_element(i), 
source_column.get_element(i));
diff --git a/be/test/vec/data_types/datetime_round_test.cpp 
b/be/test/vec/data_types/datetime_round_test.cpp
index 501368d82e3..edec6a7e4bf 100644
--- a/be/test/vec/data_types/datetime_round_test.cpp
+++ b/be/test/vec/data_types/datetime_round_test.cpp
@@ -34,7 +34,6 @@
 #include "vec/core/types.h" // UInt32
 #include "vec/data_types/data_type_date_or_datetime_v2.h"
 #include "vec/data_types/data_type_factory.hpp"
-#include "vec/io/reader_buffer.h"
 
 using namespace doris;
 using namespace doris::vectorized;
@@ -47,9 +46,9 @@ static void from_string_checker(UInt32 scale, const 
std::string& rounding,
                     DataTypeFactory::instance().create_data_type(
                             doris::FieldType::OLAP_FIELD_TYPE_DATETIMEV2, 0, 
scale));
 
-    // constructor of ReadBuffer is not const(which seems not reasonable),
+    // constructor of StringRefis not const(which seems not reasonable),
     // so we need to cast away const
-    ReadBuffer rb(const_cast<char*>(rounding.c_str()), rounding.size());
+    StringRef rb(const_cast<char*>(rounding.c_str()), rounding.size());
     ColumnDateTimeV2::MutablePtr column = ColumnDateTimeV2::create(0);
     // DataTypeDateTimeV2::from_string
     auto rt = datetime_ptr->from_string(rb, &(*column));
@@ -98,7 +97,7 @@ static void serialization_checker(UInt32 scale, const 
std::string& input,
                     DataTypeFactory::instance().create_data_type(
                             doris::FieldType::OLAP_FIELD_TYPE_DATETIMEV2, 0, 
scale));
 
-    ReadBuffer rb(const_cast<char*>(input.c_str()), input.size());
+    StringRef rb(const_cast<char*>(input.c_str()), input.size());
     ColumnDateTimeV2::MutablePtr column = ColumnDateTimeV2::create(0);
     auto rt = datetime_ptr->from_string(rb, &(*column));
     EXPECT_TRUE(rt.ok());
diff --git a/be/test/vec/data_types/from_string_test.cpp 
b/be/test/vec/data_types/from_string_test.cpp
index d56f8451430..2eea3736ca4 100644
--- a/be/test/vec/data_types/from_string_test.cpp
+++ b/be/test/vec/data_types/from_string_test.cpp
@@ -23,7 +23,6 @@
 #include "vec/data_types/data_type.h"
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/data_types/serde_utils.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 
@@ -197,7 +196,7 @@ TEST(FromStringTest, ScalaWrapperFieldVsDataType) {
                 std::cout << "the ith : " << i << std::endl;
                 std::string test_str = std::get<1>(type_pair)[i];
                 // data_type from_string
-                ReadBuffer rb_test(test_str.data(), test_str.size());
+                StringRef rb_test(test_str.data(), test_str.size());
                 Status st = data_type_ptr->from_string(rb_test, col.get());
                 if (std::get<3>(type_pair)[i].empty()) {
                     EXPECT_EQ(st.ok(), false);
@@ -246,9 +245,9 @@ TEST(FromStringTest, ScalaWrapperFieldVsDataType) {
             std::string max_s = max_wf->to_string();
             std::string rand_date = rand_wf->to_string();
 
-            ReadBuffer min_rb(min_s.data(), min_s.size());
-            ReadBuffer max_rb(max_s.data(), max_s.size());
-            ReadBuffer rand_rb(rand_date.data(), rand_date.size());
+            StringRef min_rb(min_s.data(), min_s.size());
+            StringRef max_rb(max_s.data(), max_s.size());
+            StringRef rand_rb(rand_date.data(), rand_date.size());
 
             auto col = data_type_ptr->create_column();
             Status st = data_type_ptr->from_string(min_rb, col.get());
@@ -312,7 +311,7 @@ TEST(FromStringTest, ScalaWrapperFieldVsDataType) {
             std::unique_ptr<WrapperField> 
rand_wf(WrapperField::create_by_type(type));
             Status st = rand_wf->from_string(pair.second, 0, 0);
             std::string rand_ip = rand_wf->to_string();
-            ReadBuffer rand_rb(rand_ip.data(), rand_ip.size());
+            StringRef rand_rb(rand_ip.data(), rand_ip.size());
             auto col = data_type_ptr->create_column();
             st = data_type_ptr->from_string(rand_rb, col.get());
             EXPECT_EQ(st.ok(), true);
@@ -329,7 +328,7 @@ TEST(FromStringTest, ScalaWrapperFieldVsDataType) {
             std::unique_ptr<WrapperField> 
rand_wf(WrapperField::create_by_type(type));
             Status st = rand_wf->from_string(pair.second, 0, 0);
             EXPECT_EQ(st.ok(), false);
-            ReadBuffer rand_rb(pair.second.data(), pair.second.size());
+            StringRef rand_rb(pair.second.data(), pair.second.size());
             auto col = data_type_ptr->create_column();
             st = data_type_ptr->from_string(rand_rb, col.get());
             EXPECT_EQ(st.ok(), false);
diff --git a/be/test/vec/data_types/serde/data_type_serde_csv_test.cpp 
b/be/test/vec/data_types/serde/data_type_serde_csv_test.cpp
index d93a67d85d8..a6fbb01f081 100644
--- a/be/test/vec/data_types/serde/data_type_serde_csv_test.cpp
+++ b/be/test/vec/data_types/serde/data_type_serde_csv_test.cpp
@@ -32,7 +32,6 @@
 #include "vec/data_types/data_type_struct.h"
 #include "vec/data_types/serde/data_type_serde.h"
 #include "vec/data_types/serde_utils.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 // This test aim to make sense for csv serde of data types.
diff --git a/be/test/vec/data_types/serde/data_type_serde_string_test.cpp 
b/be/test/vec/data_types/serde/data_type_serde_string_test.cpp
index b69e409e908..125d870d5b8 100644
--- a/be/test/vec/data_types/serde/data_type_serde_string_test.cpp
+++ b/be/test/vec/data_types/serde/data_type_serde_string_test.cpp
@@ -41,7 +41,6 @@
 #include "vec/data_types/data_type_factory.hpp"
 #include "vec/data_types/data_type_nullable.h"
 #include "vec/data_types/data_type_string.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 static std::string test_data_dir;
diff --git a/be/test/vec/data_types/serde/data_type_serde_text_test.cpp 
b/be/test/vec/data_types/serde/data_type_serde_text_test.cpp
index 0c19c914a88..18c0500a1c9 100644
--- a/be/test/vec/data_types/serde/data_type_serde_text_test.cpp
+++ b/be/test/vec/data_types/serde/data_type_serde_text_test.cpp
@@ -28,7 +28,6 @@
 #include "vec/data_types/data_type_map.h"
 #include "vec/data_types/serde/data_type_serde.h"
 #include "vec/data_types/serde_utils.h"
-#include "vec/io/reader_buffer.h"
 
 namespace doris::vectorized {
 // This test aim to make sense for text serde of data types.
@@ -524,7 +523,7 @@ TEST(TextSerde, ComplexTypeSerdeTextTest) {
                 }
                 {
                     // from_string
-                    ReadBuffer rb(rand_str.data(), rand_str.size());
+                    StringRef rb(rand_str.data(), rand_str.size());
                     Status status = array_data_type_ptr->from_string(rb, 
col2.get());
                     EXPECT_EQ(status.ok(), true);
                     auto ser_col = ColumnString::create();
@@ -683,7 +682,7 @@ TEST(TextSerde, ComplexTypeSerdeTextTest) {
                 }
                 // from_string
                 {
-                    ReadBuffer rb(rand_str.data(), rand_str.size());
+                    StringRef rb(rand_str.data(), rand_str.size());
                     std::cout << "from string rb: " << rb.to_string() << 
std::endl;
                     Status stat = map_data_type_ptr->from_string(rb, 
col2.get());
                     std::cout << stat.to_json() << std::endl;
@@ -854,7 +853,7 @@ TEST(TextSerde, ComplexTypeWithNestedSerdeTextTest) {
                 }
                 {
                     // from_string
-                    ReadBuffer rb(rand_str.data(), rand_str.size());
+                    StringRef rb(rand_str.data(), rand_str.size());
                     auto col2 = array_data_type_ptr->create_column();
                     Status status = array_data_type_ptr->from_string(rb, 
col2.get());
                     if (expect_from_string_str == "") {
@@ -1009,7 +1008,7 @@ TEST(TextSerde, ComplexTypeWithNestedSerdeTextTest) {
                 }
                 {
                     // from_string
-                    ReadBuffer rb(rand_str.data(), rand_str.size());
+                    StringRef rb(rand_str.data(), rand_str.size());
                     auto col2 = array_data_type_ptr->create_column();
                     Status status = array_data_type_ptr->from_string(rb, 
col2.get());
                     if (expect_from_string_str == "") {
@@ -1227,7 +1226,7 @@ TEST(TextSerde, ComplexTypeWithNestedSerdeTextTest) {
                 }
                 {
                     // from_string
-                    ReadBuffer rb(rand_str.data(), rand_str.size());
+                    StringRef rb(rand_str.data(), rand_str.size());
                     auto col2 = map_data_type_ptr->create_column();
                     Status status = map_data_type_ptr->from_string(rb, 
col2.get());
                     if (expect_from_string_str == "") {
@@ -1368,7 +1367,7 @@ TEST(TextSerde, ComplexTypeWithNestedSerdeTextTest) {
                 }
                 {
                     // from_string
-                    ReadBuffer rb(rand_str.data(), rand_str.size());
+                    StringRef rb(rand_str.data(), rand_str.size());
                     auto col2 = array_data_type_ptr->create_column();
                     Status status = array_data_type_ptr->from_string(rb, 
col2.get());
                     if (expect_from_string_str == "") {
diff --git a/be/test/vec/exec/column_type_convert_test.cpp 
b/be/test/vec/exec/column_type_convert_test.cpp
index 3e30931178a..d8a721dede0 100644
--- a/be/test/vec/exec/column_type_convert_test.cpp
+++ b/be/test/vec/exec/column_type_convert_test.cpp
@@ -1468,7 +1468,7 @@ TEST_F(ColumnTypeConverterTest, 
TestDateTimeV2ToNumericConversions) {
 
     auto parse_datetimev2_str = [](const std::string& datetime_str) {
         UInt64 x = 0;
-        ReadBuffer buf((char*)datetime_str.data(), datetime_str.size());
+        StringRef buf((char*)datetime_str.data(), datetime_str.size());
         bool ok = read_datetime_v2_text_impl(x, buf, 6);
         CHECK(ok) << "parse_datetimev2_str failed for: " << datetime_str;
         return x;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to