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 2020/10/23 03:21:22 UTC

[GitHub] [incubator-superset] ogrehunter opened a new issue #11405: Problem with Teradata Database

ogrehunter opened a new issue #11405:
URL: https://github.com/apache/incubator-superset/issues/11405


   From the Official Documentation it clearly stated that the recommended connector library is [sqlalchemy-teradata](https://github.com/Teradata/sqlalchemy-teradata). As far as I know this library is no longer maintained since last commit on its github page is on Jul 14, 2018. Furthermore Teradata has other SQL Driver Dialect for SQLAlchemy which is always updated until now, the last version is on Jun 16, 2020, that is [teradatasqlalchemy](https://pypi.org/project/teradatasqlalchemy/). 
   There are some advantage with [teradatasqlalchemy](https://pypi.org/project/teradatasqlalchemy/). This library require no ODBC connector, and it patch up  [sqlalchemy-teradata](https://github.com/Teradata/sqlalchemy-teradata) on its inability to adding table data source from another schema.
   Okay. I tried using [teradatasqlalchemy](https://pypi.org/project/teradatasqlalchemy/), running on SQL Lab, and this problem happen.
   
   ### Expected results
   
   SQL Lab show table result as usual.
   
   ### Actual results
   
   `base error: [Version 17.0.0.6] [Session 288395] [Teradata Database] [Error 3706] Syntax error: expected something between the word 'PENERIMAAN' and the 'LIMIT' keyword. at gosqldriver/teradatasql.`
   
   #### Screenshots
   
   ![image](https://user-images.githubusercontent.com/29318048/96951788-749fe880-1517-11eb-856c-6d7f0cd4f18e.png)
   The complete Error Message
   
   #### How to reproduce the bug
   
   1. Create Database Source using [teradatasqlalchemy](https://pypi.org/project/teradatasqlalchemy/) library connector.
   2. Go to SQL Lab and try some queries.
   3. Run.
   
   ### Environment
   
   - superset version: `Superset 0.37.2`
   - python version: `Python 3.8.5`
   - node.js version: `node -v`
   - npm version: `npm -v`
   
   ### Checklist
   
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [v] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [v] I have reproduced the issue with at least the latest released version of superset.
   - [v] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   I think this error raised because in Teradata, you don't do `LIMIT` to limiting the row result, but you use `SAMPLE` instead.
   
   This is some additional log.
   
   Triggering query_id: 84
   INFO:superset.views.core:Triggering query_id: 84
   /home/bram/pysuperset/lib/python3.8/site-packages/sqlalchemy/sql/sqltypes.py:661: SAWarning: Dialect sqlite+pysqlite does *not* support Decimal objects natively, and SQLAlchemy must convert from floating point - rounding errors and other issues may occur. Please consider storing Decimal numbers as strings or integers on this platform for lossless storage.
     util.warn(
   timeout can't be used in the current context
   WARNING:superset.utils.core:timeout can't be used in the current context
   signal only works in main thread
   Traceback (most recent call last):
     File "/home/bram/pysuperset/lib/python3.8/site-packages/superset/utils/core.py", line 624, in __enter__
       signal.signal(signal.SIGALRM, self.handle_timeout)
     File "/usr/lib/python3.8/signal.py", line 47, in signal
       handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
   ValueError: signal only works in main thread
   ERROR:superset.utils.core:signal only works in main thread
   Traceback (most recent call last):
     File "/home/bram/pysuperset/lib/python3.8/site-packages/superset/utils/core.py", line 624, in __enter__
       signal.signal(signal.SIGALRM, self.handle_timeout)
     File "/usr/lib/python3.8/signal.py", line 47, in signal
       handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
   ValueError: signal only works in main thread
   INFO:werkzeug:127.0.0.1 - - [23/Oct/2020 10:14:22] "GET /superset/queries/1603419084426.791 HTTP/1.1" 200 -
   SQLite Database support for metadata databases will be removed             in a future version of Superset.
   WARNING:superset.sql_lab:SQLite Database support for metadata databases will be removed             in a future version of Superset.
   Query 84: Executing 1 statement(s)
   INFO:superset.sql_lab:Query 84: Executing 1 statement(s)
   Query 84: Set query to 'running'
   INFO:superset.sql_lab:Query 84: Set query to 'running'
   Query 84: Running statement 1 out of 1
   INFO:superset.sql_lab:Query 84: Running statement 1 out of 1
   Query 84: <class 'teradatasql.OperationalError'>
   ERROR:superset.sql_lab:Query 84: <class 'teradatasql.OperationalError'>
   INFO:werkzeug:127.0.0.1 - - [23/Oct/2020 10:14:24] "POST /superset/sql_json/ HTTP/1.1" 500 -


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

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] [incubator-superset] ogrehunter commented on issue #11405: Problem with Teradata Database

Posted by GitBox <gi...@apache.org>.
ogrehunter commented on issue #11405:
URL: https://github.com/apache/incubator-superset/issues/11405#issuecomment-715347091


   Found temporary solution,
   1. add keyword 'SAMPLE' in `venv\lib\python\site-packages\sqlparse\keyword.py`
   ```
   KEYWORDS = {
           ...,
          'SAMPLE': tokens.Keyword,
           ...,
   }
   ```
   2. replace 'LIMIT' and 'limit' with 'SAMPLE' and 'sample' in `superset/sql_parse.py`
   
   TODO: apply those replacement only when Teradata connection is used.


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

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] [incubator-superset] mistercrunch commented on issue #11405: Problem with Teradata Database

Posted by GitBox <gi...@apache.org>.
mistercrunch commented on issue #11405:
URL: https://github.com/apache/incubator-superset/issues/11405#issuecomment-714902516


   I don't know any committers/PMC who actively use Teradata. Please update our docs with your recommendation if you can!


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

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] [incubator-superset] stale[bot] commented on issue #11405: Problem with Teradata Database

Posted by GitBox <gi...@apache.org>.
stale[bot] commented on issue #11405:
URL: https://github.com/apache/incubator-superset/issues/11405#issuecomment-751276421


   This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue `.pinned` to prevent stale bot from closing the issue.
   


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

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] [incubator-superset] ogrehunter edited a comment on issue #11405: Problem with Teradata Database

Posted by GitBox <gi...@apache.org>.
ogrehunter edited a comment on issue #11405:
URL: https://github.com/apache/incubator-superset/issues/11405#issuecomment-715347091


   Found temporary solution,
   1. add keyword 'SAMPLE' in `venv\lib\python\site-packages\sqlparse\keyword.py`
   ```
   KEYWORDS = {
           ...,
          'SAMPLE': tokens.Keyword,
           ...,
   }
   ```
   2. replace 'LIMIT' and 'limit' with 'SAMPLE' and 'sample' in `superset/sql_parse.py`
   
   TODO: apply those replacement only when Teradata connection is used. But how?


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

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] [incubator-superset] issue-label-bot[bot] commented on issue #11405: Problem with Teradata Database

Posted by GitBox <gi...@apache.org>.
issue-label-bot[bot] commented on issue #11405:
URL: https://github.com/apache/incubator-superset/issues/11405#issuecomment-714883489


   Issue Label Bot is not confident enough to auto-label this issue. See [dashboard](https://mlbot.net/data/apache/incubator-superset) for more details.


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

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