1 | /* | |
2 | * Copyright OpenSearch Contributors | |
3 | * SPDX-License-Identifier: Apache-2.0 | |
4 | */ | |
5 | ||
6 | ||
7 | package org.opensearch.sql.expression.window; | |
8 | ||
9 | import static org.opensearch.sql.ast.tree.Sort.SortOption; | |
10 | import static org.opensearch.sql.ast.tree.Sort.SortOption.DEFAULT_ASC; | |
11 | ||
12 | import java.util.ArrayList; | |
13 | import java.util.List; | |
14 | import lombok.Data; | |
15 | import org.apache.commons.lang3.tuple.ImmutablePair; | |
16 | import org.apache.commons.lang3.tuple.Pair; | |
17 | import org.opensearch.sql.expression.Expression; | |
18 | ||
19 | /** | |
20 | * Window definition that consists of partition and sort by information for a window. | |
21 | */ | |
22 | @Data | |
23 | public class WindowDefinition { | |
24 | ||
25 | private final List<Expression> partitionByList; | |
26 | private final List<Pair<SortOption, Expression>> sortList; | |
27 | ||
28 | /** | |
29 | * Return all items in partition by and sort list. | |
30 | * @return all sort items | |
31 | */ | |
32 | public List<Pair<SortOption, Expression>> getAllSortItems() { | |
33 | List<Pair<SortOption, Expression>> allSorts = new ArrayList<>(); | |
34 |
1
1. getAllSortItems : removed call to java/util/List::forEach → KILLED |
partitionByList.forEach(expr -> allSorts.add(ImmutablePair.of(DEFAULT_ASC, expr))); |
35 | allSorts.addAll(sortList); | |
36 |
1
1. getAllSortItems : replaced return value with Collections.emptyList for org/opensearch/sql/expression/window/WindowDefinition::getAllSortItems → KILLED |
return allSorts; |
37 | } | |
38 | ||
39 | } | |
Mutations | ||
34 |
1.1 |
|
36 |
1.1 |