Skip to content

Commit

Permalink
Address reported bug in Flight Boolean Columns (deephaven#4047)
Browse files Browse the repository at this point in the history
* One-line change.

* Flailing a bit.
  • Loading branch information
lbooker42 authored Jun 22, 2023
1 parent a5c4aca commit 2894462
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ private static Class<?> getDefaultType(final ArrowType arrowType, final Converte
throw Exceptions.statusRuntimeException(Code.INVALID_ARGUMENT, exMsg +
" of intType(signed=" + intType.getIsSigned() + ", bitWidth=" + intType.getBitWidth() + ")");
case Bool:
return boolean.class;
return Boolean.class;
case Duration:
final ArrowType.Duration durationType = (ArrowType.Duration) arrowType;
final TimeUnit durationUnit = durationType.getUnit();
Expand Down Expand Up @@ -466,11 +466,13 @@ private static ConvertedArrowSchema convertArrowSchema(
if (type.getValue() == null) {
Class<?> defaultType = getDefaultType(getArrowType.apply(i), result, i);
type.setValue(defaultType);
} else if (type.getValue() == boolean.class) {
} else if (type.getValue() == boolean.class || type.getValue() == Boolean.class) {
// check existing barrage clients that might be sending int8 instead of bool
// TODO (deephaven-core#3403) widen this check for better assurances
Class<?> defaultType = getDefaultType(getArrowType.apply(i), result, i);
Assert.eq(type.getValue(), "deephaven column type", defaultType, "arrow inferred type");
Assert.eq(Boolean.class, "deephaven column type", defaultType, "arrow inferred type");
// force to boxed boolean to allow nullability in the column sources
type.setValue(Boolean.class);
}
columns[i] = ColumnDefinition.fromGenericType(name, type.getValue(), componentType.getValue());
}
Expand Down

0 comments on commit 2894462

Please sign in to comment.