1 | /* | |
2 | * Copyright OpenSearch Contributors | |
3 | * SPDX-License-Identifier: Apache-2.0 | |
4 | */ | |
5 | ||
6 | ||
7 | package org.opensearch.sql.data.utils; | |
8 | ||
9 | import com.google.common.collect.Ordering; | |
10 | import lombok.RequiredArgsConstructor; | |
11 | import org.opensearch.sql.data.model.ExprValue; | |
12 | ||
13 | /** | |
14 | * Idea from guava {@link Ordering}. The only difference is the special logic to handle {@link | |
15 | * org.opensearch.sql.data.model.ExprNullValue} and {@link | |
16 | * org.opensearch.sql.data.model.ExprMissingValue} | |
17 | */ | |
18 | @RequiredArgsConstructor | |
19 | public class ReverseExprValueOrdering extends ExprValueOrdering { | |
20 | private final ExprValueOrdering forwardOrder; | |
21 | ||
22 | @Override | |
23 | public int compare(ExprValue left, ExprValue right) { | |
24 |
1
1. compare : replaced int return with 0 for org/opensearch/sql/data/utils/ReverseExprValueOrdering::compare → KILLED |
return forwardOrder.compare(right, left); |
25 | } | |
26 | ||
27 | @Override | |
28 | public ExprValueOrdering reverse() { | |
29 |
1
1. reverse : replaced return value with null for org/opensearch/sql/data/utils/ReverseExprValueOrdering::reverse → KILLED |
return forwardOrder; |
30 | } | |
31 | } | |
Mutations | ||
24 |
1.1 |
|
29 |
1.1 |