rusackas commented on code in PR #42588:
URL: https://github.com/apache/superset/pull/42588#discussion_r3679242144


##########
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:
   That's pre-existing, not something this PR introduces. Before this fix the 
FORCE_LIMIT branch didn'\''t skip SHOW, it corrupted it into invalid SQL 
(double LIMIT) that engines rejected outright — so SHOW never successfully 
returned unbounded rows before either, it just errored. And SHOW 
TABLES/DATABASES/CREATE TABLE result sets are bounded by schema size, not query 
row counts, so there's no unbounded-data-query risk here to begin with.



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