use of io.confluent.ksql.api.client.Row in project ksql by confluentinc.
the class ConsistencyOffsetVectorFunctionalTest method shouldRoundTripCVWhenExecutePullQuery.
@Test
public void shouldRoundTripCVWhenExecutePullQuery() throws Exception {
// When
final BatchedQueryResult batchedQueryResult = consistencClient.executeQuery(PULL_QUERY_ON_TABLE);
final List<Row> rows = batchedQueryResult.get();
// Then
assertThat(rows, hasSize(1));
assertThat(batchedQueryResult.queryID().get(), is(notNullValue()));
assertThatEventually(() -> ((ClientImpl) consistencClient).getSerializedConsistencyVector(), is(notNullValue()));
final String serializedCV = ((ClientImpl) consistencClient).getSerializedConsistencyVector();
verifyConsistencyVector(serializedCV);
}
use of io.confluent.ksql.api.client.Row in project ksql by confluentinc.
the class ClientIntegrationTest method shouldStreamPullQueryOnEmptyStreamSync.
@Test
public void shouldStreamPullQueryOnEmptyStreamSync() throws Exception {
// When
final StreamedQueryResult streamedQueryResult = client.streamQuery("SELECT * FROM " + EMPTY_TEST_STREAM + ";").get();
// Then
assertThat(streamedQueryResult.columnNames(), is(TEST_COLUMN_NAMES));
assertThat(streamedQueryResult.columnTypes(), is(TEST_COLUMN_TYPES));
assertThat(streamedQueryResult.queryID(), is(notNullValue()));
final List<Row> results = new LinkedList<>();
Row row;
while (true) {
row = streamedQueryResult.poll();
if (row == null) {
break;
} else {
results.add(row);
}
}
verifyStreamRows(results, 0);
assertThatEventually(streamedQueryResult::isComplete, is(true));
}
Aggregations