You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/06/08 02:15:12 UTC
[GitHub] backto17 commented on a change in pull request #5023: [sqllab]
force limit queries only when there is no existing limit
backto17 commented on a change in pull request #5023: [sqllab] force limit queries only when there is no existing limit
URL: https://github.com/apache/incubator-superset/pull/5023#discussion_r193937136
##########
File path: superset/db_engine_specs.py
##########
@@ -104,15 +104,32 @@ def apply_limit_to_sql(cls, sql, limit, database):
)
return database.compile_sqla_query(qry)
elif LimitMethod.FORCE_LIMIT:
- no_limit = re.sub(r"""
+ sql_without_limit = cls.get_query_without_limit(sql)
+ return '{sql_without_limit} LIMIT {limit}'.format(**locals())
Review comment:
this logic can generate sql like
```
SELECT id,
name
FROM main.ab_permission
LIMIT 100
OFFSET 0 LIMIT 5000
```
which is wrong
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org