class CreateTableAsPlan implements Plan {

    private final AnalyzedCreateTable analyzedCreateTable;
    private final Supplier<LogicalPlan> postponedInsertPlan;
    private final TableCreator tableCreator;
    private final NumberOfShards numberOfShards;

    public static CreateTableAsPlan of(AnalyzedCreateTableAs analyzedCreateTableAs,
                                       NumberOfShards numberOfShards,
                                       TableCreator tableCreator,
                                       PlannerContext context,
                                       LogicalPlanner logicalPlanner) {<FILL_FUNCTION_BODY>}

    public CreateTableAsPlan(AnalyzedCreateTable analyzedCreateTable,
                                Supplier<LogicalPlan> postponedInsertPlan,
                                TableCreator tableCreator,
                                NumberOfShards numberOfShards) {
        this.analyzedCreateTable = analyzedCreateTable;
        this.postponedInsertPlan = postponedInsertPlan;
        this.tableCreator = tableCreator;
        this.numberOfShards = numberOfShards;
    }

    @Override
    public StatementType type() {
        return StatementType.DDL;
    }

    @Override
    public void executeOrFail(DependencyCarrier dependencies,
                              PlannerContext plannerContext,
                              RowConsumer consumer,
                              Row params,
                              SubQueryResults subQueryResults) {
        BoundCreateTable boundCreateTable = analyzedCreateTable.bind(
            numberOfShards,
            dependencies.fulltextAnalyzerResolver(),
            plannerContext.nodeContext(),
            plannerContext.transactionContext(),
            params,
            subQueryResults
        );
        tableCreator.create(boundCreateTable, plannerContext.clusterState().nodes().getMinNodeVersion())
            .whenComplete((rowCount, err) -> {
                if (err == null) {
                    postponedInsertPlan.get().execute(
                        dependencies,
                        plannerContext,
                        consumer,
                        params,
                        subQueryResults
                    );
                } else {
                    consumer.accept(null, err);
                }
            });
    }
}

        Supplier<LogicalPlan> postponedInsertPlan =
            () -> logicalPlanner.plan(analyzedCreateTableAs.analyzePostponedInsertStatement(), context);
        return new CreateTableAsPlan(
            analyzedCreateTableAs.analyzedCreateTable(),
            postponedInsertPlan,
            tableCreator,
            numberOfShards
        );
    
<no_super_class>