ahmedabu98 commented on code in PR #31172:
URL: https://github.com/apache/beam/pull/31172#discussion_r1595683176
##########
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:
The mapping contains parameter names that should be updated. If a parameter
is not included in the mapping, we assume its original name is correct.
But agreed some logging would be helpful. I'll add a log showing the final
Row configuration used to build the underlying transform
--
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]