Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address reported bug in Flight Boolean Columns #4047

Merged
merged 2 commits into from
Jun 22, 2023
Merged
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 @@ -299,7 +299,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 @@ -447,11 +447,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
lbooker42 marked this conversation as resolved.
Show resolved Hide resolved
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