wkleiminger opened a new issue, #25173:
URL: https://github.com/apache/superset/issues/25173

   A clear and concise description of what the bug is.
   
   #### How to reproduce the bug
   
   I have created a custom EngineSpec for Sybase (with allow_limit_clause = 
False). This allows me to issue queries using "SQL Lab". The queries get 
correctly translated to "select TOP ...". 
   
   However, when I click on "Create Chart" in "SQL Lab" a query with a LIMIT 
clause is generated. It seems that the value of allow_limit_clause is ignored 
in this case.
   
   ### Expected results
   
   I would have expected that a table (or chart) is shown as in SQL Lab.
   
   ### Actual results
   
   Instead I see the following error in the UI:
   ![Error Chart 
View](https://github.com/apache/superset/assets/2116358/915e6d9f-7f1c-473f-ac60-2d63f9a822ce)
   
   And these messages in the log (sanitised):
   ```
   superset_app           | 2023-09-04 
14:01:20,970:WARNING:superset.models.helpers:Query SELECT a AS a,
   superset_app           |        b AS b,
   superset_app           |        c AS c,
   superset_app           |        d AS d,
   superset_app           |        e AS e,
   superset_app           |        [f] AS [f]
   superset_app           | FROM
   superset_app           |   (select a,
   superset_app           |           b,
   superset_app           |           c,
   superset_app           |           d,
   superset_app           |           e,
   superset_app           |           f
   superset_app           |    from table
   superset_app           |    where a=1
   superset_app           |      and b = 'b'
   superset_app           |      and c = 'c') AS virtual_table ROWS
   superset_app           | LIMIT 1000 on schema None failed
   superset_app           | Traceback (most recent call last):
   superset_app           |   File "/app/superset/models/helpers.py", line 
1027, in exc_query
   superset_app           |     df = self.database.get_df(
   superset_app           |   File "/app/superset/models/core.py", line 605, in 
get_df
   superset_app           |     self.db_engine_spec.execute(cursor, sqls[-1])
   superset_app           |   File "/app/superset/db_engine_specs/base.py", 
line 1527, in execute
   superset_app           |     raise cls.get_dbapi_mapped_exception(ex) from ex
   superset_app           |   File "/app/superset/db_engine_specs/base.py", 
line 1525, in execute
   superset_app           |     cursor.execute(query)
   superset_app           | pyodbc.Error: ('ZZZZZ', "[ZZZZZ] [SAP][ASE ODBC 
Driver][Adaptive Server Enterprise]Incorrect syntax near the keyword 'ROWS'.\n 
(156) (SQLExecDirectW)")
   ```
   
   I don't think the LIMIT 1000 is right here.
   
   #### Screenshots
   
   See above.
   
   ### Environment
   
   (please complete the following information):
   
   I am running the master branch (commit 
f2523b26fa140febe838624ae8508136d01d1389) with docker-compose up.
   
   - browser type and version: Chrome 116.0.5845.140
   - superset version: Version: 0.0.0-dev
   - python version: Python 3.9.18
   - node.js version: v16.20.2
   - any feature flags active: /
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version 
of superset. --> For the latest release version I had problems running 
`docker-compose up` (https://github.com/apache/superset/issues/20319).
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   ### Additional context
   
   Add any other context about the problem here.
   


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