Skip to content

Commit b465d96

Browse files
jsorefjavanna
authored andcommitted
Spelling: replace substract with subtract (#37055)
1 parent e2906b8 commit b465d96

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/analysis/analyzer/Analyzer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ protected LogicalPlan rule(LogicalPlan plan) {
612612
.collect(toList()));
613613

614614

615-
AttributeSet missing = resolvedRefs.substract(o.child().outputSet());
615+
AttributeSet missing = resolvedRefs.subtract(o.child().outputSet());
616616

617617
if (!missing.isEmpty()) {
618618
// Add missing attributes but project them away afterwards
@@ -648,7 +648,7 @@ protected LogicalPlan rule(LogicalPlan plan) {
648648
.filter(Expression::resolved)
649649
.collect(toList()));
650650

651-
AttributeSet missing = resolvedRefs.substract(f.child().outputSet());
651+
AttributeSet missing = resolvedRefs.subtract(f.child().outputSet());
652652

653653
if (!missing.isEmpty()) {
654654
// Again, add missing attributes and project them away
@@ -695,7 +695,7 @@ private static LogicalPlan propagateMissing(LogicalPlan plan, AttributeSet missi
695695

696696
if (plan instanceof Project) {
697697
Project p = (Project) plan;
698-
AttributeSet diff = missing.substract(p.child().outputSet());
698+
AttributeSet diff = missing.subtract(p.child().outputSet());
699699
return new Project(p.location(), propagateMissing(p.child(), diff, failed), combine(p.projections(), missing));
700700
}
701701

x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/AttributeMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void addAll(AttributeMap<E> other) {
175175
delegate.putAll(other.delegate);
176176
}
177177

178-
public AttributeMap<E> substract(AttributeMap<E> other) {
178+
public AttributeMap<E> subtract(AttributeMap<E> other) {
179179
AttributeMap<E> diff = new AttributeMap<>();
180180
for (Entry<AttributeWrapper, E> entry : this.delegate.entrySet()) {
181181
if (!other.delegate.containsKey(entry.getKey())) {

x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/AttributeSet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ void addAll(AttributeSet other) {
5757
delegate.addAll(other.delegate);
5858
}
5959

60-
public AttributeSet substract(AttributeSet other) {
61-
return new AttributeSet(delegate.substract(other.delegate));
60+
public AttributeSet subtract(AttributeSet other) {
61+
return new AttributeSet(delegate.subtract(other.delegate));
6262
}
6363

6464
public AttributeSet intersect(AttributeSet other) {

x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/BinaryArithmeticProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public enum BinaryArithmeticOperation implements PredicateBiFunction<Object, Obj
7676
return Arithmetics.sub((ZonedDateTime) l, ((IntervalDayTime) r).interval());
7777
}
7878
if (r instanceof ZonedDateTime && l instanceof Interval<?>) {
79-
throw new SqlIllegalArgumentException("Cannot substract a date from an interval; do you mean the reverse?");
79+
throw new SqlIllegalArgumentException("Cannot subtract a date from an interval; do you mean the reverse?");
8080
}
8181

8282
throw new SqlIllegalArgumentException("Cannot compute [-] between [{}] [{}]", l.getClass().getSimpleName(),

x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/expression/AttributeMapTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,19 @@ public void testSingleItemConstructor() {
7979
assertThat(m.containsValue("on"), is(false));
8080
}
8181

82-
public void testSubstract() {
82+
public void testSubtract() {
8383
AttributeMap<String> m = threeMap();
8484
AttributeMap<String> mo = new AttributeMap<>(m.keySet().iterator().next(), "one");
8585
AttributeMap<String> empty = new AttributeMap<>();
8686

87-
assertThat(m.substract(empty), is(m));
88-
assertThat(m.substract(m), is(empty));
89-
assertThat(mo.substract(m), is(empty));
87+
assertThat(m.subtract(empty), is(m));
88+
assertThat(m.subtract(m), is(empty));
89+
assertThat(mo.subtract(m), is(empty));
9090

91-
AttributeMap<String> substract = m.substract(mo);
91+
AttributeMap<String> subtract = m.subtract(mo);
9292

93-
assertThat(substract.size(), is(2));
94-
assertThat(substract.attributeNames(), contains("two", "three"));
93+
assertThat(subtract.size(), is(2));
94+
assertThat(subtract.attributeNames(), contains("two", "three"));
9595
}
9696

9797
public void testIntersect() {

x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/BinaryArithmeticTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public void testSubYearMonthIntervalToDateIllegal() {
139139
TemporalAmount t = Period.ofYears(100).plusMonths(50);
140140
Literal r = interval(t, INTERVAL_HOUR);
141141
SqlIllegalArgumentException ex = expectThrows(SqlIllegalArgumentException.class, () -> sub(r, l));
142-
assertEquals("Cannot substract a date from an interval; do you mean the reverse?", ex.getMessage());
142+
assertEquals("Cannot subtract a date from an interval; do you mean the reverse?", ex.getMessage());
143143
}
144144

145145
public void testSubNumberFromIntervalIllegal() {

0 commit comments

Comments
 (0)