use of io.confluent.ksql.execution.util.ColumnExtractor in project ksql by confluentinc.
the class PullQueryValidatorTest method shouldThrowWhenSelectClauseContainsDisallowedColumns.
@Test
public void shouldThrowWhenSelectClauseContainsDisallowedColumns() {
try (MockedStatic<ColumnExtractor> columnExtractor = mockStatic(ColumnExtractor.class)) {
// Given:
givenSelectClauseWithDisallowedColumnNames(columnExtractor);
// When:
final Exception e = assertThrows(KsqlException.class, () -> validator.validate(analysis));
// Then:
assertThat(e.getMessage(), containsString("Pull queries don't support the following columns in SELECT clauses: `ROWPARTITION`, `ROWOFFSET`"));
}
}
use of io.confluent.ksql.execution.util.ColumnExtractor in project ksql by confluentinc.
the class ScalablePushUtilTest method isScalablePushQuery_false_hasWindow.
@Test
public void isScalablePushQuery_false_hasWindow() {
try (MockedStatic<ColumnExtractor> columnExtractor = mockStatic(ColumnExtractor.class)) {
// When:
expectIsSPQ(ColumnName.of("foo"), columnExtractor);
when(query.getWindow()).thenReturn(Optional.of(new WindowExpression("foo", new TumblingWindowExpression(new WindowTimeClause(1, TimeUnit.MILLISECONDS)))));
// Then:
assertThat(ScalablePushUtil.isScalablePushQuery(query, ksqlEngine, ksqlConfig, ImmutableMap.of(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest")), equalTo(false));
}
}
use of io.confluent.ksql.execution.util.ColumnExtractor in project ksql by confluentinc.
the class PullQueryValidatorTest method shouldThrowWhenWhereClauseContainsDisallowedColumns.
@Test
public void shouldThrowWhenWhereClauseContainsDisallowedColumns() {
try (MockedStatic<ColumnExtractor> columnExtractor = mockStatic(ColumnExtractor.class)) {
// Given:
givenWhereClauseWithDisallowedColumnNames(columnExtractor);
// When:
final Exception e = assertThrows(KsqlException.class, () -> validator.validate(analysis));
// Then:
assertThat(e.getMessage(), containsString("Pull queries don't support the following columns in WHERE clauses: `ROWPARTITION`, `ROWOFFSET`"));
}
}
Aggregations