24
24
import org .elasticsearch .compute .data .Page ;
25
25
import org .elasticsearch .compute .operator .Warnings ;
26
26
import org .elasticsearch .compute .operator .lookup .QueryList ;
27
+ import org .elasticsearch .core .Nullable ;
27
28
import org .elasticsearch .core .Releasables ;
28
29
import org .elasticsearch .index .mapper .MappedFieldType ;
29
30
import org .elasticsearch .index .mapper .RangeFieldMapper ;
@@ -103,7 +104,7 @@ protected QueryList queryList(
103
104
TransportRequest request ,
104
105
SearchExecutionContext context ,
105
106
Block inputBlock ,
106
- DataType inputDataType ,
107
+ @ Nullable DataType inputDataType ,
107
108
Warnings warnings
108
109
) {
109
110
MappedFieldType fieldType = context .getFieldType (request .matchField );
@@ -128,8 +129,8 @@ protected LookupResponse readLookupResponse(StreamInput in, BlockFactory blockFa
128
129
return new LookupResponse (in , blockFactory );
129
130
}
130
131
131
- private static void validateTypes (DataType inputDataType , MappedFieldType fieldType ) {
132
- if (fieldType instanceof RangeFieldMapper .RangeFieldType rangeType ) {
132
+ private static void validateTypes (@ Nullable DataType inputDataType , MappedFieldType fieldType ) {
133
+ if (fieldType instanceof RangeFieldMapper .RangeFieldType rangeType && inputDataType != null ) {
133
134
// For range policy types, the ENRICH index field type will be one of a list of supported range types,
134
135
// which need to match the input data type (eg. ip-range -> ip, date-range -> date, etc.)
135
136
if (rangeTypesCompatible (rangeType .rangeType (), inputDataType ) == false ) {
@@ -142,7 +143,7 @@ private static void validateTypes(DataType inputDataType, MappedFieldType fieldT
142
143
// For geo_match, type validation is done earlier, in the Analyzer.
143
144
}
144
145
145
- private static boolean rangeTypesCompatible (RangeType rangeType , DataType inputDataType ) {
146
+ private static boolean rangeTypesCompatible (RangeType rangeType , @ Nullable DataType inputDataType ) {
146
147
if (inputDataType .noText () == DataType .KEYWORD ) {
147
148
// We allow runtime parsing of string types to numeric types
148
149
return true ;
0 commit comments