Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Getting error after soda analyze command for mysql soda. #208

Open
danilyef opened this issue Feb 17, 2022 · 0 comments
Open

Getting error after soda analyze command for mysql soda. #208

danilyef opened this issue Feb 17, 2022 · 0 comments
Labels
bug Something isn't working soda-sql

Comments

@danilyef
Copy link

danilyef commented Feb 17, 2022

When I start soda analyze command I got the following error message:

SELECT
  COUNT(CASE WHEN case regexp '^\\\-?[0-9]+$' THEN 1 END) AS number_whole,
   ....
 FROM (SELECT * FROM table_name LIMIT 1000) T

Exception: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp '^\\\-?[0-9]+$' THEN 1 END) AS number_whole,
  COUNT(CASE WHEN case regex' at line 2
Traceback (most recent call last):
  File "/opt/anaconda3/lib/python3.8/site-packages/sodasql/cli/cli.py", line 287, in analyze
    dataset_analyze_results = dataset_analyzer.analyze(warehouse, table_name)
  File "/opt/anaconda3/lib/python3.8/site-packages/sodasql/dataset_analyzer.py", line 76, in analyze
    row = warehouse.sql_fetchone(
  File "/opt/anaconda3/lib/python3.8/site-packages/sodasql/scan/warehouse.py", line 32, in sql_fetchone
    return sql_fetchone(self.connection, sql)
  File "/opt/anaconda3/lib/python3.8/site-packages/sodasql/scan/db.py", line 22, in sql_fetchone
    return sql_fetchone_description(connection, sql)[0]
  File "/opt/anaconda3/lib/python3.8/site-packages/sodasql/scan/db.py", line 35, in sql_fetchone_description
    cursor.execute(sql)
  File "/opt/anaconda3/lib/python3.8/site-packages/mysql/connector/cursor.py", line 569, in execute
    self._handle_result(self._connection.cmd_query(stmt))
  File "/opt/anaconda3/lib/python3.8/site-packages/mysql/connector/connection.py", line 855, in cmd_query
    result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
  File "/opt/anaconda3/lib/python3.8/site-packages/mysql/connector/connection.py", line 665, in _handle_result
    raise errors.get_exception(packet)
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'regexp '^\\\-?[0-9]+$' THEN 1 END) AS number_whole,
  COUNT(CASE WHEN case regex' at line 2

warehouse.yml

name: soda_sql
connection:
  type: mysql
  host: my_host
  port: '3306'
  username: env_var(MYSQL_USERNAME)
  password: env_var(MYSQL_PASSWORD)
  database: my_database

OS: macOs
Python Version: Python 3.8.12
pip Version: 22.0.3
Soda CLI version:2.1.3
Warehouse Type: mysql
Mysql version: 8.0.26

@danilyef danilyef added bug Something isn't working soda-sql labels Feb 17, 2022
@vijaykiran vijaykiran transferred this issue from sodadata/soda-core Mar 22, 2022
@vijaykiran vijaykiran transferred this issue from sodadata/soda-core Mar 22, 2022
hgbink pushed a commit to hgbink/soda-sql that referenced this issue Sep 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working soda-sql
Projects
None yet
Development

No branches or pull requests

1 participant