@@ -184,7 +184,6 @@ private static Optional<QueryPredicate> promoteOperandsAndCreatePredicate(@Nulla
184
184
@ Nonnull Value leftChild ,
185
185
@ Nonnull Value rightChild ,
186
186
@ Nonnull final Comparisons .Type comparisonType ) {
187
- /*
188
187
if (leftChild .getResultType ().getTypeCode () == Type .TypeCode .NULL && rightChild .getResultType ().getTypeCode () == Type .TypeCode .NULL ) {
189
188
if (comparisonType == Comparisons .Type .NOT_DISTINCT_FROM ) {
190
189
return Optional .of (ConstantPredicate .TRUE );
@@ -193,10 +192,6 @@ private static Optional<QueryPredicate> promoteOperandsAndCreatePredicate(@Nulla
193
192
}
194
193
}
195
194
196
- */
197
-
198
-
199
-
200
195
// maximumType may return null, but only for non-primitive types which is not possible here
201
196
final var maxtype = Verify .verifyNotNull (Type .maximumType (leftChild .getResultType (), rightChild .getResultType ()));
202
197
@@ -306,30 +301,11 @@ private static Value encapsulate(@Nonnull final String functionName,
306
301
final Typed arg1 = arguments .get (1 );
307
302
final Type res1 = arg1 .getResultType ();
308
303
309
- /*
310
- if ("isDistinctFrom".equals(functionName)) {
311
- if (res0.getTypeCode() == Type.TypeCode.NULL && res1.getTypeCode() != Type.TypeCode.NULL) {
312
- return encapsulate("notNull", Comparisons.Type.NOT_NULL, List.of(arg1));
313
- } else if (res1.getTypeCode() == Type.TypeCode.NULL && res0.getTypeCode() != Type.TypeCode.NULL) {
314
- return encapsulate("notNull", Comparisons.Type.NOT_NULL, List.of(arg0));
315
- }
316
- }
317
- if ("notDistinctFrom".equals(functionName)) {
318
- if (res0.getTypeCode() == Type.TypeCode.NULL && res1.getTypeCode() != Type.TypeCode.NULL) {
319
- return encapsulate("isNull", Comparisons.Type.IS_NULL, List.of(arg1));
320
- } else if (res1.getTypeCode() == Type.TypeCode.NULL && res0.getTypeCode() != Type.TypeCode.NULL) {
321
- return encapsulate("isNull", Comparisons.Type.IS_NULL, List.of(arg0));
322
- }
323
- }
324
-
325
- */
326
-
327
304
SemanticException .check (res1 .isPrimitive () || res1 .isEnum () || res1 .isUuid (), SemanticException .ErrorCode .COMPARAND_TO_COMPARISON_IS_OF_COMPLEX_TYPE );
328
305
329
306
final BinaryPhysicalOperator physicalOperator =
330
307
getBinaryOperatorMap ().get (new BinaryComparisonSignature (comparisonType , res0 .getTypeCode (), res1 .getTypeCode ()));
331
308
332
- System .out .println ("comparisonType:" + comparisonType + " res0:" + res0 .getTypeCode () + " res1:" + res1 .getTypeCode ());
333
309
Verify .verifyNotNull (physicalOperator , "unable to encapsulate comparison operation due to type mismatch(es)" );
334
310
335
311
return new BinaryRelOpValue (functionName ,
0 commit comments