-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure on creation of a new Presto dataset due to failure to load columns #25962
Comments
Possibly a duplicate of #23982, do you have that sort of datetime partition / can you try a table without that to isolate the issue? Specifically the comment #23982 (comment) has a fix you could try. |
@bkyryliuk you are listed as a Presto user in the database rolodex - do you have thoughts on this or that issue I linked? |
@sfirke Thank for your comment but I don't think it's the same problem. It happens for all tables. The attached tables has only "string" columns. |
I was able to debug the problem and found that it was caused by the stringification of the data type at _create_column_info function. It expects to get a column type object and not a string representation of it. |
Nice problem solving! Thanks for the update. Are you able to propose a fix to the codebase and send a pull request? |
Thanks. Sure, I'll send the PR. |
@eyalsh99 |
You should go to superset/db_engine_specs/presto.py and in _create_column_info function do the following change: The function is expected to return the native column type and not a stringify version of it. |
…able/schemas This patch fixes failures occuring when performing a schema preview of a Presto table. The `PrestoBaseEngineSpec.where_latest_partition` attempts to construct SQLAlchemy `Column` objects based on a name and a type. However, this leads to the following error in our case: ```console sqlalchemy.exc.ArgumentError: 'SchemaItem' object, such as a 'Column' or a 'Constraint' expected, got 'VARCHAR' ``` This comes from the fact that we run `Column('column_name', 'VARCHAR')` instead of `Column('column_name', sqlalchemy.types.VARCHAR)`. We fix this particular error by passing the _actual_ type class, and not just a string. > [!NOTE] > This also fixes the same issue for Trino tables, as `TrinoEngineSpec` inherits > from `PrestoBaseEngineSpec`, the Presto db client class. Fixes apache#25962 Fixes apache#25962
@eyalsh99 are you still planning to open a PR for that change (and maybe add a test if we're lucky?) |
@eyalsh99 I am facing the same problem using Athena, maybe you know a solution for my case? |
Someone in Slack just reported experiencing this in Athena, too. Same issue or different? |
@sfirke Same issues but on Athena, not Presto. And athena.py doesn't have _create_column_info function |
Re-opening because the fix was reverted in #28613. |
We have a Presto database connection working fine with virtual datasets (added throw SQLLab).
When trying to add a new dataset of a physical table we're getting an error.
Reproducing the bug:
Expected results
See the table columns on the right pane
Actual results
An error message appears on the right pane:
"An Error Occurred
Unable to load columns for the selected table. Please select a different table."
Couldn't find any errors in the Superset app container log or any other container.
Screenshots
Environment
Checklist
Additional context
The text was updated successfully, but these errors were encountered: