Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ protected LogicalPlan rule(LogicalPlan plan) {
.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
Expand Down Expand Up @@ -648,7 +648,7 @@ protected LogicalPlan rule(LogicalPlan plan) {
.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
Expand Down Expand Up @@ -695,7 +695,7 @@ private static LogicalPlan propagateMissing(LogicalPlan plan, AttributeSet missi

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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void addAll(AttributeMap<E> other) {
delegate.putAll(other.delegate);
}

public AttributeMap<E> substract(AttributeMap<E> other) {
public AttributeMap<E> subtract(AttributeMap<E> other) {
AttributeMap<E> diff = new AttributeMap<>();
for (Entry<AttributeWrapper, E> entry : this.delegate.entrySet()) {
if (!other.delegate.containsKey(entry.getKey())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ void addAll(AttributeSet other) {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public enum BinaryArithmeticOperation implements PredicateBiFunction<Object, Obj
return Arithmetics.sub((ZonedDateTime) l, ((IntervalDayTime) r).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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ public void testSingleItemConstructor() {
assertThat(m.containsValue("on"), is(false));
}

public void testSubstract() {
public void testSubtract() {
AttributeMap<String> m = threeMap();
AttributeMap<String> mo = new AttributeMap<>(m.keySet().iterator().next(), "one");
AttributeMap<String> 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<String> substract = m.substract(mo);
AttributeMap<String> 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public void testSubYearMonthIntervalToDateIllegal() {
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() {
Expand Down