You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL: Don't allow inexact fields for MIN/MAX (#39563)
MIN/MAX on strings are supported and are implemented with
TopAggs FIRST/LAST respectively, but they cannot operate on
`text` fields without underlying `keyword` fields => inexact.
Follows: #39427
Copy file name to clipboardExpand all lines: x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/analysis/analyzer/VerifierErrorMessagesTests.java
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -717,6 +717,18 @@ public void testTopHitsGroupByHavingUnsupported() {
717
717
error("SELECT FIRST(int) FROM test GROUP BY text HAVING FIRST(int) > 10"));
718
718
}
719
719
720
+
publicvoidtestMinOnInexactUnsupported() {
721
+
assertEquals("1:8: [MIN(text)] cannot operate on field of data type [text]: " +
722
+
"No keyword/multi-field defined exact matches for [text]; define one or use MATCH/QUERY instead",
723
+
error("SELECT MIN(text) FROM test"));
724
+
}
725
+
726
+
publicvoidtestMaxOnInexactUnsupported() {
727
+
assertEquals("1:8: [MAX(text)] cannot operate on field of data type [text]: " +
728
+
"No keyword/multi-field defined exact matches for [text]; define one or use MATCH/QUERY instead",
0 commit comments