@Override
  public void validate(final Analysis analysis) {
    try {
      RULES.forEach(rule -> rule.check(analysis));
    } catch (final KsqlException e) {
      throw new KsqlException(e.getMessage() + PULL_QUERY_SYNTAX_HELP, e);
    }
    QueryValidatorUtil.validateNoUserColumnsWithSameNameAsPseudoColumns(analysis);
  }
@Test
  public void shouldThrowIfLimitDisabled() {
    // Given:
    when(analysis.getPullLimitClauseEnabled()).thenReturn(false);
    when(analysis.getLimitClause()).thenReturn(OptionalInt.of(5));

    // When:
    final Exception e = assertThrows(
            KsqlException.class,
            () -> validator.validate(analysis)
    );

    // Then:
    assertThat(e.getMessage(), containsString(
            "LIMIT clause in pull queries is currently disabled. " +
                    "You can enable them by setting ksql.query.pull.limit.clause.enabled=true. " +
                    "See https://cnfl.io/queries for more info.\n" +
                    "Add EMIT CHANGES if you intended to issue a push query."));

  }