Copilot commented on code in PR #59340:
URL: https://github.com/apache/doris/pull/59340#discussion_r2647100927


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/TableScanParams.java:
##########
@@ -29,24 +29,32 @@ public class TableScanParams {
     public static final String INCREMENTAL_READ = "incr";
     public static final String BRANCH = "branch";
     public static final String TAG = "tag";
+    // for paimon read-optimized system table
+    public static final String RO = "ro";
     private static final ImmutableSet<String> VALID_PARAM_TYPES = 
ImmutableSet.of(
             INCREMENTAL_READ,
             BRANCH,
-            TAG);
+            TAG,
+            RO);
 
     private final String paramType;
-    // There are two ways to pass parameters to a function.
+    // There are three ways to pass parameters to a function.
     // - One is in map form, where the data is stored in `mapParams`.
     //   such as: @func_name('param1'='value1', 'param2'='value2', 
'param3'='value3')
-    // - The other is in list form, where the data is stored in `listParams`.
+    // - Another other one is in list form, where the data is stored in 
`listParams`.
     //   such as: `listParams` is used for @func_name('value1', 'value2', 
'value3')
+    // - The third one is in short form, now only used for paimon 'ro' table.
+    //   such as: @ro
     private final Map<String, String> mapParams;
     private final List<String> listParams;
 
     private void validate() {
         if (!VALID_PARAM_TYPES.contains(paramType)) {
             throw new IllegalArgumentException("Invalid param type: " + 
paramType);
         }
+        if (isRo() && (!mapParams.isEmpty() || !listParams.isEmpty())) {
+            throw new IllegalArgumentException("Please use '@ro' for Paimon 
read-optimized system table");

Review Comment:
   The error message says "Please use '@ro' for Paimon read-optimized system 
table", but this validation is triggered when RO is used WITH parameters (like 
@ro('param'='value')). The message could be clearer by specifying that RO 
should be used without parameters, for example: "The '@ro' parameter for Paimon 
read-optimized tables should be used without arguments".
   ```suggestion
               throw new IllegalArgumentException("The '@ro' parameter for 
Paimon read-optimized tables must be used without arguments");
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/TableScanParams.java:
##########
@@ -29,24 +29,32 @@ public class TableScanParams {
     public static final String INCREMENTAL_READ = "incr";
     public static final String BRANCH = "branch";
     public static final String TAG = "tag";
+    // for paimon read-optimized system table
+    public static final String RO = "ro";
     private static final ImmutableSet<String> VALID_PARAM_TYPES = 
ImmutableSet.of(
             INCREMENTAL_READ,
             BRANCH,
-            TAG);
+            TAG,
+            RO);
 
     private final String paramType;
-    // There are two ways to pass parameters to a function.
+    // There are three ways to pass parameters to a function.
     // - One is in map form, where the data is stored in `mapParams`.
     //   such as: @func_name('param1'='value1', 'param2'='value2', 
'param3'='value3')
-    // - The other is in list form, where the data is stored in `listParams`.
+    // - Another other one is in list form, where the data is stored in 
`listParams`.

Review Comment:
   The phrase "Another other one" is grammatically incorrect. It should be 
either "Another one" or "The other one" to maintain grammatical clarity.
   ```suggestion
       // - Another one is in list form, where the data is stored in 
`listParams`.
   ```



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

Reply via email to