openinx commented on a change in pull request #1882:
URL: https://github.com/apache/iceberg/pull/1882#discussion_r537490840
##########
File path:
flink/src/test/java/org/apache/iceberg/flink/source/TestFlinkInputFormat.java
##########
@@ -100,6 +100,33 @@ public void testNestedProjection() throws Exception {
assertRows(result, expected);
}
+ @Test
+ public void testBasicProjection() throws IOException {
+ Schema writeSchema = new Schema(
+ Types.NestedField.required(0, "id", Types.LongType.get()),
+ Types.NestedField.optional(1, "data", Types.StringType.get()),
+ Types.NestedField.optional(2, "time", Types.TimestampType.withZone())
+ );
+
+ Table table = catalog.createTable(TableIdentifier.of("default", "t"),
writeSchema);
+
+ List<Record> writeRecords = RandomGenericData.generate(writeSchema, 2, 0L);
+ new GenericAppenderHelper(table, fileFormat,
TEMPORARY_FOLDER).appendToTable(writeRecords);
+
+ TableSchema projectedSchema = TableSchema.builder()
+ .field("id", DataTypes.BIGINT())
+ .field("data", DataTypes.STRING())
+ .build();
+ List<Row> result =
runFormat(FlinkSource.forRowData().tableLoader(loader()).project(projectedSchema).buildFormat());
Review comment:
@rdblue What do you think about this ?
----------------------------------------------------------------
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]