SQL: Allow IN from empty lists

It won't find anything, but it is valid.

This fixes a rare test failure.

Original commit: elastic/x-pack-elasticsearch@95ee6be507
This commit is contained in:
Nik Everett 2018-01-18 17:01:54 -05:00
parent ed65987500
commit d7944722cf
1 changed files with 2 additions and 2 deletions

View File

@ -37,8 +37,8 @@ public class In extends Expression {
@Override
public Expression replaceChildren(List<Expression> newChildren) {
if (newChildren.size() < 2) {
throw new IllegalArgumentException("expected more than one child but received [" + newChildren.size() + "]");
if (newChildren.size() < 1) {
throw new IllegalArgumentException("expected one or more children but received [" + newChildren.size() + "]");
}
return new In(location(), newChildren.get(newChildren.size() - 1), newChildren.subList(0, newChildren.size() - 1));
}