Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Compile SQL to generate CatalogBaseTable (The table to be created) and CreateTableASOperation.

step2:

Use Catalog#inferTableOption API Catalog#inferTableOptions interface to do options filling to CatalogBaseTable. The specific implementation is determined by the Catalog.

...

It should be noted that the InMemoryCatalog, the tables saved in it all exist in the external system, so the table options have to be filled in manually by the user, the Catalog cannot infer it automatically. If the Catalog does not support ManagedTable and the user does not set the connector information, the execution will fail.

step3:

Use Using CatalogBaseTable and Catalog objects to construct JobStatusHook; Because when the Hook code . Due to  the JobStatusHook is finally executed on the JM side, and the CatalogBaseTable needs to be create/drop through the Catalog ; So in hook, so Catalog and CatalogBaseTable are member variables of hook, which also need to be serialized and can be passed to JM.

...

Planner registers JobStatusHook with StreamGraph, then the JobStatusHook is also serialized and passed to JM through the serialization of JobGraph. Because JobGraph uses ObjectOutputStream serialization, since CatalogBaseTable and Catalog cannot be serialized directly using ObjectOutputStream, JobStatusHook instances need to implement interface Externalizable. Internally  

For CatalogBaseTable, we use CatalogPropertiesUtil to serialize/deserialize CatalogBaseTableit , it's the tools that Flink already provides.

...