Hisoka-X commented on code in PR #7401:
URL: https://github.com/apache/seatunnel/pull/7401#discussion_r1721531479
##########
seatunnel-connectors-v2/connector-milvus/src/main/java/org/apache/seatunnel/connectors/seatunnel/milvus/sink/batch/MilvusBufferBatchWriter.java:
##########
@@ -29,7 +29,8 @@
import org.apache.commons.collections4.CollectionUtils;
-import com.alibaba.fastjson.JSONObject;
+import com.google.gson.Gson;
+import com.google.gson.JsonObject;
Review Comment:
ditto
##########
seatunnel-connectors-v2/connector-milvus/src/main/java/org/apache/seatunnel/connectors/seatunnel/milvus/convert/MilvusConvertUtils.java:
##########
@@ -320,6 +325,13 @@ public static Object
convertBySeaTunnelType(SeaTunnelDataType<?> fieldType, Obje
vector.add(Float.parseFloat(o.toString()));
}
return vector;
+ case BINARY_VECTOR:
+ case BFLOAT16_VECTOR:
+ case FLOAT16_VECTOR:
Review Comment:
cc @Thomas-HuWei
##########
seatunnel-connectors-v2/connector-milvus/src/main/java/org/apache/seatunnel/connectors/seatunnel/milvus/convert/MilvusConvertUtils.java:
##########
@@ -320,6 +325,13 @@ public static Object
convertBySeaTunnelType(SeaTunnelDataType<?> fieldType, Obje
vector.add(Float.parseFloat(o.toString()));
}
return vector;
+ case BINARY_VECTOR:
+ case BFLOAT16_VECTOR:
+ case FLOAT16_VECTOR:
+ ByteBuffer binaryVector = (ByteBuffer) value;
+ return gson.toJsonTree(binaryVector.array());
Review Comment:
Please use jackson instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]