diff --git a/mr/src/main/java/org/opensearch/hadoop/mr/WritableValueReader.java b/mr/src/main/java/org/opensearch/hadoop/mr/WritableValueReader.java index 77d1ccf64..93933e7ce 100644 --- a/mr/src/main/java/org/opensearch/hadoop/mr/WritableValueReader.java +++ b/mr/src/main/java/org/opensearch/hadoop/mr/WritableValueReader.java @@ -72,6 +72,7 @@ public Object createArray(FieldType type) { case HALF_FLOAT: case SCALED_FLOAT: case FLOAT: + case KNN_VECTOR: arrayType = FloatWritable.class; break; case DOUBLE: diff --git a/mr/src/main/java/org/opensearch/hadoop/serialization/FieldType.java b/mr/src/main/java/org/opensearch/hadoop/serialization/FieldType.java index 7c605f530..913a99d67 100644 --- a/mr/src/main/java/org/opensearch/hadoop/serialization/FieldType.java +++ b/mr/src/main/java/org/opensearch/hadoop/serialization/FieldType.java @@ -93,6 +93,7 @@ public enum FieldType { CAST_HIERARCHY.put(TEXT, new LinkedHashSet(Collections.singletonList(KEYWORD))); CAST_HIERARCHY.put(KEYWORD, new LinkedHashSet()); CAST_HIERARCHY.put(WILDCARD, new LinkedHashSet(Collections.singletonList(KEYWORD))); + CAST_HIERARCHY.put(HALF_FLOAT, new LinkedHashSet(Arrays.asList(FLOAT))); CAST_HIERARCHY.put(HALF_FLOAT, new LinkedHashSet(Arrays.asList(FLOAT, DOUBLE, KEYWORD))); CAST_HIERARCHY.put(SCALED_FLOAT, new LinkedHashSet(Arrays.asList(DOUBLE, KEYWORD))); CAST_HIERARCHY.put(GEO_POINT, new LinkedHashSet()); @@ -102,6 +103,7 @@ public enum FieldType { CAST_HIERARCHY.put(JOIN, new LinkedHashSet()); CAST_HIERARCHY.put(IP, new LinkedHashSet(Collections.singletonList(KEYWORD))); CAST_HIERARCHY.put(COMPLETION, new LinkedHashSet()); + CAST_HIERARCHY.put(KNN_VECTOR, new LinkedHashSet(Arrays.asList(FLOAT))); } public static FieldType parse(String name) {