COLDMANYU opened a new issue, #14929:
URL: https://github.com/apache/gravitino/issues/14929
### Version
main branch
### Describe what's wrong
Paimon procedures that operate on the Paimon catalog itself, such as
`remove_orphan_files`, `repair` or `compact_database`, fail when called through
a Gravitino Paimon catalog in Spark. These procedures cast the catalog they run
in to Paimon's `WithPaimonCatalog`, and `GravitinoPaimonCatalog` does not
implement that interface. Procedures that only load a table, such as `compact`
or `expire_snapshots`, work.
### Error message and/or stacktrace
```
java.lang.ClassCastException: class
org.apache.gravitino.spark.connector.paimon.GravitinoPaimonCatalogSpark35
cannot be cast to class org.apache.paimon.spark.catalog.WithPaimonCatalog
at
org.apache.paimon.spark.procedure.RemoveOrphanFilesProcedure.call(RemoveOrphanFilesProcedure.java:110)
at
org.apache.paimon.spark.execution.PaimonCallExec.run(PaimonCallExec.scala:32)
```
(Paimon 1.2.0, the version Gravitino uses, on Spark 3.5.)
### How to reproduce
```sql
CREATE TABLE t (id INT, name STRING) USING paimon;
INSERT INTO t VALUES (1, 'a');
CALL <gravitino_paimon_catalog>.sys.remove_orphan_files(table =>
'default_db.t', dry_run => true);
```
### Additional context
`GravitinoPaimonCatalog` could implement `WithPaimonCatalog` and return the
Paimon catalog of the `SparkCatalog` it wraps. I can send 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]