You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is due to comparing text with a date field here, as the query should read WHERE date = DATE '2023-04-17' instead.
How to reproduce the bug
Connect a trino database with a table partitioned on a DATE column
Go to SQL Lab
Select the appropriate database, schema, and table
See preview query run and result in the above error
Expected results
The preview should provide an actual preview of the table
Actual results
The above error. Full stacktrace here:
superset.exceptions.SupersetErrorsException: [SupersetError(message='trino error: line 11:12: Cannot apply operator: date = varchar(10)', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Trino', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]
2023-05-11 14:44:29,745:WARNING:superset.views.base:SupersetErrorsException
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1517, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1503, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 95, in wraps
return f(self, *args, **kwargs)
File "/opt/superset/superset/views/base_api.py", line 122, in wraps
raise ex
File "/opt/superset/superset/views/base_api.py", line 113, in wraps
duration, response = time_function(f, self, *args, **kwargs)
File "/opt/superset/superset/utils/core.py", line 1586, in time_function
response = func(*args, **kwargs)
File "/opt/superset/superset/views/base_api.py", line 85, in wraps
return f(self, *args, **kwargs)
File "/opt/superset/superset/utils/log.py", line 266, in wrapper
value = f(*args, **kwargs)
File "/opt/superset/superset/sqllab/api.py", line 256, in execute_sql_query
command_result: CommandResult = command.run()
File "/opt/superset/superset/sqllab/commands/execute.py", line 121, in run
raise ex
File "/opt/superset/superset/sqllab/commands/execute.py", line 103, in run
status = self._run_sql_json_exec_from_scratch()
File "/opt/superset/superset/sqllab/commands/execute.py", line 162, in _run_sql_json_exec_from_scratch
raise ex
File "/opt/superset/superset/sqllab/commands/execute.py", line 157, in _run_sql_json_exec_from_scratch
return self._sql_json_executor.execute(
File "/opt/superset/superset/sqllab/sql_json_executer.py", line 111, in execute
raise SupersetErrorsException(
superset.exceptions.SupersetErrorsException: [SupersetError(message='trino error: line 11:12: Cannot apply operator: date = varchar(10)', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Trino', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]
Note that the error is somewhat difficult to trace from this alone, as the frontend gets the query from one endpoint, where it's provided as selectStar, and comes from the DB engine spec, and then posts that SQL to the normal run SQL endpoint, which is where the above stack trace occurs.
Environment
browser type and version: all (backend bug)
superset version: 2.1
python version: 3.8.13
node.js version: N/A
any feature flags active: defaults
Checklist
Make sure to follow these steps before submitting your issue - thank you!
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.
I have checked the issue tracker for the same issue and I haven't found one similar.
The text was updated successfully, but these errors were encountered:
An error is seen on the frontend as a result of running the preview table query in SQL Lab; this appears to be a regression in 2.1. The error reads:
and the underlying query looks like:
This is due to comparing text with a date field here, as the query should read
WHERE date = DATE '2023-04-17'
instead.How to reproduce the bug
Expected results
The preview should provide an actual preview of the table
Actual results
The above error. Full stacktrace here:
Note that the error is somewhat difficult to trace from this alone, as the frontend gets the query from one endpoint, where it's provided as
selectStar
, and comes from the DB engine spec, and then posts that SQL to the normal run SQL endpoint, which is where the above stack trace occurs.Environment
2.1
3.8.13
Checklist
Make sure to follow these steps before submitting your issue - thank you!
The text was updated successfully, but these errors were encountered: