Copilot commented on code in PR #3162:
URL: https://github.com/apache/doris-website/pull/3162#discussion_r2595307172


##########
versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/other-functions/grouping-id.md:
##########
@@ -41,7 +41,7 @@ SELECT
   COUNT(uid) AS `Employee Count`
 FROM employee 
 GROUP BY ROLLUP(department, level)
-ORDER BY GROUPING_ID(department, level) ASC;
+ORDER BY department desc;
 ```
 

Review Comment:
   While the ORDER BY clause has been correctly changed from using GROUPING_ID 
to using the department column, there's no explanatory note added to inform 
users about this limitation. Consider adding a note before or after this 
example explaining that GROUPING_ID cannot be used in ORDER BY clauses when 
using the Nereids planner (versions 3.x and 4.x), and that the error message 
would be "LOGICAL_SORT cannot contain GroupingScalarFunction expression."
   
   This would help users understand why the example doesn't demonstrate ORDER 
BY with GROUPING_ID and prevent them from encountering the same error.
   ```suggestion
   
   > **Note:**  
   > When using the Nereids planner (versions 3.x and 4.x), the `GROUPING_ID` 
function cannot be used in the `ORDER BY` clause. Attempting to do so will 
result in the error:  
   > `LOGICAL_SORT cannot contain GroupingScalarFunction expression.`  
   > This is why the example orders by the `department` column instead of 
`GROUPING_ID`.
   ```



##########
versioned_docs/version-3.x/sql-manual/sql-functions/aggregate-functions/grouping-id.md:
##########
@@ -41,7 +41,7 @@ SELECT
   COUNT(uid) AS `Employee Count`
 FROM employee 
 GROUP BY ROLLUP(department, level)
-ORDER BY GROUPING_ID(department, level) ASC;
+ORDER BY department desc;
 ```
 

Review Comment:
   While the ORDER BY clause has been correctly changed from using GROUPING_ID 
to using the department column, there's no explanatory note added to inform 
users about this limitation. Consider adding a note before or after this 
example explaining that GROUPING_ID cannot be used in ORDER BY clauses when 
using the Nereids planner (versions 3.x and 4.x), and that the error message 
would be "LOGICAL_SORT cannot contain GroupingScalarFunction expression."
   
   This would help users understand why the example doesn't demonstrate ORDER 
BY with GROUPING_ID and prevent them from encountering the same error.
   ```suggestion
   
   > **Note:**  
   > When using the Nereids planner (versions 3.x and 4.x), you cannot use 
`GROUPING_ID` in the `ORDER BY` clause. Attempting to do so will result in the 
error:  
   > `LOGICAL_SORT cannot contain GroupingScalarFunction expression.`  
   > This is why the example orders by the `department` column instead of 
`GROUPING_ID`.
   ```



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