-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Review with Devin and Jianfeng/Chip contd.
- Loading branch information
1 parent
5cb0d5a
commit aa49f7f
Showing
14 changed files
with
449 additions
and
535 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...ions/iceberg/s3/src/test/java/io/deephaven/iceberg/util/IcebergWriteInstructionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.iceberg.util; | ||
|
||
import io.deephaven.engine.table.Table; | ||
import io.deephaven.engine.util.TableTools; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; | ||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat; | ||
|
||
class IcebergWriteInstructionsTest { | ||
|
||
@Test | ||
void testSetDhTables() { | ||
final Table table1 = TableTools.emptyTable(3); | ||
final Table table2 = TableTools.emptyTable(4); | ||
final IcebergWriteInstructions instructions = IcebergWriteInstructions.builder() | ||
.addTables(table1) | ||
.addTables(table2) | ||
.build(); | ||
assertThat(instructions.tables().size()).isEqualTo(2); | ||
assertThat(instructions.tables().contains(table1)).isTrue(); | ||
assertThat(instructions.tables().contains(table2)).isTrue(); | ||
} | ||
|
||
@Test | ||
void testSetPartitionPaths() { | ||
final Table table1 = TableTools.emptyTable(3); | ||
final String pp1 = "P1C=1/PC2=2"; | ||
final Table table2 = TableTools.emptyTable(4); | ||
final String pp2 = "P1C=2/PC2=3"; | ||
try { | ||
final IcebergWriteInstructions instructions = IcebergWriteInstructions.builder() | ||
.addPartitionPaths(pp1, pp2) | ||
.build(); | ||
failBecauseExceptionWasNotThrown(IllegalArgumentException.class); | ||
} catch (final IllegalArgumentException e) { | ||
assertThat(e).hasMessageContaining("Partition path must be provided for each table"); | ||
} | ||
|
||
final IcebergWriteInstructions instructions = IcebergWriteInstructions.builder() | ||
.addTables(table1, table2) | ||
.addPartitionPaths(pp1, pp2) | ||
.build(); | ||
assertThat(instructions.partitionPaths().size()).isEqualTo(2); | ||
assertThat(instructions.partitionPaths().contains(pp1)).isTrue(); | ||
assertThat(instructions.partitionPaths().contains(pp2)).isTrue(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 0 additions & 70 deletions
70
extensions/iceberg/src/main/java/io/deephaven/iceberg/util/IcebergBaseInstructions.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.