public Analysis analyze(
      final Query query,
      final Optional<Sink> sink
  ) {
    final Analysis analysis = analyzer.analyze(query, sink);

    if (query.isPullQuery()) {
      pullQueryValidator.validate(analysis);
    } else {
      pushQueryValidator.validate(analysis);
    }

    if (!analysis.getTableFunctions().isEmpty()) {
      final AliasedDataSource ds = analysis.getFrom();
      if (ds.getDataSource().getDataSourceType() == DataSourceType.KTABLE) {
        throw new KsqlException("Table source is not supported with table functions");
      }
    }

    return analysis;
  }
@Test
  public void shouldPreValidateStaticQueries() {
    // Given:
    when(query.isPullQuery()).thenReturn(true);

    // When:
    queryAnalyzer.analyze(query, Optional.of(sink));

    // Then:
    verify(staticValidator).validate(analysis);
    verifyNoMoreInteractions(continuousValidator);
  }