Copilot commented on code in PR #13359:
URL: https://github.com/apache/gravitino/pull/13359#discussion_r4058698924
##########
catalogs/catalog-lakehouse-generic/src/main/java/org/apache/gravitino/catalog/lakehouse/lance/LanceTableOperations.java:
##########
@@ -875,11 +875,10 @@ private IndexParams getIndexParamsByIndexType(IndexType
indexType) {
return IndexParams.builder().build();
case VECTOR:
// TODO make these parameters configurable
- int numberOfDimensions = 3; // this value should be determined
dynamically based on the data
- // Add properties to Index to set this value.
+ int numberOfSubVectors = 3;
return IndexParams.builder()
.setVectorIndexParams(
- VectorIndexParams.ivfPq(2, 8, numberOfDimensions,
DistanceType.L2, 2))
+ VectorIndexParams.ivfPq(2, 8, numberOfSubVectors,
DistanceType.L2, 2))
Review Comment:
`numberOfSubVectors` is still hard-coded to 3, and this method receives no
target column from which to read `VectorType.dimension()`. A VECTOR index on a
column with another dimension therefore remains disconnected from the new type
(and the unspecified `-1` case is not rejected here). Thread the indexed
column/type through this path and derive or validate the vector-index parameter
from it before creating the index.
##########
common/src/main/java/org/apache/gravitino/dto/requests/FunctionDataTypeValidator.java:
##########
@@ -99,6 +99,11 @@ private static void validateDataType(Type dataType, String
fieldPath) {
return;
}
+ if (dataType instanceof Types.VectorType) {
+ validateDataType(((Types.VectorType) dataType).elementType(), fieldPath
+ ".elementType");
+ return;
Review Comment:
This new recursive validation branch has no request-level test. The existing
`TestFunctionRegisterRequest` covers nested list rejection and field paths, so
add cases proving a vector is accepted and that an unparsed nested vector
element is rejected at `elementType`; otherwise this newly enabled function API
path can regress unnoticed.
--
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]