#70719·starrocks

[Bug] [Paimon] ClassCastException in ConnectorTableMetadataProcessor when refreshing Paimon catalog: FormatTableImpl cannot be cast to FileStoreTable

Author: LeoLiang666Created Mar 24, 2026Updated Sep 28, 2026
Labelstype/bugno-issue-activity
Image

StarRocks Version

  • 3.3.22

Component

  • Fe / External Catalog (Paimon)

Environment

  • Deployment: Integrated Storage and Compute Architecture (存算一体)
  • External Catalog: Paimon 1.2.0
  • Catalog Type: Paimon Catalog

Description

Summary

The FE background thread ConnectorTableMetadataProcessor throws a java.lang.ClassCastException while periodically refreshing Paimon Catalog metadata. Although the initial creation of the Paimon catalog and manual queries appear to work fine, the background metadata synchronization fails when encountering specific Paimon table types.

Error Log

Occurrence Time: 2026-03-24 15:28:45

java
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.ClassCastException: class org.apache.paimon.table.FormatTable$FormatTableImpl cannot be cast to class org.apache.paimon.table.FileStoreTable
    at com.starrocks.connector.hive.ConnectorTableMetadataProcessor.refreshPaimonCatalog(ConnectorTableMetadataProcessor.java)
    ...
Caused by: java.lang.ClassCastException: class org.apache.paimon.table.FormatTable$FormatTableImpl cannot be cast to class org.apache.paimon.table.FileStoreTable

Root Cause Analysis (Preliminary)

It seems that ConnectorTableMetadataProcessor in StarRocks 3.3.x assumes all tables in the Paimon Catalog are instances of FileStoreTable. However, in Paimon 1.2.0 (or when certain storage formats are used), some tables are instantiated as FormatTableImpl.

When the refresh thread iterates through the tables, the explicit cast to FileStoreTable fails, causing the background refresh task to crash.


Steps to Reproduce

  1. Deploy StarRocks 3.3.22 with Paimon 1.2.0.
  2. Create a Paimon Catalog in StarRocks.
  3. Ensure the Paimon metastore contains tables that might be identified as FormatTable (e.g., specific file formats or metadata-only tables).
  4. Wait for the background periodic refresh (triggered by ConnectorTableMetadataProcessor).
  5. Check fe.warn.log for the ClassCastException.

Expected Behavior

The ConnectorTableMetadataProcessor should handle different implementations of the Paimon Table interface (including FormatTable) without throwing a ClassCastException, or it should skip unsupported table types gracefully.


Actual Behavior

The background thread crashes, potentially leading to stale metadata in the External Catalog.