pixelsdb / pixels

An efficient storage and compute engine for both on-prem and cloud-native data analytics.
GNU Affero General Public License v3.0
139 stars 37 forks source link

[pixels-common] layouts not found for table 'tpch_test.supplier' #772

Open mia1460 opened 2 weeks ago

mia1460 commented 2 weeks ago

Description

Attempting to execute a DROP TABLE command in Trino results in an error indicating "layouts not found for table 'tpch_test.supplier'". This issue persists across multiple queries, preventing table deletion and schema management. The error type is identified as EXTERNAL, with the code PIXELS_METASTORE_ERROR (16777216).

Steps to Reproduce

  1. Create a table in the tpch_test schema (e.g., supplier) with storage configured through Pixels.
  2. Attempt to query or drop the table using:
    DROP TABLE tpch_test.supplier;
  3. Observe the error indicating layouts are missing for the specified table.

Expected Behavior

The table should be dropped without encountering layout-related issues.

Actual Behavior

An error occurs, preventing the deletion of the table and potentially affecting other table and schema management commands.

Error Information

Stack Trace
io.trino.spi.TrinoException: layouts not found for table 'tpch_test.supplier'
    at io.pixelsdb.pixels.trino.PixelsMetadata.getTableHandle(PixelsMetadata.java:148)
    at io.pixelsdb.pixels.trino.PixelsMetadata.getTableHandle(PixelsMetadata.java:73)
    at io.trino.spi.connector.ConnectorMetadata.getTableHandle(ConnectorMetadata.java:121)
    at io.trino.metadata.MetadataManager.lambda$getTableHandle$4(MetadataManager.java:281)
    at java.base/java.util.Optional.flatMap(Optional.java:289)
    at io.trino.metadata.MetadataManager.getTableHandle(MetadataManager.java:275)
    at io.trino.metadata.MetadataManager.getRedirectionAwareTableHandle(MetadataManager.java:1543)
    at io.trino.metadata.MetadataManager.getRedirectionAwareTableHandle(MetadataManager.java:1535)
    at io.trino.execution.DropTableTask.execute(DropTableTask.java:79)
    at io.trino.execution.DropTableTask.execute(DropTableTask.java:37)
    at io.trino.execution.DataDefinitionExecution.start(DataDefinitionExecution.java:145)
    at io.trino.execution.SqlQueryManager.createQuery(SqlQueryManager.java:249)
    at io.trino.dispatcher.LocalDispatchQuery.lambda$startExecution$7(LocalDispatchQuery.java:143)
    at io.trino.$gen.Trino_405____20241021_075741_2.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)

Environment

Additional Information

This error may indicate a problem with the metadata service or how layouts are being managed for tables in Pixels. Any guidance on additional steps to resolve this or investigate would be appreciated.