You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/03/05 19:57:06 UTC
[GitHub] [incubator-iceberg] rdblue commented on a change in pull request
#827: Refactor metadata Table tests to use a common parent
rdblue commented on a change in pull request #827: Refactor metadata Table tests to use a common parent
URL: https://github.com/apache/incubator-iceberg/pull/827#discussion_r388529166
##########
File path: spark/src/test/java/org/apache/iceberg/spark/source/TestIcebergSourceHadoopTables.java
##########
@@ -101,31 +79,7 @@ public void testEntriesTable() throws Exception {
System.out.println(tableLocation);
Table entriesTable = TABLES.load(tableLocation + "#entries");
- List<SimpleRecord> records = Lists.newArrayList(new SimpleRecord(1, "1"));
-
- Dataset<Row> inputDf = spark.createDataFrame(records, SimpleRecord.class);
- inputDf.select("id", "data").write()
- .format("iceberg")
- .mode("append")
- .save(tableLocation);
-
- table.refresh();
-
- List<Row> actual = spark.read()
- .format("iceberg")
- .load(tableLocation + "#entries")
- .collectAsList();
-
- Assert.assertEquals("Should only contain one manifest", 1, table.currentSnapshot().manifests().size());
- InputFile manifest = table.io().newInputFile(table.currentSnapshot().manifests().get(0).path());
- List<GenericData.Record> expected;
- try (CloseableIterable<GenericData.Record> rows = Avro.read(manifest).project(entriesTable.schema()).build()) {
- expected = Lists.newArrayList(rows);
- }
-
- Assert.assertEquals("Entries table should have one row", 1, expected.size());
- Assert.assertEquals("Actual results should have one row", 1, actual.size());
- TestHelpers.assertEqualsSafe(entriesTable.schema().asStruct(), expected.get(0), actual.get(0));
+ super.testEntriesTable(table, entriesTable, tableLocation, tableLocation + "#entries");
Review comment:
It isn't necessary to use `super` here. Could you remove those?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org