Search in sources :

Example 1 with TabularRow

use of io.confluent.ksql.util.TabularRow in project ksql by confluentinc.

the class AssertExecutor method throwAssertionError.

private static void throwAssertionError(final String message, final DataSource dataSource, final KsqlGenericRecord expected, final List<KsqlGenericRecord> actual) {
    final List<Column> columns = ImmutableList.<Column>builder().add(Column.of(ColumnName.of("."), SqlTypes.STRING, Namespace.KEY, 0)).add(Column.of(SystemColumns.ROWTIME_NAME, SqlTypes.BIGINT, Namespace.KEY, 0)).addAll(dataSource.getSchema().columns()).build();
    final TabularRow headerRow = TabularRow.createHeader(80, columns, false, 0);
    final StringBuilder actualRows = new StringBuilder();
    actual.forEach(a -> actualRows.append(fromGenericRow(false, dataSource, a)).append('\n'));
    throw new AssertionError(String.format("%s%n%s%n%s%n%s", message, headerRow, fromGenericRow(true, dataSource, expected), actualRows.toString()));
}
Also used : TimestampColumn(io.confluent.ksql.execution.timestamp.TimestampColumn) Column(io.confluent.ksql.schema.ksql.Column) TabularRow(io.confluent.ksql.util.TabularRow)

Aggregations

TimestampColumn (io.confluent.ksql.execution.timestamp.TimestampColumn)1 Column (io.confluent.ksql.schema.ksql.Column)1 TabularRow (io.confluent.ksql.util.TabularRow)1