From 51cb63f934f061ffa50ce767e4d04a5ca5aff842 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 2 Jan 2019 08:15:21 -0500 Subject: [PATCH] Spelling: replace substract with subtract (#37055) --- .../xpack/sql/analysis/analyzer/Analyzer.java | 6 +++--- .../xpack/sql/expression/AttributeMap.java | 2 +- .../xpack/sql/expression/AttributeSet.java | 4 ++-- .../arithmetic/BinaryArithmeticProcessor.java | 2 +- .../xpack/sql/expression/AttributeMapTests.java | 14 +++++++------- .../operator/arithmetic/BinaryArithmeticTests.java | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/analysis/analyzer/Analyzer.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/analysis/analyzer/Analyzer.java index 2b1aa42277e..df60bd7af89 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/analysis/analyzer/Analyzer.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/analysis/analyzer/Analyzer.java @@ -612,7 +612,7 @@ public class Analyzer extends RuleExecutor { .collect(toList())); - AttributeSet missing = resolvedRefs.substract(o.child().outputSet()); + AttributeSet missing = resolvedRefs.subtract(o.child().outputSet()); if (!missing.isEmpty()) { // Add missing attributes but project them away afterwards @@ -648,7 +648,7 @@ public class Analyzer extends RuleExecutor { .filter(Expression::resolved) .collect(toList())); - AttributeSet missing = resolvedRefs.substract(f.child().outputSet()); + AttributeSet missing = resolvedRefs.subtract(f.child().outputSet()); if (!missing.isEmpty()) { // Again, add missing attributes and project them away @@ -695,7 +695,7 @@ public class Analyzer extends RuleExecutor { if (plan instanceof Project) { Project p = (Project) plan; - AttributeSet diff = missing.substract(p.child().outputSet()); + AttributeSet diff = missing.subtract(p.child().outputSet()); return new Project(p.location(), propagateMissing(p.child(), diff, failed), combine(p.projections(), missing)); } diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/AttributeMap.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/AttributeMap.java index 57dc8f6152e..b5d13761772 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/AttributeMap.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/AttributeMap.java @@ -175,7 +175,7 @@ public class AttributeMap { delegate.putAll(other.delegate); } - public AttributeMap substract(AttributeMap other) { + public AttributeMap subtract(AttributeMap other) { AttributeMap diff = new AttributeMap<>(); for (Entry entry : this.delegate.entrySet()) { if (!other.delegate.containsKey(entry.getKey())) { diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/AttributeSet.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/AttributeSet.java index 5d4065e5f36..af290371daf 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/AttributeSet.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/AttributeSet.java @@ -57,8 +57,8 @@ public class AttributeSet implements Set { delegate.addAll(other.delegate); } - public AttributeSet substract(AttributeSet other) { - return new AttributeSet(delegate.substract(other.delegate)); + public AttributeSet subtract(AttributeSet other) { + return new AttributeSet(delegate.subtract(other.delegate)); } public AttributeSet intersect(AttributeSet other) { diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/BinaryArithmeticProcessor.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/BinaryArithmeticProcessor.java index 1b7afa20307..a0fd57e30d0 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/BinaryArithmeticProcessor.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/BinaryArithmeticProcessor.java @@ -76,7 +76,7 @@ public class BinaryArithmeticProcessor extends FunctionalBinaryProcessor) { - throw new SqlIllegalArgumentException("Cannot substract a date from an interval; do you mean the reverse?"); + throw new SqlIllegalArgumentException("Cannot subtract a date from an interval; do you mean the reverse?"); } throw new SqlIllegalArgumentException("Cannot compute [-] between [{}] [{}]", l.getClass().getSimpleName(), diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/expression/AttributeMapTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/expression/AttributeMapTests.java index fa85ca9cbff..c80509cc069 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/expression/AttributeMapTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/expression/AttributeMapTests.java @@ -79,19 +79,19 @@ public class AttributeMapTests extends ESTestCase { assertThat(m.containsValue("on"), is(false)); } - public void testSubstract() { + public void testSubtract() { AttributeMap m = threeMap(); AttributeMap mo = new AttributeMap<>(m.keySet().iterator().next(), "one"); AttributeMap empty = new AttributeMap<>(); - assertThat(m.substract(empty), is(m)); - assertThat(m.substract(m), is(empty)); - assertThat(mo.substract(m), is(empty)); + assertThat(m.subtract(empty), is(m)); + assertThat(m.subtract(m), is(empty)); + assertThat(mo.subtract(m), is(empty)); - AttributeMap substract = m.substract(mo); + AttributeMap subtract = m.subtract(mo); - assertThat(substract.size(), is(2)); - assertThat(substract.attributeNames(), contains("two", "three")); + assertThat(subtract.size(), is(2)); + assertThat(subtract.attributeNames(), contains("two", "three")); } public void testIntersect() { diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/BinaryArithmeticTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/BinaryArithmeticTests.java index 2618392a067..ab1556db76d 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/BinaryArithmeticTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/BinaryArithmeticTests.java @@ -139,7 +139,7 @@ public class BinaryArithmeticTests extends ESTestCase { TemporalAmount t = Period.ofYears(100).plusMonths(50); Literal r = interval(t, INTERVAL_HOUR); SqlIllegalArgumentException ex = expectThrows(SqlIllegalArgumentException.class, () -> sub(r, l)); - assertEquals("Cannot substract a date from an interval; do you mean the reverse?", ex.getMessage()); + assertEquals("Cannot subtract a date from an interval; do you mean the reverse?", ex.getMessage()); } public void testSubNumberFromIntervalIllegal() {