baoxiao opened a new issue #4677: get column values for filters not working 
with clickhouse datasource
URL: https://github.com/apache/incubator-superset/issues/4677
 
 
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [X ] I have checked the superset logs for python stacktraces and included 
it here as text if 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
   
   
   ### Superset version
   0.23.3
   
   ### Expected results
   the filter result dropdown box should show the distint values of the column 
   ### Actual results
   
   
   ### Steps to reproduce
   It just stuck there, no result show up.  On the server side get error:
   
   2018-03-23 12:46:10,563:ERROR:root:Code: 62, e.displayText() = 
DB::Exception: Syntax error: failed at position 52 (line 1, col 52): AS 
record_country
   FROM record_innodb.mtrack_record_201108
    LIMIT 10000 FORMAT TabSeparatedWithNamesAndTypes. Expected one of: 
PREWHERE, WHERE, Comma, ORDER BY, SETTINGS, INTO OUTFILE, FORMAT, FROM, GROUP 
BY, WITH, HAVING, UNION ALL, token, LIMIT, e.what() = DB::Exception
   Traceback (most recent call last):
     File 
"/home/centos/venv/lib/python2.7/site-packages/superset/views/base.py", line 
65, in wraps
       return f(self, *args, **kwargs)
     File 
"/home/centos/venv/lib/python2.7/site-packages/flask_appbuilder/security/decorators.py",
 line 52, in wraps
       return f(self, *args, **kwargs)
     File 
"/home/centos/venv/lib/python2.7/site-packages/superset/views/core.py", line 
1300, in filter
       config.get('FILTER_SELECT_ROW_LIMIT', 10000),
     File 
"/home/centos/venv/lib/python2.7/site-packages/superset/connectors/sqla/models.py",
 line 395, in values_for_column
       df = pd.read_sql_query(sql=sql, con=engine)
     File "/home/centos/venv/lib/python2.7/site-packages/pandas/io/sql.py", 
line 332, in read_sql_query
       parse_dates=parse_dates, chunksize=chunksize)
     File "/home/centos/venv/lib/python2.7/site-packages/pandas/io/sql.py", 
line 1092, in read_query
       result = self.execute(*args)
     File "/home/centos/venv/lib/python2.7/site-packages/pandas/io/sql.py", 
line 983, in execute
       return self.connectable.execute(*args, **kwargs)
     File 
"/home/centos/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
2075, in execute
       return connection.execute(statement, *multiparams, **params)
     File 
"/home/centos/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
942, in execute
       return self._execute_text(object, multiparams, params)
     File 
"/home/centos/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
1104, in _execute_text
       statement, parameters
     File 
"/home/centos/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
1200, in _execute_context
       context)
     File 
"/home/centos/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
1416, in _handle_dbapi_exception
       util.reraise(*exc_info)
     File 
"/home/centos/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
1193, in _execute_context
       context)
     File 
"/home/centos/venv/lib/python2.7/site-packages/sqlalchemy/engine/default.py", 
line 507, in do_execute
       cursor.execute(statement, parameters)
     File 
"/home/centos/venv/lib/python2.7/site-packages/sqlalchemy_clickhouse/connector.py",
 line 209, in execute
       self._process_response(response)
     File 
"/home/centos/venv/lib/python2.7/site-packages/sqlalchemy_clickhouse/connector.py",
 line 340, in _process_response
       for r in response:
     File 
"/home/centos/venv/lib/python2.7/site-packages/infi/clickhouse_orm/database.py",
 line 162, in select
       r = self._send(query, settings, True)
     File 
"/home/centos/venv/lib/python2.7/site-packages/sqlalchemy_clickhouse/connector.py",
 line 102, in _send
       raise Exception(r.text)
   Exception: Code: 62, e.displayText() = DB::Exception: Syntax error: failed 
at position 52 (line 1, col 52): AS record_country
   FROM record_innodb.mtrack_record_201108
    LIMIT 10000 FORMAT TabSeparatedWithNamesAndTypes. Expected one of: 
PREWHERE, WHERE, Comma, ORDER BY, SETTINGS, INTO OUTFILE, FORMAT, FROM, GROUP 
BY, WITH, HAVING, UNION ALL, token, LIMIT, e.what() = DB::Exception
   
   when run ngrep to trace the packet, find superset send the below query to 
clickhouse,it seems like postgresql syntax, it cause error on clickhouse
   SELECT DISTINCT ON (record_country) record_country AS record_country FROM
   
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to