File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -2045,6 +2045,7 @@ public void testMatchOptions() {
20452045 for (Map .Entry <String , DataType > allowedOptions : Match .ALLOWED_OPTIONS .entrySet ()) {
20462046 String optionName = allowedOptions .getKey ();
20472047 DataType optionType = allowedOptions .getValue ();
2048+ // Check every possible type for the option - we'll try to convert it to the expected type
20482049 for (DataType currentType : optionTypes ) {
20492050 String optionValue = switch (currentType ) {
20502051 case BOOLEAN -> String .valueOf (randomBoolean ());
@@ -2061,11 +2062,13 @@ public void testMatchOptions() {
20612062 }
20622063
20632064 String query = "FROM test | WHERE match(first_name, \" Jean\" , {\" " + optionName + "\" : " + queryOptionValue + "})" ;
2064- // Check conversion is possible
20652065 try {
2066+ // Check conversion is possible
20662067 DataTypeConverter .convert (optionValue , optionType );
2068+ // If no exception was thrown, conversion is possible and should be done
20672069 query (query );
20682070 } catch (InvalidArgumentException e ) {
2071+ // Conversion is not possible, query should fail
20692072 assertEquals (
20702073 "1:19: Invalid option ["
20712074 + optionName
You can’t perform that action at this time.
0 commit comments