You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/10/26 00:38:12 UTC

[GitHub] [pinot] Jackie-Jiang commented on a change in pull request #7631: Adjust field config

Jackie-Jiang commented on a change in pull request #7631:
URL: https://github.com/apache/pinot/pull/7631#discussion_r736059753



##########
File path: pinot-spi/src/main/java/org/apache/pinot/spi/config/table/FieldConfig.java
##########
@@ -44,20 +46,38 @@
 
   private final String _name;
   private final EncodingType _encodingType;
-  private final IndexType _indexType;
+  private final List<IndexType> _indexTypes;
   private final CompressionCodec _compressionCodec;
   private final Map<String, String> _properties;
 
+  @Deprecated
+  public FieldConfig(String name,
+      EncodingType encodingType,
+      IndexType indexType,
+      CompressionCodec compressionCodec,
+      Map<String, String> properties) {
+    this(name, encodingType, indexType, null, compressionCodec, properties);
+  }
+
+  public FieldConfig(String name,
+      EncodingType encodingType,
+      List<IndexType> indexTypes,
+      CompressionCodec compressionCodec,
+      Map<String, String> properties) {
+    this(name, encodingType, null, indexTypes, compressionCodec, properties);
+  }
+
   @JsonCreator
   public FieldConfig(@JsonProperty(value = "name", required = true) String name,
       @JsonProperty(value = "encodingType") @Nullable EncodingType encodingType,
       @JsonProperty(value = "indexType") @Nullable IndexType indexType,
+      @JsonProperty(value = "indexTypes") @Nullable List<IndexType> indexTypes,
       @JsonProperty(value = "compressionCodec") @Nullable CompressionCodec compressionCodec,
       @JsonProperty(value = "properties") @Nullable Map<String, String> properties) {
     Preconditions.checkArgument(name != null, "'name' must be configured");
     _name = name;
     _encodingType = encodingType;
-    _indexType = indexType;
+    _indexTypes = indexTypes == null ? Lists.newArrayList(indexType) : indexTypes;

Review comment:
       We don't want to have a single element `null` as `_indexTypes` when both `indexType` and `indexTypes` are null.
   I'd recommend having `_indexTypes` never `null`, but can be empty.




-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org