Stefanietry commented on code in PR #8019:
URL: https://github.com/apache/paimon/pull/8019#discussion_r3332971925


##########
paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkCatalog.java:
##########
@@ -609,6 +607,17 @@ private Schema toInitialSchema(
                         field.dataType() instanceof 
org.apache.spark.sql.types.BinaryType,
                         "The type of blob field must be binary");
                 type = new BlobType();
+            } else if (vectorFields.contains(field.name())) {
+                Preconditions.checkArgument(
+                        field.dataType() instanceof ArrayType,
+                        "The type of blob field must be array");
+                ArrayType arrayType = (ArrayType) field.dataType();
+                String dimKey = String.format("field.%s.vector-dim", 
field.name());
+                type =
+                        new VectorType(

Review Comment:
   Use general api:
   
   DataTypes.VECTOR(
                                   Integer.parseInt(properties.get(dimKey)),
                                   toPaimonType(arrayType.elementType()));



-- 
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]

Reply via email to