com.apple.foundationdb.record.RecordCoreException: Comparison value of incorrect type
or
com.apple.foundationdb.record.RecordCoreException: Tried to compare non-comparable object class com.google.protobuf.Descriptors$EnumValueDescriptor
For now I’m just running a post-query filter so this isn’t blocking by any means.
It looks like all our tests / examples use an index to match the enum value. We don’t have one for evaluating against a loaded record. And that doesn’t (always?) work.
com.apple.foundationdb.record.RecordCoreException: com.apple.foundationdb.record.RecordCoreException: Tried to compare non-comparable object class com.google.protobuf.Descriptors$EnumValueDescriptor
when attempting to use the following QueryComponent:
After some debugging I can see the exception being thrown in the method toClassWithRealEquals in com/apple/foundationdb/record/query/expressions/Comparisons.java
@SuppressWarnings("rawtypes")
private static Object toClassWithRealEquals(@Nullable Object obj) {
if (obj == null) {
return null;
} else if (obj instanceof ByteString) {
return obj;
} else if (obj instanceof byte[]) {
return ByteString.copyFrom((byte[])obj);
} else if (obj instanceof Comparable) {
return obj;
} else if (obj instanceof List) {
return obj;
} else {
throw new RecordCoreException("Tried to compare non-comparable object " + obj.getClass());
}
}