rdblue commented on a change in pull request #1320:
URL: https://github.com/apache/iceberg/pull/1320#discussion_r469512109
##########
File path: flink/src/test/java/org/apache/iceberg/flink/SimpleDataUtil.java
##########
@@ -74,10 +76,16 @@ static Record createRecord(Integer id, String data) {
return record;
}
- static void assertTableRows(String tablePath, List<Row> rows) throws
IOException {
+ static RowData createRowData(Integer id, String data) {
+ return GenericRowData.of(id, StringData.fromString(data));
+ }
+
+ static void assertTableRows(String tablePath, List<RowData> rows) throws
IOException {
List<Record> records = Lists.newArrayList();
- for (Row row : rows) {
- records.add(createRecord((Integer) row.getField(0), (String)
row.getField(1)));
+ for (RowData row : rows) {
+ Integer id = row.isNullAt(0) ? null : row.getInt(0);
+ String data = row.isNullAt(1) ? null : row.getString(1).toString();
+ records.add(createRecord(id, data));
Review comment:
This could also use the `assertEquals` implementation that
@chenjunjiedada has added in #1266. That would be better than converting a
specific record type.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]