class QueryAnalyzer {

  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;
  }

  public  QueryAnalyzer(
      final MetaStore metaStore,
      final String outputTopicPrefix
  );
  @VisibleForTesting  QueryAnalyzer(
      final Analyzer analyzer,
      final QueryValidator pullQueryValidator,
      final QueryValidator pushQueryValidator
  );

}