You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/10/10 15:44:56 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #1944: Segment v2 use string's real length(#1943)

imay commented on a change in pull request #1944: Segment v2 use string's real length(#1943)
URL: https://github.com/apache/incubator-doris/pull/1944#discussion_r333596185
 
 

 ##########
 File path: be/src/olap/rowset/segment_v2/segment_writer.cpp
 ##########
 @@ -55,17 +55,17 @@ Status SegmentWriter::init(uint32_t write_mbytes_per_sec) {
         bool is_nullable = column.is_nullable();
         column_meta->set_is_nullable(is_nullable);
 
-        // TODO(zc): we can add type_info into TabletColumn?
-        const TypeInfo* type_info = get_type_info(column.type());
-        DCHECK(type_info != nullptr);
-
         ColumnWriterOptions opts;
         opts.compression_type = segment_v2::CompressionTypePB::LZ4F;
         // now we create zone map for key columns
         if (column.is_key()) {
             opts.need_zone_map = true;
         }
-        std::unique_ptr<ColumnWriter> writer(new ColumnWriter(opts, type_info, is_nullable, _output_file.get()));
+
+        Field* field = FieldFactory::create(column);
+        DCHECK(field != nullptr);
+
+        std::unique_ptr<ColumnWriter> writer(new ColumnWriter(opts, field, is_nullable, _output_file.get()));
 
 Review comment:
   ```suggestion
           std::unique_ptr<ColumnWriter> writer(new ColumnWriter(opts, std::move(field), is_nullable, _output_file.get()));
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org