vinothchandar commented on code in PR #18146:
URL: https://github.com/apache/hudi/pull/18146#discussion_r2871182726


##########
hudi-common/src/main/java/org/apache/hudi/common/schema/HoodieSchema.java:
##########
@@ -645,6 +648,62 @@ public static HoodieSchema.Blob createBlob() {
     return new HoodieSchema.Blob(Blob.DEFAULT_NAME);
   }
 
+  /**
+   * Creates Vector schema with default name and specified dimension.
+   * Defaults to {@link Vector.VectorElementType#FLOAT} element type.
+   *
+   * <p>The generated FIXED type name encodes dimension and element type 
(e.g., {@code vector_float_128})
+   * to avoid Avro name collisions when multiple vector columns exist in the 
same record.</p>
+   *
+   * @param dimension vector dimension (must be > 0)
+   * @return new HoodieSchema.Vector
+   */
+  public static HoodieSchema.Vector createVector(int dimension) {
+    return createVector(dimension, Vector.VectorElementType.FLOAT);
+  }
+
+  /**
+   * Creates Vector schema with custom name and dimension.
+   * Defaults to {@link Vector.VectorElementType#FLOAT} element type.
+   *
+   * @param name FIXED type name (must not be null or empty)
+   * @param dimension vector dimension (must be > 0)
+   * @return new HoodieSchema.Vector
+   */
+  public static HoodieSchema.Vector createVector(String name, int dimension) {
+    return createVector(name, dimension, Vector.VectorElementType.FLOAT);
+  }
+
+  /**
+   * Creates Vector schema with custom dimension and element type.
+   *
+   * <p>The generated FIXED type name encodes dimension and element type 
(e.g., {@code vector_double_256})
+   * to avoid Avro name collisions when multiple vector columns exist in the 
same record.</p>

Review Comment:
   won't we have a collision if there are two float vectors of same number of 
dimensions.. is there a generic solution needed for this, given we have 
established that the name collision is a problem



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