xiedeyantu commented on code in PR #48031:
URL: https://github.com/apache/doris/pull/48031#discussion_r1961576699
##########
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");
Review Comment:
> why need set PROPERTY_SYNC to false as default value?
old planner need this as default value.
##########
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?
old planner need this 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]