SQL: Make error msg for validation of 2nd arg of PERCENTILE[_RANK] consistent (#37937)
Use `first` and `second` instead of `1st` and `2nd`.
This commit is contained in:
parent
8e5f9c4b14
commit
e9332331a3
|
@ -43,7 +43,7 @@ public class Percentile extends NumericAggregate implements EnclosedAgg {
|
||||||
@Override
|
@Override
|
||||||
protected TypeResolution resolveType() {
|
protected TypeResolution resolveType() {
|
||||||
if (!percent.foldable()) {
|
if (!percent.foldable()) {
|
||||||
return new TypeResolution(format(null, "2nd argument of PERCENTILE must be a constant, received [{}]",
|
return new TypeResolution(format(null, "Second argument of PERCENTILE must be a constant, received [{}]",
|
||||||
Expressions.name(percent)));
|
Expressions.name(percent)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class PercentileRank extends AggregateFunction implements EnclosedAgg {
|
||||||
@Override
|
@Override
|
||||||
protected TypeResolution resolveType() {
|
protected TypeResolution resolveType() {
|
||||||
if (!value.foldable()) {
|
if (!value.foldable()) {
|
||||||
return new TypeResolution(format(null, "2nd argument of PERCENTILE_RANK must be a constant, received [{}]",
|
return new TypeResolution(format(null, "Second argument of PERCENTILE_RANK must be a constant, received [{}]",
|
||||||
Expressions.name(value)));
|
Expressions.name(value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -538,12 +538,12 @@ public class VerifierErrorMessagesTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testErrorMessageForPercentileWithSecondArgBasedOnAField() {
|
public void testErrorMessageForPercentileWithSecondArgBasedOnAField() {
|
||||||
assertEquals("1:8: 2nd argument of PERCENTILE must be a constant, received [ABS(int)]",
|
assertEquals("1:8: Second argument of PERCENTILE must be a constant, received [ABS(int)]",
|
||||||
error("SELECT PERCENTILE(int, ABS(int)) FROM test"));
|
error("SELECT PERCENTILE(int, ABS(int)) FROM test"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testErrorMessageForPercentileRankWithSecondArgBasedOnAField() {
|
public void testErrorMessageForPercentileRankWithSecondArgBasedOnAField() {
|
||||||
assertEquals("1:8: 2nd argument of PERCENTILE_RANK must be a constant, received [ABS(int)]",
|
assertEquals("1:8: Second argument of PERCENTILE_RANK must be a constant, received [ABS(int)]",
|
||||||
error("SELECT PERCENTILE_RANK(int, ABS(int)) FROM test"));
|
error("SELECT PERCENTILE_RANK(int, ABS(int)) FROM test"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue