From a32bb8795a32367a95e7883fe61c8c9ccd085892 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Thu, 7 Dec 2023 16:08:56 +0100 Subject: Detect integer fields in fieldsets. --- .../src/test/java/com/yahoo/search/yql/YqlParserTestCase.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'container-search/src/test/java/com/yahoo/search') diff --git a/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java b/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java index 178163cf961..783a0ec61de 100644 --- a/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java @@ -90,6 +90,10 @@ public class YqlParserTestCase { sd.addIndex(stringIndex); Index floatIndex = new Index("float"); sd.addIndex(floatIndex); + Index mixedIndex = new Index("mixed"); + mixedIndex.setInteger(true); + mixedIndex.setString(true); + sd.addIndex(mixedIndex); return new IndexFacts(new IndexModel(sd)); } @@ -1201,6 +1205,9 @@ public class YqlParserTestCase { assertParseFail("select * from sources * where float in (25)", new IllegalArgumentException("The in operator is only supported for integer and string fields. " + "The field float is not of these types")); + assertParseFail("select * from sources * where mixed in (25)", + new IllegalArgumentException("The in operator is not supported for fieldsets with a mix of integer " + + "and string fields. The fieldset mixed has both")); } private static void assertNumericInItem(String field, long[] values, QueryTree query) { -- cgit v1.2.3