Mehmet F. Aktaş
02/29/2024, 7:03 PMgetTable()
Flink requires the catalog to implement getTable(ObjectPath tablePath, long timestamp) for time travel support:
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()`:
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.Tim Wolfe
03/03/2024, 1:26 PMgetTable() 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.Mehmet F. Aktaş
03/04/2024, 3:25 PM