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

morningman pushed a commit to branch branch-0.15
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit 36ae508076dee8daa75c0f548821c979a26bcdb6
Author: jiafeng.zhang <zhang...@gmail.com>
AuthorDate: Thu Oct 28 13:56:59 2021 +0800

    Modify Chinese comment (#6951)
    
    Modify Chinese comment
---
 be/src/olap/olap_common.h     | 19 +++++-----
 be/src/olap/olap_cond.cpp     | 38 ++++++++++----------
 be/src/olap/out_stream.cpp    | 35 +++++++++---------
 be/src/olap/out_stream.h      | 56 ++++++++++++++---------------
 be/src/olap/schema_change.cpp | 84 +++++++++++++++++++++----------------------
 5 files changed, 117 insertions(+), 115 deletions(-)

diff --git a/be/src/olap/olap_common.h b/be/src/olap/olap_common.h
index 0769870..7fe970e 100644
--- a/be/src/olap/olap_common.h
+++ b/be/src/olap/olap_common.h
@@ -146,10 +146,10 @@ enum FieldType {
     OLAP_FIELD_TYPE_STRING = 26
 };
 
-// 定义Field支持的所有聚集方法
-// 注意,实际中并非所有的类型都能使用以下所有的聚集方法
-// 例如对于string类型使用SUM就是毫无意义的(但不会导致程序崩溃)
-// Field类的实现并没有进行这类检查,应该在创建表的时候进行约束
+// Define all aggregation methods supported by Field
+// Note that in practice, not all types can use all the following aggregation 
methods
+// For example, it is meaningless to use SUM for the string type (but it will 
not cause the program to crash)
+// The implementation of the Field class does not perform such checks, and 
should be constrained when creating the table
 enum FieldAggregationMethod {
     OLAP_FIELD_AGGREGATION_NONE = 0,
     OLAP_FIELD_AGGREGATION_SUM = 1,
@@ -163,11 +163,14 @@ enum FieldAggregationMethod {
     OLAP_FIELD_AGGREGATION_REPLACE_IF_NOT_NULL = 8,
 };
 
-// 压缩算法类型
+// Compression algorithm type
 enum OLAPCompressionType {
-    OLAP_COMP_TRANSPORT = 1, // 用于网络传输的压缩算法,压缩率低,cpu开销低
-    OLAP_COMP_STORAGE = 2,   // 用于硬盘数据的压缩算法,压缩率高,cpu开销大
-    OLAP_COMP_LZ4 = 3,       // 用于储存的压缩算法,压缩率低,cpu开销低
+    // Compression algorithm used for network transmission, low compression 
rate, low cpu overhead
+    OLAP_COMP_TRANSPORT = 1,
+    // Compression algorithm used for hard disk data, with high compression 
rate and high CPU overhead 
+    OLAP_COMP_STORAGE = 2,  
+    // The compression algorithm used for storage, the compression rate is 
low, and the cpu overhead is low 
+    OLAP_COMP_LZ4 = 3,       
 };
 
 enum PushType {
diff --git a/be/src/olap/olap_cond.cpp b/be/src/olap/olap_cond.cpp
index c9184c3..4bc6b51 100644
--- a/be/src/olap/olap_cond.cpp
+++ b/be/src/olap/olap_cond.cpp
@@ -35,25 +35,25 @@ using std::vector;
 
 using doris::ColumnStatistics;
 
-//此文件主要用于对用户发送的查询条件和删除条件进行处理,逻辑上二者都可以分为三层
+//This file is mainly used to process query conditions and delete conditions 
sent by users. Logically, both can be divided into three layers
 //Condition->Condcolumn->Cond
-//Condition表示用户发的单个条件
-//Condcolumn表示一列上所有条件的集合。
-//Conds表示一列上的单个条件.
-//对于查询条件而言,各层级的条件之间都是逻辑与的关系
-//对于delete条件则有不同。Cond和Condcolumn之间是逻辑与的关系,而Condtion之间是逻辑或的关系。
-
-//具体到实现。
-//eval是用来过滤查询条件,包括堆row、block、version的过滤,具体使用哪一层看具体的调用地方。
-//  1. 没有单独过滤行的过滤条件,这部分在查询层进行。
-//  2. 过滤block在SegmentReader里面。
-//  3. 过滤version在Reader里面。调用delta_pruing_filter
+//Condition represents a single condition sent by the user
+//Condcolumn represents the collection of all conditions on a column.
+//Conds represents a single condition on a column.
+//For query conditions, the conditions of each level are logical AND 
relationships
+//There are different conditions for delete. The relationship between Cond and 
Condcolumn is logical AND, and the relationship between Condtion is logical OR.
+
+//Specific to the realization.
+//eval is used to filter query conditions, including the filtering of heap 
row, block, and version. Which layer is used depends on the specific calling 
place.
+// 1. There is no filter condition to filter rows separately, this part is 
carried out in the query layer.
+// 2. The filter block is in the SegmentReader.
+// 3. Filter version in Reader. Call delta_pruing_filter
 //
-//del_eval用来过滤删除条件,包括堆block和version的过滤,但是这个过滤比eval多了一个状态,即部分过滤。
-//  1. 对行的过滤在DeleteHandler。
-//     这部分直接调用delete_condition_eval实现,内部调用eval函数,因为对row的过滤不涉及部分过滤这种状态。
-//  2. 过滤block是在SegmentReader里面,直接调用del_eval
-//  3. 过滤version实在Reader里面,调用rowset_pruning_filter
+//del_eval is used to filter deletion conditions, including the filtering of 
heap block and version, but this filtering has one more state than eval, that 
is, partial filtering.
+// 1. The filtering of rows is in DeleteHandler.
+// This part directly calls delete_condition_eval to achieve, and internally 
calls the eval function, because the filtering of row does not involve partial 
filtering.
+// 2. The filter block is in the SegmentReader, call del_eval directly
+// 3. The filter version is actually in Reader, call rowset_pruning_filter
 
 namespace doris {
 
@@ -176,7 +176,7 @@ OLAPStatus Cond::init(const TCondition& tcond, const 
TabletColumn& column) {
 
 bool Cond::eval(const RowCursorCell& cell) const {
     if (cell.is_null() && op != OP_IS) {
-        //任何非OP_IS operand和NULL的运算都是false
+        //Any operation other than OP_IS operand and NULL is false
         return false;
     }
 
@@ -215,7 +215,7 @@ bool Cond::eval(const RowCursorCell& cell) const {
 }
 
 bool Cond::eval(const std::pair<WrapperField*, WrapperField*>& statistic) 
const {
-    //通过单列上的单个查询条件对version进行过滤
+    //A single query condition filtered by a single column
     // When we apply column statistic, Field can be NULL when type is Varchar,
     // we just ignore this cond
     if (statistic.first == nullptr || statistic.second == nullptr) {
diff --git a/be/src/olap/out_stream.cpp b/be/src/olap/out_stream.cpp
index 8882085..b6900c6 100644
--- a/be/src/olap/out_stream.cpp
+++ b/be/src/olap/out_stream.cpp
@@ -186,22 +186,22 @@ OLAPStatus OutStream::_spill() {
         return OLAP_SUCCESS;
     }
 
-    // 如果不压缩,直接读取current,注意output之后 current会被清空并设置为NULL
+    // If it is not compressed, read current directly. Note that current will 
be cleared and set to NULL after output
     if (_compressor == NULL) {
         _current->flip();
         _output_uncompress();
     } else {
-        // 如果需要压缩,
-        // current移动到head后边的位置,留出head的空间
+        //If compression is required,
+        // The current moves to the position behind the head, leaving space 
for the head
         _current->set_limit(_current->position());
         _current->set_position(sizeof(StreamHead));
 
-        // 分配compress和overflow,这两个buffer大小其实是一样的
+        //Allocate compress and overflow, the two buffer sizes are actually 
the same
         if (OLAP_SUCCESS != (res = _make_sure_output_buffer())) {
             return res;
         }
 
-        // 吧 current解压到compress和overflow
+        // Decompress current to compress and overflow
         uint64_t head_pos = _compressed->position();
         _compressed->set_position(head_pos + sizeof(StreamHead));
         bool smaller = false;
@@ -213,8 +213,8 @@ OLAPStatus OutStream::_spill() {
         }
 
         if (smaller) {
-            // 数据都压缩到_output和_overflow里, 重置_current
-            // 注意这种情况下,current并没有被释放,因为实际上输出的compress
+            // Data are compressed into _output and _overflow, reset _current
+            // Note that in this case, current is not released, because the 
compress actually output
             _current->set_position(sizeof(StreamHead));
             _current->set_limit(_current->capacity());
 
@@ -228,15 +228,14 @@ OLAPStatus OutStream::_spill() {
 
             _spilled_bytes += sizeof(StreamHead) + output_bytes;
         } else {
-            // 直接将_current输出
-
-            // 如果之前还有_compress, 先输出m_compress
-            // 注意此时一定没有_overflow
+             // directly output _current
+             // If there is _compress before, output m_compress first
+             // Note that there must be no _overflow at this time
             _compressed->set_position(head_pos);
 
             if (head_pos != 0) {
-                // 之前_compressed里有数据, 这种情况下先输出compressed,
-                // 此时_overflow一定是空的
+                // There was data in _compressed before, in this case, output 
compressed first,
+                // At this time _overflow must be empty 
                 _output_compressed();
             }
 
@@ -253,11 +252,11 @@ OLAPStatus OutStream::write(const char* buffer, uint64_t 
length) {
     uint64_t remain = length;
 
     while (remain > 0) {
-        // 之所以扔进来,是因为在压缩的情况下,_current只会被创建一次
-        // 之后一直在复用,输出的是compress
-        // 而在未压缩的情况下,current会被放进列表,而无法复用,原因是
-        // 如果复用的话,会修改之前的内容,因此需要重新分配。
-        // 只分配一次那么第二块就会挂掉
+         // The reason why it was thrown in is because in the case of 
compression, _current will only be created once
+         // It has been multiplexing since then, and the output is compress
+         // In the case of uncompressed, current will be put into the list and 
cannot be reused. The reason is
+         // If it is reused, the previous content will be modified, so it 
needs to be redistributed.
+         // Only allocate once and the second block will hang up
         if (NULL == _current) {
             res = _create_new_input_buffer();
             if (OLAP_SUCCESS != res) {
diff --git a/be/src/olap/out_stream.h b/be/src/olap/out_stream.h
index 6473091..2376758 100644
--- a/be/src/olap/out_stream.h
+++ b/be/src/olap/out_stream.h
@@ -27,26 +27,26 @@
 namespace doris {
 class FileHandler;
 
-// 与OrcFile不同,我们底层没有HDFS无法保证存储数据的可靠性,所以必须写入
-// 校验值,在读取数据的时候检验这一校验值
-// 采用TLV类型的头部,有足够的扩展性
+// Unlike OrcFile, we cannot guarantee the reliability of stored data without 
HDFS at the bottom, so we must write
+// Check value, check this check value when reading data
+// Adopt TLV type header, which has sufficient scalability
 struct StreamHead {
     enum StreamType { UNCOMPRESSED = 0, COMPRESSED = 1 };
-    uint8_t type;         // 256种类型, 应该足够以后的扩展了
-    uint32_t length : 24; // 24位长度
-    uint32_t checksum;    // 32位校验值
+    uint8_t type;         // 256 types, should be enough for future expansion
+    uint32_t length : 24; // 24-bit length
+    uint32_t checksum;    // 32-bit check value
     StreamHead() : type(COMPRESSED), length(0), checksum(0) {}
 } __attribute__((packed));
 
-// 输出流,使用一组ByteBuffer缓存所有的数据
+// Output stream, use a set of ByteBuffer to buffer all data
 class OutStream {
 public:
-    // 输出流支持压缩或者不压缩两种模式,如果启用压缩,给出压缩函数
+    // The output stream supports two modes: compressed or uncompressed. If 
compression is enabled, the compression function is given
     explicit OutStream(uint32_t buffer_size, Compressor compressor);
 
     ~OutStream();
 
-    // 向流输出一个字节
+    // Output a byte to the stream
     inline OLAPStatus write(char byte) {
         OLAPStatus res = OLAP_SUCCESS;
         if (_current == nullptr) {
@@ -71,26 +71,26 @@ public:
         return _current->put(byte);
     }
 
-    // 向流输出一段数据
+    // Output a piece of data to the stream
     OLAPStatus write(const char* buffer, uint64_t length);
 
-    // 将流的当前位置记录在索引项中
+    // Record the current position of the stream in the index entry
     void get_position(PositionEntryWriter* index_entry) const;
 
-    // 返回流中所有数据的大小
+    // Returns the size of all data in the stream
     uint64_t get_stream_length() const;
 
-    // 返回已经分配的缓冲区大小
+    // Returns the size of the buffer that has been allocated
     uint64_t get_total_buffer_size() const;
 
-    // 将缓存的数据流输出到文件
+    // Output the cached data stream to a file
     OLAPStatus write_to_file(FileHandler* file_handle, uint32_t 
write_mbytes_per_sec) const;
 
     bool is_suppressed() const { return _is_suppressed; }
     void suppress() { _is_suppressed = true; }
-    // 将数据输出到output_buffers
+    // Output data to output_buffers
     OLAPStatus flush();
-    // 计算输出数据的crc32值
+    // Calculate the crc32 value of the output data
     uint32_t crc32(uint32_t checksum) const;
     const std::vector<StorageByteBuffer*>& output_buffers() { return 
_output_buffers; }
 
@@ -115,33 +115,33 @@ private:
     void _output_compressed();
     OLAPStatus _make_sure_output_buffer();
 
-    uint32_t _buffer_size;                           // 压缩块大小
-    Compressor _compressor;                          // 压缩函数,如果为NULL表示不压缩
-    std::vector<StorageByteBuffer*> _output_buffers; // 缓冲所有的输出
-    bool _is_suppressed;                             // 流是否被终止
-    StorageByteBuffer* _current;                     // 缓存未压缩的数据
-    StorageByteBuffer* _compressed;                  // 即将输出到output_buffers中的字节
-    StorageByteBuffer* _overflow;                    // _output中放不下的字节
-    uint64_t _spilled_bytes;                         // 已经输出到output的字节数
+    uint32_t _buffer_size;                           // Compressed block size
+    Compressor _compressor;                          // Compression function, 
if NULL means no compression
+    std::vector<StorageByteBuffer*> _output_buffers; // Buffer all output
+    bool _is_suppressed;                             // Whether the stream is 
terminated
+    StorageByteBuffer* _current;                     // Cache uncompressed data
+    StorageByteBuffer* _compressed;                  // Bytes to be output to 
output_buffers
+    StorageByteBuffer* _overflow;                    // Bytes that can't fit 
in _output
+    uint64_t _spilled_bytes;                         // The number of bytes 
that have been output to output
 
     DISALLOW_COPY_AND_ASSIGN(OutStream);
 };
 
-// 定义输出流的工厂方法
-// 将所有的输出流托管,同时封装了诸如压缩算法,是否启用Index,block大小等信息
+// Define the factory method of the output stream
+// Host all output streams, and encapsulate information such as compression 
algorithm, whether to enable Index, block size, etc.
 class OutStreamFactory {
 public:
     explicit OutStreamFactory(CompressKind compress_kind, uint32_t 
stream_buffer_size);
 
     ~OutStreamFactory();
 
-    // 创建后的stream的生命期依旧由OutStreamFactory管理
+    //The lifetime of the stream after creation is still managed by 
OutStreamFactory
     OutStream* create_stream(uint32_t column_unique_id, 
StreamInfoMessage::Kind kind);
 
     const std::map<StreamName, OutStream*>& streams() const { return _streams; 
}
 
 private:
-    std::map<StreamName, OutStream*> _streams; // 所有创建过的流
+    std::map<StreamName, OutStream*> _streams; // All created streams
     CompressKind _compress_kind;
     Compressor _compressor;
     uint32_t _stream_buffer_size;
diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp
index 49a7f96..8a1eb34 100644
--- a/be/src/olap/schema_change.cpp
+++ b/be/src/olap/schema_change.cpp
@@ -466,13 +466,13 @@ OLAPStatus RowBlockChanger::change_row_block(const 
RowBlock* ref_block, int32_t
         return OLAP_ERR_NOT_INITED;
     }
 
-    // a.1 先判断数据是否需要过滤,最终只有标记为1的才是留下需要的
-    //   对于没有filter的来说,相当于全部设置为1后留下
+    // a.1 First determine whether the data needs to be filtered, and finally 
only those marked as 1 are left as needed
+    // For those without filter, it is equivalent to leave after setting all 
to 1
     const uint32_t row_num = ref_block->row_block_info().row_num;
-    // (0表示过滤掉不要,1表示要,过程中2表示此row要切后续不需要再比较其他列)
+    // (0 means no need to filter out, 1 means yes, during the process 2 means 
that this row needs to be cut and there is no need to compare other columns 
later)
     std::vector<int8_t> is_data_left_vec(row_num, 1);
 
-    // 一行一行地进行比较
+    // Compare each row
     for (size_t row_index = 0; row_index < row_num; ++row_index) {
         ref_block->get_row(row_index, &read_helper);
 
@@ -486,14 +486,14 @@ OLAPStatus RowBlockChanger::change_row_block(const 
RowBlock* ref_block, int32_t
         }
     }
 
-    // a.2 计算留下的row num
+    // a.2 Calculate the left row num
     uint32_t new_row_num = row_num - *filtered_rows;
 
     const bool need_filter_data = (new_row_num != row_num);
     const bool filter_all = (new_row_num == 0);
 
     MemPool* mem_pool = mutable_block->mem_pool();
-    // b. 根据前面的过滤信息,只对还标记为1的处理
+    // b. According to the previous filtering information, only processes that 
are also marked as 1
     for (size_t i = 0, len = mutable_block->tablet_schema().num_columns(); 
!filter_all && i < len;
          ++i) {
         int32_t ref_column = _schema_mapping[i].ref_column;
@@ -537,15 +537,15 @@ OLAPStatus RowBlockChanger::change_row_block(const 
RowBlock* ref_block, int32_t
             FieldType reftype = 
ref_block->tablet_schema().column(ref_column).type();
             FieldType newtype = 
mutable_block->tablet_schema().column(i).type();
             if (newtype == reftype) {
-                // 效率低下,也可以直接计算变长域拷贝,但仍然会破坏封装
+                // Low efficiency, you can also directly calculate the 
variable length domain copy, but it will still destroy the package
                 for (size_t row_index = 0, new_row_index = 0;
                      row_index < ref_block->row_block_info().row_num; 
++row_index) {
-                    // 不需要的row,每次处理到这个row时就跳过
+                    // Unneeded row, skip every time this row is processed
                     if (need_filter_data && is_data_left_vec[row_index] == 0) {
                         continue;
                     }
 
-                    // 指定新的要写入的row index(不同于读的row_index)
+                    // Specify the new row index to be written (different from 
the read row_index)
                     mutable_block->get_row(new_row_index++, &write_helper);
                     ref_block->get_row(row_index, &read_helper);
 
@@ -597,10 +597,10 @@ OLAPStatus RowBlockChanger::change_row_block(const 
RowBlock* ref_block, int32_t
                         }
                     }
                 }
-                // 从ref_column 写入 i列。
+                // Write column i from ref_column.
             } else {
                 // copy and alter the field
-                // 此处可以暂时不动,新类型暂时不涉及类型转换
+                // You can stay here for the time being, the new type does not 
involve type conversion for the time being
                 switch (reftype) {
                 case OLAP_FIELD_TYPE_TINYINT:
                     CONVERT_FROM_TYPE(int8_t);
@@ -637,10 +637,10 @@ OLAPStatus RowBlockChanger::change_row_block(const 
RowBlock* ref_block, int32_t
                 }
             }
         } else {
-            // 新增列,写入默认值
+            // New column, write default value
             for (size_t row_index = 0, new_row_index = 0;
                  row_index < ref_block->row_block_info().row_num; ++row_index) 
{
-                // 不需要的row,每次处理到这个row时就跳过
+                // Unneeded row, skip every time this row is processed
                 if (need_filter_data && is_data_left_vec[row_index] == 0) {
                     continue;
                 }
@@ -658,9 +658,9 @@ OLAPStatus RowBlockChanger::change_row_block(const 
RowBlock* ref_block, int32_t
         }
     }
 
-    // NOTE 当前mutable_block的内存row_num还是和ref一样多
-    //  (其实在init时就可以重新init成少的,filter留下的new_row_num)
-    // 在split_table时,可能会出现因为过滤导致没有数据
+    // NOTE The current row_num of mutable_block is still as much as ref
+    // (Actually, you can re-init into less when init, the new_row_num left by 
the filter)
+    // In split_table, there may be no data due to filtering
     mutable_block->finalize(new_row_num);
     return OLAP_SUCCESS;
 }
@@ -766,7 +766,7 @@ OLAPStatus RowBlockAllocator::allocate(RowBlock** 
row_block, size_t num_rows, bo
         return OLAP_SUCCESS;
     }
 
-    // TODO(lijiao) : 为什么舍弃原有的m_row_block_buffer
+    // TODO(lijiao) : Why abandon the original m_row_block_buffer
     *row_block = new (nothrow) RowBlock(&_tablet_schema);
 
     if (*row_block == nullptr) {
@@ -1041,7 +1041,7 @@ OLAPStatus 
SchemaChangeDirectly::process(RowsetReaderSharedPtr rowset_reader,
         RETURN_NOT_OK(reserve_block(&new_row_block, 
ref_row_block->row_block_info().row_num,
                                     _row_block_allocator));
 
-        // 将ref改为new。这一步按道理来说确实需要等大的块,但理论上和writer无关。
+        // Change ref to new. This step is reasonable to say that it does need 
to wait for a large block, but theoretically it has nothing to do with the 
writer.
         uint64_t filtered_rows = 0;
         res = _row_block_changer.change_row_block(ref_row_block, 
rowset_reader->version().second,
                                                   new_row_block.get(), 
&filtered_rows);
@@ -1096,10 +1096,10 @@ SchemaChangeWithSorting::SchemaChangeWithSorting(const 
RowBlockChanger& row_bloc
           _row_block_changer(row_block_changer),
           _memory_limitation(memory_limitation),
           _row_block_allocator(nullptr) {
-    // 每次SchemaChange做外排的时候,会写一些临时版本(比如999,1000,1001),为避免Cache冲突,临时
-    // 版本进行2个处理:
-    // 1. 随机值作为VersionHash
-    // 2. 版本号取一个BIG NUMBER加上当前正在进行SchemaChange的版本号
+    // Every time SchemaChange is used for external rowing, some temporary 
versions (such as 999, 1000, 1001) will be written, in order to avoid Cache 
conflicts, temporary
+    // The version performs 2 processes:
+    // 1. Random value as VersionHash
+    // 2. The version number takes a BIG NUMBER plus the version number of the 
current SchemaChange
     _temp_delta_versions.first = (1 << 28);
     _temp_delta_versions.second = (1 << 28);
     // TODO(zyh): remove the magic number
@@ -1666,8 +1666,8 @@ OLAPStatus 
SchemaChangeHandler::schema_version_convert(TabletSharedPtr base_tabl
               << "base_tablet=" << base_tablet->full_name()
               << ", new_tablet=" << new_tablet->full_name();
 
-    // a. 解析Alter请求,转换成内部的表示形式
-    // 不使用DELETE_DATA命令指定的删除条件
+    // a. Parse the Alter request and convert it into an internal 
representation
+    // Do not use the delete condition specified by the DELETE_DATA command
     RowBlockChanger rb_changer(new_tablet->tablet_schema());
     bool sc_sorting = false;
     bool sc_directly = false;
@@ -1679,9 +1679,9 @@ OLAPStatus 
SchemaChangeHandler::schema_version_convert(TabletSharedPtr base_tabl
         return res;
     }
 
-    // NOTE split_table如果使用row_block,会导致原block变小
-    // 但由于历史数据在后续base/cumulative后还是会变成正常,故用directly也可以
-    // b. 生成历史数据转换器
+    // NOTE split_table if row_block is used, the original block will become 
smaller
+    // But since the historical data will become normal after the subsequent 
base/cumulative, it is also possible to use directly
+    // b. Generate historical data converter
     SchemaChange* sc_procedure = nullptr;
     if (sc_sorting) {
         size_t memory_limitation = 
config::memory_limitation_per_thread_for_schema_change;
@@ -1702,7 +1702,7 @@ OLAPStatus 
SchemaChangeHandler::schema_version_convert(TabletSharedPtr base_tabl
         return OLAP_ERR_MALLOC_ERROR;
     }
 
-    // c. 转换数据
+    // c. Convert data
     DeleteHandler delete_handler;
     std::vector<ColumnId> return_columns;
     size_t num_cols = base_tablet->tablet_schema().num_columns();
@@ -1817,15 +1817,15 @@ OLAPStatus 
SchemaChangeHandler::_convert_historical_rowsets(const SchemaChangePa
         }
     }
 
-    // change中增加了filter信息,在_parse_request中会设置filter的column信息
-    // 并在每次row block的change时,过滤一些数据
+    // Add filter information in change, and filter column information will be 
set in _parse_request
+    // And filter some data every time the row block changes
     RowBlockChanger rb_changer(sc_params.new_tablet->tablet_schema(), 
sc_params.delete_handler);
 
     bool sc_sorting = false;
     bool sc_directly = false;
     SchemaChange* sc_procedure = nullptr;
 
-    // a. 解析Alter请求,转换成内部的表示形式
+    // a.Parse the Alter request and convert it into an internal representation
     OLAPStatus res = _parse_request(sc_params.base_tablet, 
sc_params.new_tablet, &rb_changer,
                                     &sc_sorting, &sc_directly, 
sc_params.materialized_params_map);
     if (res != OLAP_SUCCESS) {
@@ -1833,7 +1833,7 @@ OLAPStatus 
SchemaChangeHandler::_convert_historical_rowsets(const SchemaChangePa
         goto PROCESS_ALTER_EXIT;
     }
 
-    // b. 生成历史数据转换器
+    // b. Generate historical data converter
     if (sc_sorting) {
         size_t memory_limitation = 
config::memory_limitation_per_thread_for_schema_change;
         LOG(INFO) << "doing schema change with sorting for base_tablet "
@@ -1857,14 +1857,14 @@ OLAPStatus 
SchemaChangeHandler::_convert_historical_rowsets(const SchemaChangePa
         goto PROCESS_ALTER_EXIT;
     }
 
-    // c. 转换历史数据
+    // c.Convert historical data
     for (auto& rs_reader : sc_params.ref_rowset_readers) {
         VLOG_TRACE << "begin to convert a history rowset. version=" << 
rs_reader->version().first
                    << "-" << rs_reader->version().second;
 
         // set status for monitor
-        // 只要有一个new_table为running,ref table就设置为running
-        // NOTE 如果第一个sub_table先fail,这里会继续按正常走
+        // As long as there is a new_table as running, ref table is set as 
running
+        // NOTE If the first sub_table fails first, it will continue to go as 
normal here
         TabletSharedPtr new_tablet = sc_params.new_tablet;
 
         RowsetWriterContext writer_context;
@@ -1906,8 +1906,8 @@ OLAPStatus 
SchemaChangeHandler::_convert_historical_rowsets(const SchemaChangePa
         }
         new_tablet->data_dir()->remove_pending_ids(ROWSET_ID_PREFIX +
                                                    
rowset_writer->rowset_id().to_string());
-        // 将新版本的数据加入header
-        // 为了防止死锁的出现,一定要先锁住旧表,再锁住新表
+        // Add the new version of the data to the header
+        // In order to prevent the occurrence of deadlock, we must first lock 
the old table, and then lock the new table
         sc_params.new_tablet->obtain_push_lock();
         RowsetSharedPtr new_rowset = rowset_writer->build();
         if (new_rowset == nullptr) {
@@ -1941,7 +1941,7 @@ OLAPStatus 
SchemaChangeHandler::_convert_historical_rowsets(const SchemaChangePa
                    << " version=" << rs_reader->version().first << "-"
                    << rs_reader->version().second;
     }
-    // XXX: 此时应该不取消SchemaChange状态,因为新Delta还要转换成新旧Schema的版本
+    // XXX:The SchemaChange state should not be canceled at this time, because 
the new Delta has to be converted to the old and new Schema version
 PROCESS_ALTER_EXIT : {
     // save tablet meta here because rowset meta is not saved during add rowset
     WriteLock new_wlock(sc_params.new_tablet->get_header_lock_ptr());
@@ -1960,7 +1960,7 @@ PROCESS_ALTER_EXIT : {
 }
 
 // @static
-// 分析column的mapping以及filter key的mapping
+// Analyze the mapping of the column and the mapping of the filter key
 OLAPStatus SchemaChangeHandler::_parse_request(
         TabletSharedPtr base_tablet, TabletSharedPtr new_tablet, 
RowBlockChanger* rb_changer,
         bool* sc_sorting, bool* sc_directly,
@@ -2014,7 +2014,7 @@ OLAPStatus SchemaChangeHandler::_parse_request(
             continue;
         }
 
-        // 新加列走这里
+        // Newly added column go here
         //if (new_column_schema.is_allow_null || 
new_column_schema.has_default_value) {
         {
             column_mapping->ref_column = -1;
@@ -2034,7 +2034,7 @@ OLAPStatus SchemaChangeHandler::_parse_request(
             continue;
         }
 
-        // XXX: 只有DROP COLUMN时,遇到新Schema转旧Schema时会进入这里。
+        // XXX: Only when DROP COLUMN, you will enter here when you encounter 
a new Schema to an old Schema。
         column_mapping->ref_column = -1;
 
         if (OLAP_SUCCESS != (res = _init_column_mapping(column_mapping, 
new_column, ""))) {
@@ -2048,7 +2048,7 @@ OLAPStatus SchemaChangeHandler::_parse_request(
 
     // Check if re-aggregation is needed.
     *sc_sorting = false;
-    // 若Key列的引用序列出现乱序,则需要重排序
+    // If the reference sequence of the Key column is out of order, it needs 
to be reordered
     int num_default_value = 0;
 
     for (int i = 0, new_schema_size = new_tablet->num_key_columns(); i < 
new_schema_size; ++i) {

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

Reply via email to