starocean999 commented on code in PR #48031:
URL: https://github.com/apache/doris/pull/48031#discussion_r1960875529


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -5776,6 +5781,90 @@ public LogicalPlan 
visitDescribeTable(DorisParser.DescribeTableContext ctx) {
         return new DescribeCommand(tableName, false, partitionNames);
     }
 
+    @Override
+    public LogicalPlan visitAnalyzeTable(DorisParser.AnalyzeTableContext ctx) {
+        TableNameInfo tableNameInfo = new 
TableNameInfo(visitMultipartIdentifier(ctx.name));
+        PartitionNamesInfo partitionNamesInfo = null;
+        if (ctx.partitionSpec() != null) {
+            Pair<Boolean, List<String>> partitionSpec = 
visitPartitionSpec(ctx.partitionSpec());
+            partitionNamesInfo = new PartitionNamesInfo(partitionSpec.first, 
partitionSpec.second);
+        }
+        List<String> columnNames = null;
+        if (ctx.columns != null) {
+            columnNames = visitIdentifierList(ctx.columns);
+        }
+        Map<String, String> propertiesMap = new HashMap<>();
+        // default values
+        propertiesMap.put(AnalyzeProperties.PROPERTY_SYNC, "false");
+        propertiesMap.put(AnalyzeProperties.PROPERTY_ANALYSIS_TYPE, 
AnalysisInfo.AnalysisType.FUNDAMENTALS.toString());
+        for (DorisParser.AnalyzePropertiesContext aps : 
ctx.analyzeProperties()) {
+            Map<String, String> map = visitAnalyzeProperties(aps);
+            propertiesMap.putAll(map);
+        }
+        propertiesMap.putAll(visitPropertyClause(ctx.propertyClause()));
+        AnalyzeProperties properties = new AnalyzeProperties(propertiesMap);
+        AnalyzeTableOp analyzeDatabaseOp = new AnalyzeTableOp(tableNameInfo,
+                partitionNamesInfo, columnNames, properties);
+        return new AnalyzeCommand(analyzeDatabaseOp);
+    }
+
+    @Override
+    public LogicalPlan visitAnalyzeDatabase(DorisParser.AnalyzeDatabaseContext 
ctx) {
+        String ctlName = null;
+        String dbName = null;
+        List<String> nameParts = visitMultipartIdentifier(ctx.name);
+        if (nameParts.size() == 1) {
+            dbName = nameParts.get(0);
+        } else if (nameParts.size() == 2) {
+            ctlName = nameParts.get(0);
+            dbName = nameParts.get(1);
+        } else {
+            throw new AnalysisException("nameParts in analyze database should 
be [ctl.]db");
+        }
+
+        Map<String, String> propertiesMap = new HashMap<>();
+        // default values
+        propertiesMap.put(AnalyzeProperties.PROPERTY_SYNC, "false");

Review Comment:
   why need set PROPERTY_SYNC to false as default value?



-- 
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