codeant-ai-for-open-source[bot] commented on code in PR #42588:
URL: https://github.com/apache/superset/pull/42588#discussion_r3679243561


##########
superset/sql/parse.py:
##########
@@ -1274,6 +1274,13 @@ def set_limit_value(
         Modify the `LIMIT` or `TOP` value of the SQL statement inplace.
         """
         if method == LimitMethod.FORCE_LIMIT:
+            # `SHOW` statements (`SHOW TABLES`, `SHOW DATABASES`, `SHOW CREATE
+            # TABLE`, etc.) have no real `LIMIT` slot in sqlglot's expression
+            # tree: setting `args["limit"]` doesn't get rejected, it renders a
+            # malformed statement with two `LIMIT` keywords, which engines
+            # like StarRocks reject outright. Leave them untouched.
+            if isinstance(self._parsed, exp.Show):
+                return

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag the lack of SQL-level row limiting for SHOW statements; their 
metadata result sets are bounded by schema size rather than query row counts.
   
   **Applied to:**
     - `superset/sql/parse.py`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



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