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 @@ -43,7 +43,7 @@ public Percentile replaceChildren(List<Expression> newChildren) {
@Override
protected TypeResolution resolveType() {
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)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public Expression replaceChildren(List<Expression> newChildren) {
@Override
protected TypeResolution resolveType() {
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)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,12 @@ public void testAggsInHistogram() {
}

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

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"));
}
}
Expand Down