Skip to content

Commit

Permalink
[docs] Fix docs confusing point about catalog create (#2503)
Browse files Browse the repository at this point in the history
  • Loading branch information
leaves12138 authored Dec 13, 2023
1 parent c4f74c4 commit 866e26f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions docs/content/api/flink-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,15 @@ public class WriteCdcToTable {

new RichCdcSinkBuilder()
.withInput(dataStream)
.withTable(createTableIfNotExists(identifier))
.withTable(createTableIfNotExists(catalogLoader.load(), identifier))
.withIdentifier(identifier)
.withCatalogLoader(catalogLoader)
.build();

env.execute();
}

private static Table createTableIfNotExists(Identifier identifier) throws Exception {
CatalogContext context = CatalogContext.create(new Path("..."));
Catalog catalog = CatalogFactory.createCatalog(context);

private static Table createTableIfNotExists(Catalog catalog, Identifier identifier) throws Exception {
Schema.Builder schemaBuilder = Schema.newBuilder();
schemaBuilder.primaryKey("order_id");
schemaBuilder.column("order_id", DataTypes.BIGINT());
Expand Down

0 comments on commit 866e26f

Please sign in to comment.