Jackie-Jiang commented on code in PR #18412:
URL: https://github.com/apache/pinot/pull/18412#discussion_r3203394656


##########
pinot-spi/src/main/java/org/apache/pinot/spi/config/table/FieldConfig.java:
##########
@@ -111,12 +117,10 @@ public FieldConfig(@JsonProperty(value = "name", required 
= true) String name,
     Preconditions.checkArgument(name != null, "'name' must be configured");
     _name = name;
     _encodingType = encodingType == null ? EncodingType.DICTIONARY : 
encodingType;
-    _indexTypes =
-        indexTypes != null ? indexTypes : (indexType == null ? 
Lists.newArrayList() : Lists.newArrayList(indexType));
     _compressionCodec = compressionCodec;
     _timestampConfig = timestampConfig;
     _properties = properties;
-    _indexes = indexes == null ? NullNode.getInstance() : indexes;
+    _indexes = normalizeIndexes(name, indexType, indexTypes, indexes);

Review Comment:
   Normalizing in constructor could be potentially expensive. We load 
`TableConfig` everywhere, but only very few uses FieldConfig. Normalizing 
during usage should be better.
   
   For new/updated table configs, we can normalize before writing to ZK



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