Skip to content
Permalink
Browse files
fix: BQ Numeric is compatible with double and float protobuf types (#367
)

Fixed a bug and made BQ Numeric compatible with double and float protobuf types.
  • Loading branch information
allenc3 committed Jun 22, 2020
1 parent 67626bd commit 1b2f1103d83502836dbc2d6a0d5659e44cd9836d
@@ -206,6 +206,11 @@ private static boolean isCompatibleWithBQNumeric(Descriptors.FieldDescriptor.Typ
return true;
}

if (field == Descriptors.FieldDescriptor.Type.FLOAT
|| field == Descriptors.FieldDescriptor.Type.DOUBLE) {
return true;
}

return false;
}

@@ -729,7 +729,9 @@ public void testBQNumeric() {
Fixed64Type.getDescriptor(),
SFixed32Type.getDescriptor(),
SFixed64Type.getDescriptor(),
BytesType.getDescriptor()));
BytesType.getDescriptor(),
FloatType.getDescriptor(),
DoubleType.getDescriptor()));

for (Descriptors.Descriptor descriptor : type_descriptors) {
if (compatible.contains(descriptor)) {

0 comments on commit 1b2f110

Please sign in to comment.