Skip to content

Commit

Permalink
Added some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
malhotrashivam committed Feb 27, 2024
1 parent c8aa764 commit ff99a36
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,35 @@ public void writeKeyValuePartitionedDataWithMixedPartitionsTest() {
assertTableEquals(inputData.where("PC1 == 2"), fromDisk);
}

@Test
public void someMoreKeyValuePartitionedTestsWithComplexKeys() {
final TableDefinition definition = TableDefinition.of(
ColumnDefinition.ofString("symbol").withPartitioning(),
ColumnDefinition.ofString("epic_collection_id").withPartitioning(),
ColumnDefinition.ofString("epic_request_id").withPartitioning(),
ColumnDefinition.ofLong("I"));
final Table inputData = ((QueryTable) TableTools.emptyTable(10)
.updateView("symbol = (i % 2 == 0) ? `AA` : `BB`",
"epic_collection_id = (i % 2 == 0) ? `fss_tick%1234%4321` : `fss_tick%5678%8765`",
"epic_request_id = (i % 2 == 0) ? `223ea-asd43` : `98dce-oiu23`",
"I = ii"))
.withDefinitionUnsafe(definition);

final File parentDir = new File(rootFile, "someTest");
final ParquetInstructions writeInstructions = ParquetInstructions.builder()
.setMetadataRootDir(parentDir.getAbsolutePath())
.build();
writeKeyValuePartitionedTable(inputData, parentDir, "data", writeInstructions);
final Table fromDisk = readKeyValuePartitionedTable(parentDir, EMPTY);
assertTableEquals(inputData.sort("symbol", "epic_collection_id"),
fromDisk.sort("symbol", "epic_collection_id"));

final File commonMetadata = new File(parentDir, "_common_metadata");
final Table fromDiskWithMetadata = readTable(commonMetadata);
assertTableEquals(inputData.sort("symbol", "epic_collection_id"),
fromDiskWithMetadata.sort("symbol", "epic_collection_id"));
}

@Test
public void testVectorColumns() {
final Table table = getTableFlat(20000, true, false);
Expand Down

0 comments on commit ff99a36

Please sign in to comment.