Skip to content

Commit

Permalink
Review points
Browse files Browse the repository at this point in the history
  • Loading branch information
devinrsmith committed Nov 7, 2023
1 parent 830488b commit b83bbfc
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,20 @@ public void verifyPyArrowStatistics() {
assertTableStatistics(dhFromDisk, dhDest);
}

@Test
public void inferParquetOrderLastKey() {
// Create an empty parent directory
final File parentDir = new File(rootFile, "inferParquetOrder");
parentDir.mkdir();
final TableDefinition td1 = TableDefinition.of(ColumnDefinition.ofInt("Foo"));
final TableDefinition td2 =
TableDefinition.of(ColumnDefinition.ofInt("Foo"), ColumnDefinition.ofString("Bar"));
ParquetTools.writeTable(TableTools.newTable(td1), new File(parentDir, "01.parquet"));
ParquetTools.writeTable(TableTools.newTable(td2), new File(parentDir, "02.parquet"));
final Table table = ParquetTools.readTable(parentDir);
assertEquals(td2, table.getDefinition());
}

private void assertTableStatistics(Table inputTable, File dest) {
// Verify that the columns have the correct statistics.
final ParquetMetadata metadata = new ParquetTableLocationKey(dest, 0, null).getMetadata();
Expand Down

0 comments on commit b83bbfc

Please sign in to comment.