@PublicEvolving public interface Catalog {
/** * When the CTAS function was used, the Catalog combined {@link Catalog#supportsManagedTable} * to infer whether to add some options to the {@link CatalogBaseTable}. * * For example: * {@link JdbcCatalog} can add connector = 'jdbc', user, password, url and other options to {@link CatalogBaseTable}, * {@link HiveCatalog} can add connector = 'hive' to {@link CatalogBaseTable}, help generate TableSink. * The tables in {@link GenericInMemoryCatalog} already exist externally, * options must be filled in manually by the user, and the Catalog cannot be automatically inferred. */ default voidCatalogBaseTable inferTableOptions(ObjectPath tablePath, CatalogBaseTable table) { throw new UnsupportedOperationException(); }
/** * Assist in the serialization of different catalogs. * Catalog decides for itself which information needs to be serialized. */ default void serialize(OutputStream output) throws IOException {}
/** * Assist in deserialization of different catalogs. * Determine whether to create a new Catalog instance based on * the deserialized data and the implementation of the catalog. */ default Catalog deserialize(InputStream input) throws ClassNotFoundException, IOException { return this; } } |