Spelling: replace substract with subtract (#37055)
This commit is contained in:
parent
565a95c382
commit
51cb63f934
|
@ -612,7 +612,7 @@ public class Analyzer extends RuleExecutor<LogicalPlan> {
|
||||||
.collect(toList()));
|
.collect(toList()));
|
||||||
|
|
||||||
|
|
||||||
AttributeSet missing = resolvedRefs.substract(o.child().outputSet());
|
AttributeSet missing = resolvedRefs.subtract(o.child().outputSet());
|
||||||
|
|
||||||
if (!missing.isEmpty()) {
|
if (!missing.isEmpty()) {
|
||||||
// Add missing attributes but project them away afterwards
|
// Add missing attributes but project them away afterwards
|
||||||
|
@ -648,7 +648,7 @@ public class Analyzer extends RuleExecutor<LogicalPlan> {
|
||||||
.filter(Expression::resolved)
|
.filter(Expression::resolved)
|
||||||
.collect(toList()));
|
.collect(toList()));
|
||||||
|
|
||||||
AttributeSet missing = resolvedRefs.substract(f.child().outputSet());
|
AttributeSet missing = resolvedRefs.subtract(f.child().outputSet());
|
||||||
|
|
||||||
if (!missing.isEmpty()) {
|
if (!missing.isEmpty()) {
|
||||||
// Again, add missing attributes and project them away
|
// Again, add missing attributes and project them away
|
||||||
|
@ -695,7 +695,7 @@ public class Analyzer extends RuleExecutor<LogicalPlan> {
|
||||||
|
|
||||||
if (plan instanceof Project) {
|
if (plan instanceof Project) {
|
||||||
Project p = (Project) plan;
|
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));
|
return new Project(p.location(), propagateMissing(p.child(), diff, failed), combine(p.projections(), missing));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class AttributeMap<E> {
|
||||||
delegate.putAll(other.delegate);
|
delegate.putAll(other.delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AttributeMap<E> substract(AttributeMap<E> other) {
|
public AttributeMap<E> subtract(AttributeMap<E> other) {
|
||||||
AttributeMap<E> diff = new AttributeMap<>();
|
AttributeMap<E> diff = new AttributeMap<>();
|
||||||
for (Entry<AttributeWrapper, E> entry : this.delegate.entrySet()) {
|
for (Entry<AttributeWrapper, E> entry : this.delegate.entrySet()) {
|
||||||
if (!other.delegate.containsKey(entry.getKey())) {
|
if (!other.delegate.containsKey(entry.getKey())) {
|
||||||
|
|
|
@ -57,8 +57,8 @@ public class AttributeSet implements Set<Attribute> {
|
||||||
delegate.addAll(other.delegate);
|
delegate.addAll(other.delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AttributeSet substract(AttributeSet other) {
|
public AttributeSet subtract(AttributeSet other) {
|
||||||
return new AttributeSet(delegate.substract(other.delegate));
|
return new AttributeSet(delegate.subtract(other.delegate));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AttributeSet intersect(AttributeSet other) {
|
public AttributeSet intersect(AttributeSet other) {
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class BinaryArithmeticProcessor extends FunctionalBinaryProcessor<Object,
|
||||||
return Arithmetics.sub((ZonedDateTime) l, ((IntervalDayTime) r).interval());
|
return Arithmetics.sub((ZonedDateTime) l, ((IntervalDayTime) r).interval());
|
||||||
}
|
}
|
||||||
if (r instanceof ZonedDateTime && l instanceof Interval<?>) {
|
if (r instanceof ZonedDateTime && l instanceof Interval<?>) {
|
||||||
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(),
|
throw new SqlIllegalArgumentException("Cannot compute [-] between [{}] [{}]", l.getClass().getSimpleName(),
|
||||||
|
|
|
@ -79,19 +79,19 @@ public class AttributeMapTests extends ESTestCase {
|
||||||
assertThat(m.containsValue("on"), is(false));
|
assertThat(m.containsValue("on"), is(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSubstract() {
|
public void testSubtract() {
|
||||||
AttributeMap<String> m = threeMap();
|
AttributeMap<String> m = threeMap();
|
||||||
AttributeMap<String> mo = new AttributeMap<>(m.keySet().iterator().next(), "one");
|
AttributeMap<String> mo = new AttributeMap<>(m.keySet().iterator().next(), "one");
|
||||||
AttributeMap<String> empty = new AttributeMap<>();
|
AttributeMap<String> empty = new AttributeMap<>();
|
||||||
|
|
||||||
assertThat(m.substract(empty), is(m));
|
assertThat(m.subtract(empty), is(m));
|
||||||
assertThat(m.substract(m), is(empty));
|
assertThat(m.subtract(m), is(empty));
|
||||||
assertThat(mo.substract(m), is(empty));
|
assertThat(mo.subtract(m), is(empty));
|
||||||
|
|
||||||
AttributeMap<String> substract = m.substract(mo);
|
AttributeMap<String> subtract = m.subtract(mo);
|
||||||
|
|
||||||
assertThat(substract.size(), is(2));
|
assertThat(subtract.size(), is(2));
|
||||||
assertThat(substract.attributeNames(), contains("two", "three"));
|
assertThat(subtract.attributeNames(), contains("two", "three"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testIntersect() {
|
public void testIntersect() {
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class BinaryArithmeticTests extends ESTestCase {
|
||||||
TemporalAmount t = Period.ofYears(100).plusMonths(50);
|
TemporalAmount t = Period.ofYears(100).plusMonths(50);
|
||||||
Literal r = interval(t, INTERVAL_HOUR);
|
Literal r = interval(t, INTERVAL_HOUR);
|
||||||
SqlIllegalArgumentException ex = expectThrows(SqlIllegalArgumentException.class, () -> sub(r, l));
|
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() {
|
public void testSubNumberFromIntervalIllegal() {
|
||||||
|
|
Loading…
Reference in New Issue