HappenLee commented on code in PR #23236:
URL: https://github.com/apache/doris/pull/23236#discussion_r1299873249


##########
be/src/exec/tablet_info.cpp:
##########
@@ -213,6 +214,27 @@ 
VOlapTablePartitionParam::VOlapTablePartitionParam(std::shared_ptr<OlapTableSche
         _partition_block.insert(
                 {slot->get_empty_mutable_column(), slot->get_data_type_ptr(), 
slot->col_name()});
     }
+
+    if (t_param.__isset.enable_automatic_partition && 
t_param.enable_automatic_partition) {
+        _is_auto_partiton = true;
+        DCHECK(t_param.__isset.partition_function_exprs);
+        //TODO: Is there a way to avoid the dependency of slot index?
+        DCHECK(t_param.partition_function_exprs[0].nodes[0].node_type ==
+               TExprNodeType::FUNCTION_CALL)
+                << t_param.partition_function_exprs[0].nodes[0].node_type;
+        DCHECK(t_param.partition_function_exprs[0].nodes[1].node_type == 
TExprNodeType::SLOT_REF)
+                << t_param.partition_function_exprs[0].nodes[1].node_type;
+        DCHECK(t_param.partition_function_exprs[0].nodes[2].node_type ==
+               TExprNodeType::STRING_LITERAL)
+                << t_param.partition_function_exprs[0].nodes[2].node_type;
+
+        
vectorized::VExpr::create_expr_tree(t_param.partition_function_exprs[0],
+                                            _part_func_ctx); //RETURN IF ERROR
+        _partition_function = _part_func_ctx->root();
+        _part_interval =

Review Comment:
   if not the data_trun() function. maybe do not have child(1) please recheck 
the logic



##########
be/src/exec/tablet_info.cpp:
##########
@@ -213,6 +214,27 @@ 
VOlapTablePartitionParam::VOlapTablePartitionParam(std::shared_ptr<OlapTableSche
         _partition_block.insert(
                 {slot->get_empty_mutable_column(), slot->get_data_type_ptr(), 
slot->col_name()});
     }
+
+    if (t_param.__isset.enable_automatic_partition && 
t_param.enable_automatic_partition) {
+        _is_auto_partiton = true;
+        DCHECK(t_param.__isset.partition_function_exprs);
+        //TODO: Is there a way to avoid the dependency of slot index?
+        DCHECK(t_param.partition_function_exprs[0].nodes[0].node_type ==
+               TExprNodeType::FUNCTION_CALL)
+                << t_param.partition_function_exprs[0].nodes[0].node_type;
+        DCHECK(t_param.partition_function_exprs[0].nodes[1].node_type == 
TExprNodeType::SLOT_REF)
+                << t_param.partition_function_exprs[0].nodes[1].node_type;
+        DCHECK(t_param.partition_function_exprs[0].nodes[2].node_type ==
+               TExprNodeType::STRING_LITERAL)
+                << t_param.partition_function_exprs[0].nodes[2].node_type;
+
+        
vectorized::VExpr::create_expr_tree(t_param.partition_function_exprs[0],
+                                            _part_func_ctx); //RETURN IF ERROR
+        _partition_function = _part_func_ctx->root();
+        _part_interval =

Review Comment:
   if not the data_trun() function. maybe do not have child(1) please recheck 
the logic



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to