lnbest0707-uber commented on code in PR #14772:
URL: https://github.com/apache/pinot/pull/14772#discussion_r1907603974


##########
pinot-spi/src/main/java/org/apache/pinot/spi/config/table/ingestion/IngestionConfig.java:
##########
@@ -49,10 +52,19 @@ public class IngestionConfig extends BaseJsonConfig {
   private ComplexTypeConfig _complexTypeConfig;
 
   @JsonPropertyDescription("Config related to the SchemaConformingTransformer")
+  @JsonProperty("schemaConformingTransformerConfig")
   private SchemaConformingTransformerConfig _schemaConformingTransformerConfig;
 
-  @JsonPropertyDescription("Config related to the 
SchemaConformingTransformerV2")
-  private SchemaConformingTransformerV2Config 
_schemaConformingTransformerV2Config;
+  @JsonPropertyDescription("Config related to the 
SchemaConformingTransformerV2 (backward compatibility)")
+  @JsonProperty("schemaConformingTransformerV2Config")
+  private void setSchemaConformingTransformerV2Config(JsonNode 
schemaConformingTransformerV2Config) {
+    // Map _schemaConformingTransformerV2Config JSON into 
SchemaConformingTransformerConfig
+    if (schemaConformingTransformerV2Config != null && 
_schemaConformingTransformerConfig == null) {
+      ObjectMapper objectMapper = new ObjectMapper();
+      _schemaConformingTransformerConfig =
+          objectMapper.convertValue(schemaConformingTransformerV2Config, 
SchemaConformingTransformerConfig.class);
+    }
+  }

Review Comment:
   > All we need to do is mapping both key to the same property right?
   
   Yes, but would the suggested change work in the same way?
   In which case, the 
`setSchemaConformingTransformerV2Config(SchemaConformingTransformerConfig 
schemaConformingTransformerConfig)` would be called? I thought when 
   ```
   {"schemaConformingTransformerV2Config" : {...}}
   ```
   appears in Json, it would internally trigger 
`setSchemaConformingTransformerV2Config(JsonNode 
schemaConformingTransformerV2Config)` only (JsonNode as type).
   I need eventually the above json could create the 
`schemaConformingTransformerConfig` object.



-- 
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-unsubscr...@pinot.apache.org

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


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

Reply via email to