villebro commented on a change in pull request #18746:
URL: https://github.com/apache/superset/pull/18746#discussion_r810462097
##########
File path: superset/sql_lab.py
##########
@@ -292,10 +292,14 @@ def apply_limit_if_exists(
) -> str:
if query.limit and increased_limit:
# We are fetching one more than the requested limit in order
- # to test whether there are more rows than the limit.
+ # to test whether there are more rows than the limit. According to the
DB
+ # Engine support it will choose top or limit parse
# Later, the extra row will be dropped before sending
# the results back to the user.
- sql = database.apply_limit_to_sql(sql, increased_limit, force=True)
+ if database.db_engine_spec.allow_limit_clause:
+ sql = database.apply_limit_to_sql(sql, increased_limit, force=True)
+ else:
+ sql = database.apply_top_to_sql(sql, increased_limit)
Review comment:
nit: this check should probably be done in `Database.apply_top_to_sql`
so callers don't need to be aware of LIMIT/TOP.
--
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]