Copilot commented on code in PR #18973:
URL: https://github.com/apache/pinot/pull/18973#discussion_r3563469366


##########
pinot-plugins/pinot-input-format/pinot-avro-base/src/test/java/org/apache/pinot/plugin/inputformat/avro/AvroSchemaUtilTest.java:
##########
@@ -60,6 +58,17 @@ public void 
testToAvroSchemaJsonObjectRejectsUnsupportedType() {
         () -> AvroSchemaUtil.toAvroSchemaJsonObject(new 
DimensionFieldSpec("col", DataType.BIG_DECIMAL, true)));
   }
 
+  /// A UUID column is represented faithfully as an Avro string annotated with 
logicalType "uuid". The recommender
+  /// pipeline only ever emits single-value fields (see 
`DataGenerator#buildSpec`), matching every sibling case.

Review Comment:
   The comment says the recommender pipeline "only ever emits single-value 
fields", but `DataGenerator` can emit multi-value lists when `mvCountMap` is 
provided; `DataGenerator#buildSpec` only marks the Pinot `FieldSpec` as 
single-value. Consider rewording to avoid implying the generated data values 
are always single-valued.



##########
pinot-controller/src/main/java/org/apache/pinot/controller/recommender/data/generator/UuidGenerator.java:
##########
@@ -0,0 +1,75 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.controller.recommender.data.generator;
+
+import com.google.common.annotations.VisibleForTesting;
+import java.util.Random;
+import java.util.UUID;
+
+
+/// Generates canonical RFC-4122 UUID strings for a column of type UUID. UUID 
is a logical type whose recommender Avro
+/// schema is a `string` annotated with `logicalType: uuid` (see 
`AvroSchemaUtil#toAvroSchemaJsonObject`), so the
+/// generated value is the canonical string form and the writer serializes it 
directly.
+///
+/// The number of distinct values is bounded by the requested cardinality: a 
fixed random high-order half is combined
+/// with a low-order counter that cycles `[1, cardinality]`, mirroring 
`StringGenerator`. Values are not RFC-4122
+/// version-4 (the version/variant bits are not set), which is irrelevant for 
sample data — they remain
+/// canonically-formatted, parseable UUID strings.

Review Comment:
   `UuidGenerator` claims to generate "RFC-4122 UUID strings" but also states 
the version/variant bits are not set. Without setting those bits, the produced 
UUIDs are not RFC-4122-compliant even though they are parseable/canonical 
strings. Please reword the class-level comment (or set the RFC-4122 bits) to 
avoid contradictory documentation.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to