This is an automated email from the ASF dual-hosted git repository.

jlli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 4bfa6ee989 Make Custom Config Optional (#14014)
4bfa6ee989 is described below

commit 4bfa6ee989feccf2c475c11783e88633e5a41c09
Author: ashishjayamohan <46698969+ashishjayamo...@users.noreply.github.com>
AuthorDate: Mon Sep 23 14:19:01 2024 -0700

    Make Custom Config Optional (#14014)
    
    * make custom config optional and change key
    
    * move customConfig to optional params
    
    * add nullity check
    
    * change custom config key back to metadata
    
    * remove test diff
    
    * reorder config fields
    
    * remove random tar file
    
    ---------
    
    Co-authored-by: Ashish Jayamohan <ashishjayamo...@ashishs-mbp.attlocal.net>
    Co-authored-by: Ashish Jayamohan <ashishjayamohan@Ashishs-MacBook-Pro.local>
---
 .../java/org/apache/pinot/spi/config/table/TableConfig.java  | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git 
a/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/TableConfig.java 
b/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/TableConfig.java
index 9e72b8b76d..4304533cfb 100644
--- a/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/TableConfig.java
+++ b/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/TableConfig.java
@@ -77,11 +77,10 @@ public class TableConfig extends BaseJsonConfig {
   private TenantConfig _tenantConfig;
   private IndexingConfig _indexingConfig;
 
-  // TODO: Make TableCustomConfig optional and use another key other than 
'metadata'
-  private TableCustomConfig _customConfig;
-
   /* OPTIONAL FIELDS */
 
+  private TableCustomConfig _customConfig;
+
   @JsonPropertyDescription("Resource quota associated with this table")
   private QuotaConfig _quotaConfig;
 
@@ -96,7 +95,7 @@ public class TableConfig extends BaseJsonConfig {
   private Map<String, SegmentAssignmentConfig> _segmentAssignmentConfigMap;
   private List<FieldConfig> _fieldConfigList;
 
-  @JsonPropertyDescription(value = "upsert related config")
+  @JsonPropertyDescription(value = "Upsert related config")
   private UpsertConfig _upsertConfig;
 
   @JsonPropertyDescription(value = "Dedup related config")
@@ -121,7 +120,7 @@ public class TableConfig extends BaseJsonConfig {
       SegmentsValidationAndRetentionConfig validationConfig,
       @JsonProperty(value = TENANT_CONFIG_KEY, required = true) TenantConfig 
tenantConfig,
       @JsonProperty(value = INDEXING_CONFIG_KEY, required = true) 
IndexingConfig indexingConfig,
-      @JsonProperty(value = CUSTOM_CONFIG_KEY, required = true) 
TableCustomConfig customConfig,
+      @JsonProperty(value = CUSTOM_CONFIG_KEY) TableCustomConfig customConfig,
       @JsonProperty(QUOTA_CONFIG_KEY) @Nullable QuotaConfig quotaConfig,
       @JsonProperty(TASK_CONFIG_KEY) @Nullable TableTaskConfig taskConfig,
       @JsonProperty(ROUTING_CONFIG_KEY) @Nullable RoutingConfig routingConfig,
@@ -147,7 +146,6 @@ public class TableConfig extends BaseJsonConfig {
     Preconditions.checkArgument(validationConfig != null, "'segmentsConfig' 
must be configured");
     Preconditions.checkArgument(tenantConfig != null, "'tenants' must be 
configured");
     Preconditions.checkArgument(indexingConfig != null, "'tableIndexConfig' 
must be configured");
-    Preconditions.checkArgument(customConfig != null, "'metadata' must be 
configured");
 
     // NOTE: Handle lower case table type and raw table name for 
backward-compatibility
     _tableType = TableType.valueOf(tableType.toUpperCase());
@@ -245,7 +243,7 @@ public class TableConfig extends BaseJsonConfig {
 
   @JsonProperty(CUSTOM_CONFIG_KEY)
   public TableCustomConfig getCustomConfig() {
-    return _customConfig;
+    return (_customConfig == null) ? new TableCustomConfig(Map.of()) : 
_customConfig;
   }
 
   public void setCustomConfig(TableCustomConfig customConfig) {


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

Reply via email to