*Flink catalog not implementing `getTable()`* Fli...
# troubleshooting
m
Flink catalog not implementing
getTable()
Flink requires the
catalog
to implement
getTable(ObjectPath tablePath, long timestamp)
for time travel support:
Copy code
Attention: Currently, time travel requires the corresponding catalog that the table belongs to implementing the getTable(ObjectPath tablePath, long timestamp) method. See more details in Catalog.
[https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/sql/queries/time-travel/] The default
GenericInMemoryCatalog
does not seem to implement
getTable()
. I set up a
hive metastore
and created a
hive catalog
, but it turns out that, hive catalog also does not implement `getTable()`:
Copy code
py4j.protocol.Py4JJavaError: An error occurred while calling o8.sqlQuery.
: org.apache.flink.table.api.ValidationException: SQL validation failed. getTable(ObjectPath, long) is not implemented for class org.apache.flink.table.catalog.hive.HiveCatalog.
I have two options now: 1. Try another catalog, like Iceberg catalog, to see if that one implements
getTable()
a. I am not able to find information on whether a given catalog implements this function. Should I try to dig into their source code? 2. Implement a custom catalog with
getTable()
, following the very-brief-instructions given in the Flink doc. a. I will have to write Java code 😬 and then get it used by the Flink env 😬😬 Is there a doc or article or anything else that I can use to get more information on • Which catalogs implement time travel support? • If there is not readily available catalog supporting time travel, then how can we implement a custom catalog with time travel support? ◦ The instructions given here are unfortunately not sufficient for a Java-illiterate person like myself.
t
To address your concerns: 1. Trying Another Catalog like Iceberg: Yes, exploring catalogs like Iceberg, which supports time travel through snapshot management, is a good idea. You might have to review their documentation or source code to confirm the implementation of
getTable()
for time travel. 1. Implementing a Custom Catalog with
getTable()
: ◦ This requires Java knowledge since you need to implement the Flink
Catalog
interface, particularly the
getTable(ObjectPath tablePath, long timestamp)
method. ◦ Look into Flink’s documentation, community forums, or source code examples for guidance. Collaborating with someone experienced in Java or Flink could also be beneficial. No direct documentation lists which catalogs support time travel explicitly, so checking the source code or community discussions might be necessary. For creating a custom catalog, it’s about extending the
Catalog
interface in Java, which might be challenging without Java experience but is feasible with some learning or collaboration.
m
Tanks @Tim Wolfe. I actually tried Paimon catalog and verified that it supports time travel. Also, contrary to my initial experience, found that Hive catalog also supports time travel -- not sure why it did not work initially, I only changed how I added the required JAR's ....