@@ -137,61 +137,61 @@ static std::unique_ptr<PaxColumn> CreateDecodeColumn(
137137 std::unique_ptr<PaxColumn> column_rc;
138138 switch (bits) {
139139 case 16 : {
140- auto buffer_for_read = std::make_shared <DataBuffer<int16>>(
140+ auto buffer_for_read = std::make_unique <DataBuffer<int16>>(
141141 reinterpret_cast <int16 *>(encoded_buff), encoded_len, false , false );
142142 buffer_for_read->Brush (encoded_len);
143143
144144 if (storage_type == PaxStorageFormat::kTypeStoragePorcNonVec ) {
145145 auto int_column =
146146 ColumnOptCreateTraits<PaxEncodingColumn, int16>::create_decoding (
147147 origin_len / sizeof (int16), std::move (decoding_option));
148- int_column->Set (buffer_for_read);
148+ int_column->Set (std::move ( buffer_for_read) );
149149 column_rc = std::move (int_column);
150150 } else {
151151 auto int_column =
152152 ColumnOptCreateTraits<PaxVecEncodingColumn, int16>::create_decoding (
153153 origin_len / sizeof (int16), std::move (decoding_option));
154- int_column->Set (buffer_for_read, column_not_nulls);
154+ int_column->Set (std::move ( buffer_for_read) , column_not_nulls);
155155 column_rc = std::move (int_column);
156156 }
157157 break ;
158158 }
159159 case 32 : {
160- auto buffer_for_read = std::make_shared <DataBuffer<int32>>(
160+ auto buffer_for_read = std::make_unique <DataBuffer<int32>>(
161161 reinterpret_cast <int32 *>(encoded_buff), encoded_len, false , false );
162162 buffer_for_read->Brush (encoded_len);
163163
164164 if (storage_type == PaxStorageFormat::kTypeStoragePorcNonVec ) {
165165 auto int_column =
166166 ColumnOptCreateTraits<PaxEncodingColumn, int32>::create_decoding (
167167 origin_len / sizeof (int32), std::move (decoding_option));
168- int_column->Set (buffer_for_read);
168+ int_column->Set (std::move ( buffer_for_read) );
169169 column_rc = std::move (int_column);
170170 } else {
171171 auto int_column =
172172 ColumnOptCreateTraits<PaxVecEncodingColumn, int32>::create_decoding (
173173 origin_len / sizeof (int32), std::move (decoding_option));
174- int_column->Set (buffer_for_read, column_not_nulls);
174+ int_column->Set (std::move ( buffer_for_read) , column_not_nulls);
175175 column_rc = std::move (int_column);
176176 }
177177 break ;
178178 }
179179 case 64 : {
180- auto buffer_for_read = std::make_shared <DataBuffer<int64>>(
180+ auto buffer_for_read = std::make_unique <DataBuffer<int64>>(
181181 reinterpret_cast <int64 *>(encoded_buff), encoded_len, false , false );
182182 buffer_for_read->Brush (encoded_len);
183183
184184 if (storage_type == PaxStorageFormat::kTypeStoragePorcNonVec ) {
185185 auto int_column =
186186 ColumnOptCreateTraits<PaxEncodingColumn, int64>::create_decoding (
187187 origin_len / sizeof (int64), std::move (decoding_option));
188- int_column->Set (buffer_for_read);
188+ int_column->Set (std::move ( buffer_for_read) );
189189 column_rc = std::move (int_column);
190190 } else {
191191 auto int_column =
192192 ColumnOptCreateTraits<PaxVecEncodingColumn, int64>::create_decoding (
193193 origin_len / sizeof (int64), std::move (decoding_option));
194- int_column->Set (buffer_for_read, column_not_nulls);
194+ int_column->Set (std::move ( buffer_for_read) , column_not_nulls);
195195 column_rc = std::move (int_column);
196196 }
197197 break ;
@@ -749,14 +749,14 @@ TEST_P(PaxNonFixedColumnCompressTest,
749749 auto non_fixed_column_for_read = new PaxNonFixedEncodingColumn (
750750 number_of_rows * number, sizeof (int32) * number_of_rows,
751751 std::move (decoding_option));
752- auto data_buffer_for_read = std::make_shared <DataBuffer<char >>(
752+ auto data_buffer_for_read = std::make_unique <DataBuffer<char >>(
753753 encoded_buff, encoded_len, false , false );
754754 data_buffer_for_read->Brush (encoded_len);
755- auto length_buffer_cpy = std::make_shared <DataBuffer<int32>>(
755+ auto length_buffer_cpy = std::make_unique <DataBuffer<int32>>(
756756 (int32 *)offset_stream_buff, offset_stream_len, false , false );
757757 length_buffer_cpy->BrushAll ();
758- non_fixed_column_for_read->Set (data_buffer_for_read, length_buffer_cpy ,
759- origin_len);
758+ non_fixed_column_for_read->Set (std::move ( data_buffer_for_read) ,
759+ std::move (length_buffer_cpy), origin_len);
760760 ASSERT_EQ (non_fixed_column_for_read->GetCompressLevel (), 5 );
761761 char *verify_buff;
762762 size_t verify_len;
0 commit comments