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
I encountered a very similar error to the case described in the issue above.
The only difference is that I am working with a Delta Lake table instead of an Iceberg table.
I would like to share this bug and propose a solution and potential improvement.
How to reproduce the bug
Create a table with partitions in the Trino catalog.
Open SQL Lab
Select the catalog, schema, and table from the drop downs.
You will encounter the error: "trino error: line 5:7: Column 'partition' cannot be resolved"
Superset Environment
Superset version: 4.1.1
Python version: 3.10.15
Trino version: 467
Proposed Change
Solution
Referring to the previous case, I modified the trino.py module as follows:
Module Location: superset/db_engine_specs/trino.py : line 494~end
Before
@classmethod
def get_indexes(
cls,
database: Database,
inspector: Inspector,
table: Table,
) -> list[dict[str, Any]]:
"""
Get the indexes associated with the specified schema/table.
Trino dialect raises NoSuchTableError in get_indexes if table is empty.
:param database: The database to inspect
:param inspector: The SQLAlchemy inspector
:param table: The table instance to inspect
:returns: The indexes
"""
try:
return super().get_indexes(database, inspector, table)
except NoSuchTableError:
return []
After
@classmethod
def get_indexes(
cls,
database: Database,
inspector: Inspector,
table: Table,
) -> list[dict[str, Any]]:
"""
Get the indexes associated with the specified schema/table.
Trino dialect raises NoSuchTableError in get_indexes if table is empty.
:param database: The database to inspect
:param inspector: The SQLAlchemy inspector
:param table: The table instance to inspect
:returns: The indexes
"""
try:
indexes = super().get_indexes(database, inspector, table_name, schema)
# Handle iceberg / delta tables. Even for non-partitioned tables, it returns a value
cols_ignore = {"file_count", "total_size", "data"}
if len(indexes) == 1 and indexes[0].get("name") == "partition" and cols_ignore.issubset(set(indexes[0].get("column_names", []))):
return []
return indexes
except NoSuchTableError:
return []
This modification ensures compatibility with both Iceberg and Delta Lake tables, improving the robustness of the solution.
New or Changed Public Interfaces
Nope
New dependencies
Nope
Migration Plan and Compatibility
Nope
Rejected Alternatives
Nope
The text was updated successfully, but these errors were encountered:
Please make sure you are familiar with the SIP process documented
here. The SIP will be numbered by a committer upon acceptance.
[SIP] Proposal for ...<title>
Motivation
Link: Issue #26449
I encountered a very similar error to the case described in the issue above.
The only difference is that I am working with a Delta Lake table instead of an Iceberg table.
I would like to share this bug and propose a solution and potential improvement.
How to reproduce the bug
Superset Environment
Proposed Change
Solution
Referring to the previous case, I modified the trino.py module as follows:
Module Location:
superset/db_engine_specs/trino.py : line 494~end
Before
After
This modification ensures compatibility with both Iceberg and Delta Lake tables, improving the robustness of the solution.
New or Changed Public Interfaces
Nope
New dependencies
Nope
Migration Plan and Compatibility
Nope
Rejected Alternatives
Nope
The text was updated successfully, but these errors were encountered: