Skip to content

Commit e6dd59c

Browse files
committed
Revert refactoring.
1 parent 7854ffc commit e6dd59c

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/expressions/Comparisons.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,18 @@ private static Comparable toComparable(@Nullable Object obj) {
215215

216216
@Nonnull
217217
public static Object toClassWithRealEquals(@Nonnull Object obj) {
218-
if (obj instanceof ByteString || obj instanceof Comparable
219-
|| obj instanceof List || obj instanceof RealVector) {
218+
if (obj instanceof ByteString) {
220219
return obj;
221220
} else if (obj instanceof byte[]) {
222221
return ByteString.copyFrom((byte[])obj);
223222
} else if (obj instanceof Internal.EnumLite) {
224223
return ((Internal.EnumLite)obj).getNumber();
224+
} else if (obj instanceof Comparable) {
225+
return obj;
226+
} else if (obj instanceof List) {
227+
return obj;
228+
} else if (obj instanceof RealVector) {
229+
return obj;
225230
} else {
226231
throw new RecordCoreException("Tried to compare non-comparable object " + obj.getClass());
227232
}

yaml-tests/src/test/resources/in-predicate.yamsql

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ test_block:
249249
# "expected" as the point of error is different in both the cases.
250250
# https://github.com/FoundationDB/fdb-record-layer/issues/3583
251251
test_block:
252-
preset: single_repetition_ordered
253252
tests:
254253
-
255254
# LONG value matched against IN list of LONG and DOUBLE values
@@ -258,50 +257,29 @@ test_block:
258257
# clear whether we want to support it as it would probably
259258
# make plan lookup in the cache much more expensive.
260259
- query: select a, b from ta where b in (1, 3.0, 5, 7.0)
261-
- initialVersionLessThan: !current_version
262260
- error: "XX000"
263-
- initialVersionAtLeast: !current_version
264-
- error: "42804"
265261
-
266262
# Values of incompatible types in the IN list
267263
- query: select a, e from ta where e in ('foo' , 35)
268-
- initialVersionLessThan: !current_version
269264
- error: "XX000"
270-
- initialVersionAtLeast: !current_version
271-
- error: "42804"
272265
-
273266
# Values of incompatible types in the IN list
274267
- query: select a, e from ta where e in (35, '23')
275-
- initialVersionLessThan: !current_version
276268
- error: "XX000"
277-
- initialVersionAtLeast: !current_version
278-
- error: "42804"
279269
-
280270
# Values of incompatible types in the IN list
281271
- query: select a, e from ta where e in (true, 75.34)
282-
- initialVersionLessThan: !current_version
283272
- error: "XX000"
284-
- initialVersionAtLeast: !current_version
285-
- error: "42804"
286273
-
287274
# Left type (STRING) is not compatible with right type (type of the IN List)
288275
- query: select a, e from ta where e in (35, 75.34)
289-
- initialVersionLessThan: !current_version
290276
- error: "XX000"
291-
- initialVersionAtLeast: !current_version
292-
- error: "42804"
293277
-
294278
# Left type (STRING) is not compatible with right type (type of the IN List)
295279
- query: select a, e from ta where e in (35.34, 32)
296-
- initialVersionLessThan: !current_version
297280
- error: "XX000"
298-
- initialVersionAtLeast: !current_version
299-
- error: "42804"
300281
-
301282
# Complex (STRUCT) left type matched against IN list
302283
- query: select a, e from ta where f in (34, 23)
303-
- initialVersionLessThan: 4.8.2.0
304-
- error: "XX000"
305-
- initialVersionAtLeast: 4.8.2.0
306284
- error: "22000"
307285
...

0 commit comments

Comments
 (0)