@Override
  public ExecuteResult execute(final ServiceContext serviceContext, final ConfiguredKsqlPlan plan,
                               final boolean restoreInProgress) {
    try {
      final ExecuteResult result = EngineExecutor
          .create(primaryContext, serviceContext, plan.getConfig())
          .execute(plan.getPlan(), restoreInProgress);
      return result;
    } catch (final KsqlStatementException e) {
      throw e;
    } catch (final KsqlException e) {
      // add the statement text to the KsqlException
      throw new KsqlStatementException(
          e.getMessage(),
          e.getMessage(),
          plan.getPlan().getStatementText(),
          e.getCause()
      );
    }
  }
@Test
  public void shouldNotCleanUpInternalTopicsOnReplace() {
    // Given:
    setupKsqlEngineWithSharedRuntimeEnabled();
    KsqlEngineTestUtil.execute(
        serviceContext,
        ksqlEngine,
        "create stream s1 with (value_format = 'avro') as select * from test1;",
        ksqlConfig, Collections.emptyMap()
    );

    // When:
    KsqlEngineTestUtil.execute(
        serviceContext,
        ksqlEngine,
        "create or replace stream s1 with (value_format = 'avro') as select *, 'foo' from test1;",
        ksqlConfig, Collections.emptyMap()
    );


    // Then:
    awaitCleanupComplete();
    verify(topicClient, never()).deleteInternalTopics(any());
  }