naivedogger opened a new issue, #3640:
URL: https://github.com/apache/fluss/issues/3640

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/fluss/issues) and 
found nothing similar.
   
   
   ### Fluss version
   
   main (development)
   
   ### Please describe the bug 🐞
   
   When querying a `$changelog` or `$binlog` virtual table on a partitioned 
primary-key table, the Flink optimizer calls `FlinkCatalog.listPartitions()` on 
the virtual table name (e.g., `realtime$changelog`). This throws 
`TableNotExistException` because the virtual table suffix is not stripped 
before calling `admin.listPartitionInfos()`.
   
   The same issue exists in `tableExists()`, `createPartition()`, and 
`dropPartition()` — all of them pass the full virtual table name (including 
`$changelog`/`$binlog` suffix) directly to the admin API, which queries the 
Fluss server for a physical table that doesn't exist.
   
   `getTable()` correctly handles this by dispatching to 
`getVirtualChangelogTable()`/`getVirtualBinlogTable()`, but the 
partition/existence methods do not have this handling.
   
   **Stack trace:**
   
   <img width="1364" height="174" alt="Image" 
src="https://github.com/user-attachments/assets/96ff9b01-e28f-4b8e-8e0f-7b7f33f6de98";
 />
   
   1. Create a partitioned primary-key table in Fluss
   2. Query the $changelog virtual table via Flink SQL (e.g., SELECT * FROM 
table$changelog)
   3. The Flink optimizer's statistics recomputation triggers listPartitions on 
the virtual table name, causing the exception
   
   ### Solution
   
   Add a toPhysicalTablePath() helper method to FlinkCatalog that strips 
$changelog, $binlog, and $lake suffixes from the table name. Update 
tableExists(), listPartitions(), createPartition(), and dropPartition() to use 
this helper instead of toTablePath().
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to