Skip to content

Commit 4a9193f

Browse files
committed
Revert changes to Span will always have a field with the current implementation
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent 1d4de5a commit 4a9193f

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

core/src/main/java/org/opensearch/sql/ast/expression/Span.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ public class Span extends UnresolvedExpression {
2525

2626
@Override
2727
public List<UnresolvedExpression> getChild() {
28-
if (field == null) {
29-
return ImmutableList.of(value);
30-
}
31-
return List.of(field, value);
28+
return ImmutableList.of(field, value);
3229
}
3330

3431
@Override

ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -729,13 +729,9 @@ public String visitAggregateFunction(AggregateFunction node, String context) {
729729

730730
@Override
731731
public String visitSpan(Span node, String context) {
732-
String field = node.getField() != null ? analyze(node.getField(), context) : null;
732+
String field = analyze(node.getField(), context);
733733
String value = analyze(node.getValue(), context);
734-
if (field != null) {
735-
return StringUtils.format("span(%s, %s %s)", field, value, node.getUnit().getName());
736-
} else {
737-
return StringUtils.format("span(%s %s)", value, node.getUnit().getName());
738-
}
734+
return StringUtils.format("span(%s, %s %s)", field, value, node.getUnit().getName());
739735
}
740736

741737
@Override

0 commit comments

Comments
 (0)