jerryshao commented on code in PR #10106:
URL: https://github.com/apache/gravitino/pull/10106#discussion_r2889394263


##########
maintenance/optimizer/src/main/java/org/apache/gravitino/maintenance/optimizer/command/SubmitUpdateStatsJobCommand.java:
##########
@@ -0,0 +1,248 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.maintenance.optimizer.command;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.base.Preconditions;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.TreeMap;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.gravitino.client.GravitinoClient;
+import org.apache.gravitino.job.JobHandle;
+import org.apache.gravitino.maintenance.optimizer.common.conf.OptimizerConfig;
+import 
org.apache.gravitino.maintenance.optimizer.common.util.GravitinoClientUtils;
+import 
org.apache.gravitino.maintenance.optimizer.common.util.IcebergSparkConfigUtils;
+
+/**
+ * Handles CLI command {@code submit-update-stats-job} for submitting built-in 
Iceberg update stats
+ * jobs directly from optimizer CLI.
+ */
+public class SubmitUpdateStatsJobCommand implements OptimizerCommandExecutor {
+
+  private static final String JOB_TEMPLATE_NAME = 
"builtin-iceberg-update-stats";
+  private static final String DEFAULT_UPDATE_MODE = "stats";

Review Comment:
   The CLI-level default is `"stats"`, but 
`IcebergUpdateStatsAndMetricsJob.DEFAULT_UPDATE_MODE` defaults to `"all"`. This 
means: submitting via the optimizer CLI without `--update-mode` runs 
stats-only, while invoking the job directly without args runs both 
stats+metrics. The two entry points have diverging defaults for the same 
parameter. Consider aligning them, or at minimum add a comment here explaining 
the intentional difference.



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

Reply via email to