morrySnow commented on code in PR #47296:
URL: https://github.com/apache/doris/pull/47296#discussion_r1925340990
##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -1226,6 +1231,40 @@ private boolean isQuery() {
&& !(((LogicalPlanAdapter) parsedStmt).getLogicalPlan()
instanceof Command));
}
+ private boolean isProfileSafeStmt() {
+ //
fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java:131
+ // Only generate profile for NereidsPlanner.
+ if (!(parsedStmt instanceof LogicalPlanAdapter)) {
+ return false;
+ }
+
+ LogicalPlan plan = ((LogicalPlanAdapter) parsedStmt).getLogicalPlan();
+
+ if (plan instanceof InsertIntoTableCommand) {
+ LogicalPlan logicalPlan = ((InsertIntoTableCommand)
plan).getLogicalQuery();
+ if ((logicalPlan instanceof UnboundTableSink) || (logicalPlan
instanceof UnboundBaseExternalTableSink)) {
+ if (logicalPlan.children() == null ||
logicalPlan.children().isEmpty()) {
+ return false;
+ }
+
+ for (Plan child : logicalPlan.children()) {
+ if (child instanceof InlineTable) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ // Generate profile for CreateTableCommand(mainly for create as
select).
Review Comment:
comment is different with code
##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -1226,6 +1231,40 @@ private boolean isQuery() {
&& !(((LogicalPlanAdapter) parsedStmt).getLogicalPlan()
instanceof Command));
}
+ private boolean isProfileSafeStmt() {
+ //
fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java:131
+ // Only generate profile for NereidsPlanner.
+ if (!(parsedStmt instanceof LogicalPlanAdapter)) {
+ return false;
+ }
+
+ LogicalPlan plan = ((LogicalPlanAdapter) parsedStmt).getLogicalPlan();
+
+ if (plan instanceof InsertIntoTableCommand) {
+ LogicalPlan logicalPlan = ((InsertIntoTableCommand)
plan).getLogicalQuery();
+ if ((logicalPlan instanceof UnboundTableSink) || (logicalPlan
instanceof UnboundBaseExternalTableSink)) {
+ if (logicalPlan.children() == null ||
logicalPlan.children().isEmpty()) {
+ return false;
+ }
+
+ for (Plan child : logicalPlan.children()) {
+ if (child instanceof InlineTable) {
+ return false;
+ }
+ }
+ }
Review Comment:
add comment to explain what does `InlineTable` mean
--
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]