damccorm commented on code in PR #31172:
URL: https://github.com/apache/beam/pull/31172#discussion_r1594853381


##########
sdks/java/managed/src/main/java/org/apache/beam/sdk/managed/ManagedSchemaTransformProvider.java:
##########
@@ -202,7 +203,26 @@ Row getConfigurationRow() {
   static Row getRowConfig(ManagedConfig config, Schema transformSchema) {
     // May return an empty row (perhaps the underlying transform doesn't have 
any required
     // parameters)
-    return YamlUtils.toBeamRow(config.resolveUnderlyingConfig(), 
transformSchema, false);
+    String yamlConfig = config.resolveUnderlyingConfig();
+    Map<String, Object> configMap = YamlUtils.yamlStringToMap(yamlConfig);
+
+    // The config Row object will be used to build the underlying 
SchemaTransform.
+    // If a mapping for the SchemaTransform exists, we use it to update 
parameter names and align
+    // with the underlying config schema
+    Map<String, String> mapping = 
MAPPINGS.get(config.getTransformIdentifier());
+    if (mapping != null && configMap != null) {
+      Map<String, Object> remappedConfig = new HashMap<>();
+      for (Map.Entry<String, Object> entry : configMap.entrySet()) {
+        String paramName = entry.getKey();
+        if (mapping.containsKey(paramName)) {

Review Comment:
   Right now any parameters that aren't recognized are silently dropped. I 
think we should be at least warning here.



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

Reply via email to