naivedogger opened a new pull request, #3641:
URL: https://github.com/apache/fluss/pull/3641

   **Description:**
   
   ```markdown
   ### Purpose
   
   Linked issue: close #3640 
   
   When the Flink optimizer calls `listPartitions()` on a `$changelog` or 
`$binlog` virtual table, it throws `TableNotExistException` because the virtual 
table suffix is not stripped before querying the Fluss server.
   
   `getTable()` correctly dispatches virtual table names to 
`getVirtualChangelogTable()`/`getVirtualBinlogTable()`, but `tableExists()`, 
`listPartitions()`, `createPartition()`, and `dropPartition()` all pass the 
unstripped virtual table name directly to the admin API, which fails because no 
physical table named `xxx$changelog` exists.
   
   ### Brief change log
   
   - Added `toPhysicalTablePath()` private helper method to `FlinkCatalog` that 
strips `$changelog`, `$binlog`, and `$lake` suffixes from the table name, 
returning the base physical table path
   - Updated `tableExists()` to use `toPhysicalTablePath()` — virtual tables 
now correctly report existence based on the base table
   - Updated `listPartitions(ObjectPath, CatalogPartitionSpec)` to use 
`toPhysicalTablePath()` — virtual tables now list partitions of the base table
   - Updated `createPartition()` and `dropPartition()` to use 
`toPhysicalTablePath()` — partition management through virtual table names 
delegates to the base table
   
   ### Tests
   
   - Added `FlinkCatalogTest#testVirtualTablePartitionsAndExistence` which 
verifies:
     - `tableExists()` returns `true` for `$changelog` and `$binlog` virtual 
table names
     - `listPartitions()` returns the same partitions as the base table for 
both virtual table suffixes
     - `listPartitions()` with a `CatalogPartitionSpec` works correctly on 
virtual table names
     - `createPartition()` and `dropPartition()` work through virtual table 
names
   - Existing `FlinkCatalogTest#testOperatePartitions` continues to pass (no 
regression)
   
   ### API and Format
   
   No API or storage format changes. The fix only affects internal catalog 
method behavior for virtual table names.
   
   ### Documentation
   
   No documentation changes needed — this is a bug fix that makes virtual table 
behavior consistent with `getTable()`.
   
   <!-- Generated-by: Qoder AI Agent following 
https://github.com/apache/fluss/blob/main/AGENTS.md -->


-- 
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