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 2022/08/09 08:17:23 UTC

[GitHub] [superset] unnyns-307 opened a new issue, #21027: DISTINCT command error Incorrect syntax near the keyword on SQLLab when connect MSSQL database

unnyns-307 opened a new issue, #21027:
URL: https://github.com/apache/superset/issues/21027

   A clear and concise description of what the bug is.
   
   #### How to reproduce the bug
   
   1. Go to SQLLab editor 
   2. Connect to MSSQL database connection
   3. Query data with 'DISTINCT' command
   4. See error
   
   ### Expected results
   
   Get data result of unique value normally
   
   ### Actual results
   
   Get this following error:
   > mssql error: (156, b"Incorrect syntax near the keyword 'DISTINCT'.DB-Lib error message 20018, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n")
   
   #### Screenshots
   ![image (25)](https://user-images.githubusercontent.com/82924994/183552496-51cb1f0d-267d-4b71-90f1-1cf9ef1d349e.png)
   
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: Chrome Version 104.0.5112.81 (Official Build) (64-bit)
   - superset version: 2.0.0
   - python version: 3.8.12
   - node.js version:16
   - 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.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   -
   


-- 
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: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] sfirke commented on issue #21027: DISTINCT command error Incorrect syntax near the keyword on SQLLab when connect MSSQL database

Posted by GitBox <gi...@apache.org>.
sfirke commented on issue #21027:
URL: https://github.com/apache/superset/issues/21027#issuecomment-1209655379

   I get this behavior too, Superset 2.0.0 connecting to MSSQL.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro closed issue #21027: DISTINCT command error Incorrect syntax near the keyword on SQLLab when connect MSSQL database

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro closed issue #21027: DISTINCT command error Incorrect syntax near the keyword on SQLLab when connect MSSQL database
URL: https://github.com/apache/superset/issues/21027


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] TerryLines commented on issue #21027: DISTINCT command error Incorrect syntax near the keyword on SQLLab when connect MSSQL database

Posted by "TerryLines (via GitHub)" <gi...@apache.org>.
TerryLines commented on issue #21027:
URL: https://github.com/apache/superset/issues/21027#issuecomment-1411025804

   same here. Also syntax errors on count(column) from table


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] EcoleKeine commented on issue #21027: DISTINCT command error Incorrect syntax near the keyword on SQLLab when connect MSSQL database

Posted by GitBox <gi...@apache.org>.
EcoleKeine commented on issue #21027:
URL: https://github.com/apache/superset/issues/21027#issuecomment-1371935355

   Same, any news?


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] sfirke commented on issue #21027: DISTINCT command error Incorrect syntax near the keyword on SQLLab when connect MSSQL database

Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #21027:
URL: https://github.com/apache/superset/issues/21027#issuecomment-1414231940

   Nice sleuthing.  I wonder if this can be accommodated on the Superset side.  It looks like `SELECT DISTINCT TOP 1000 * FROM myTable` is supported and does what `SELECT TOP 1000 DISTINCT * FROM myTable` would do in other dialects?  If so, could Superset recognize that the dialect is SQL Server and thus insert the TOP 1000 after DISTINCT?
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] sfirke commented on issue #21027: DISTINCT command error Incorrect syntax near the keyword on SQLLab when connect MSSQL database

Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #21027:
URL: https://github.com/apache/superset/issues/21027#issuecomment-1516398570

   An idea: modify https://github.com/apache/superset/blob/b2b8c3e05b69cc19cbb8394f621c1b9095bda132/superset/db_engine_specs/base.py#L897-L899.  It currently finds the first select keyword (dialect-specific) and injects the TOP there.  It could instead find the first select keyword _followed by a non-select keyword_.
   
   Then in `superset/db_engine_specs/mssql.py`, specify `select_keywords = {"SELECT", "DISTINCT"}`.  Then the TOP 1000 would get injected after SELECT DISTINCT.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org