Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashant Singh committed Apr 24, 2023
1 parent 1fd914f commit 4ef73e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ public class TestMetadataTableReadableMetrics extends SparkTestBaseWithCatalog {
optional(8, "fixedCol", Types.FixedType.ofLength(3)),
optional(9, "binaryCol", Types.BinaryType.get()));

private DataFile dataFile;

public TestMetadataTableReadableMetrics() {
// only SparkCatalog supports metadata table sql queries
super(SparkCatalogConfig.HIVE);
Expand Down Expand Up @@ -125,7 +123,8 @@ private Table createPrimitiveTable() throws IOException {
createPrimitiveRecord(
false, 2, 2L, Float.NaN, 2.0D, new BigDecimal("2.00"), "2", null, null));

dataFile = FileHelpers.writeDataFile(table, Files.localOutput(temp.newFile()), records);
DataFile dataFile =
FileHelpers.writeDataFile(table, Files.localOutput(temp.newFile()), records);
table.newAppend().appendFile(dataFile).commit();
return table;
}
Expand Down Expand Up @@ -192,7 +191,8 @@ private GenericRecord createNestedRecord(Long longCol, Double doubleCol) {

@Test
public void testPrimitiveColumns() throws Exception {
createPrimitiveTable();
Table table = createPrimitiveTable();
DataFile dataFile = table.currentSnapshot().addedDataFiles(table.io()).iterator().next();
Map<Integer, Long> columnSizeStats = dataFile.columnSizes();

Object[] binaryCol =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ public class TestMetadataTableReadableMetrics extends SparkTestBaseWithCatalog {
optional(8, "fixedCol", Types.FixedType.ofLength(3)),
optional(9, "binaryCol", Types.BinaryType.get()));

private DataFile dataFile;

public TestMetadataTableReadableMetrics() {
// only SparkCatalog supports metadata table sql queries
super(SparkCatalogConfig.HIVE);
Expand Down Expand Up @@ -125,7 +123,8 @@ private Table createPrimitiveTable() throws IOException {
createPrimitiveRecord(
false, 2, 2L, Float.NaN, 2.0D, new BigDecimal("2.00"), "2", null, null));

dataFile = FileHelpers.writeDataFile(table, Files.localOutput(temp.newFile()), records);
DataFile dataFile =
FileHelpers.writeDataFile(table, Files.localOutput(temp.newFile()), records);
table.newAppend().appendFile(dataFile).commit();
return table;
}
Expand All @@ -143,7 +142,8 @@ private void createNestedTable() throws IOException {
createNestedRecord(0L, 0.0),
createNestedRecord(1L, Double.NaN),
createNestedRecord(null, null));
dataFile = FileHelpers.writeDataFile(table, Files.localOutput(temp.newFile()), records);
DataFile dataFile =
FileHelpers.writeDataFile(table, Files.localOutput(temp.newFile()), records);
table.newAppend().appendFile(dataFile).commit();
}

Expand Down Expand Up @@ -192,7 +192,8 @@ private GenericRecord createNestedRecord(Long longCol, Double doubleCol) {

@Test
public void testPrimitiveColumns() throws Exception {
createPrimitiveTable();
Table table = createPrimitiveTable();
DataFile dataFile = table.currentSnapshot().addedDataFiles(table.io()).iterator().next();
Map<Integer, Long> columnSizeStats = dataFile.columnSizes();

Object[] binaryCol =
Expand Down

0 comments on commit 4ef73e0

Please sign in to comment.