Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ public final class IcebergUtils {
DH_TO_ICEBERG_TYPE_MAP.put(LocalDateTime.class, Types.TimestampType.withoutZone());
DH_TO_ICEBERG_TYPE_MAP.put(LocalDate.class, Types.DateType.get());
DH_TO_ICEBERG_TYPE_MAP.put(LocalTime.class, Types.TimeType.get());
DH_TO_ICEBERG_TYPE_MAP.put(byte[].class, Types.BinaryType.get());
// TODO (deephaven-core#6327) Add support for more types like ZonedDateTime, Big Decimals, and Lists
// TODO (DH-18253): Add support for more types like ZonedDateTime, Big Decimals, and Lists
}

private static String path(@NotNull final String path, @NotNull final FileIO io) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,26 @@ void appendToCatalogTableWithAllDataTypesTest() {
assertTableEquals(source, tableAdapter.table());
}

@Test
void appendByteArrayToBinaryColTest() {
final Schema schema = new Schema(
Types.NestedField.required(1, "binaryCol", Types.BinaryType.get()));
final Namespace myNamespace = Namespace.of("MyNamespace");
final TableIdentifier myTableId = TableIdentifier.of(myNamespace, "appendToBinaryColTest");
catalogAdapter.catalog().createTable(myTableId, schema);
final Table source = TableTools.emptyTable(10)
.update("binaryCol = new byte[] {(byte) i}");
final IcebergTableAdapter tableAdapter = catalogAdapter.loadTable(myTableId);
try {
tableAdapter.tableWriter(writerOptionsBuilder()
.tableDefinition(source.getDefinition())
.build());
failBecauseExceptionWasNotThrown(TableDataException.class);
} catch (TableDataException e) {
assertThat(e).hasMessageContaining("Unsupported deephaven column type");
}
}

@Test
void testFailureInWrite() {
// Try creating a new iceberg table with bad data
Expand Down