1 | /* | |
2 | * Copyright OpenSearch Contributors | |
3 | * SPDX-License-Identifier: Apache-2.0 | |
4 | */ | |
5 | ||
6 | ||
7 | package org.opensearch.sql.planner.optimizer.pattern; | |
8 | ||
9 | import com.facebook.presto.matching.Property; | |
10 | import java.util.Optional; | |
11 | import lombok.experimental.UtilityClass; | |
12 | import org.opensearch.sql.planner.logical.LogicalPlan; | |
13 | ||
14 | /** | |
15 | * Pattern helper class. | |
16 | */ | |
17 | @UtilityClass | |
18 | public class Patterns { | |
19 | ||
20 | /** | |
21 | * LogicalPlan source {@link Property}. | |
22 | */ | |
23 | public static Property<LogicalPlan, LogicalPlan> source() { | |
24 |
2
1. lambda$source$0 : negated conditional → KILLED 2. source : replaced return value with null for org/opensearch/sql/planner/optimizer/pattern/Patterns::source → KILLED |
return Property.optionalProperty("source", plan -> plan.getChild().size() == 1 |
25 | ? Optional.of(plan.getChild().get(0)) | |
26 | : Optional.empty()); | |
27 | } | |
28 | } | |
Mutations | ||
24 |
1.1 2.2 |