gharris1727 commented on code in PR #13184:
URL: https://github.com/apache/kafka/pull/13184#discussion_r1103295046


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/ConnectorConfig.java:
##########
@@ -270,28 +270,28 @@ public boolean includeRecordDetailsInErrorLog() {
     /**
      * Returns the initialized list of {@link Transformation} which are 
specified in {@link #TRANSFORMS_CONFIG}.
      */
-    public <R extends ConnectRecord<R>> List<Transformation<R>> 
transformations() {
+    public <R extends ConnectRecord<R>> List<TransformationStage<R>> 
transformations() {
         final List<String> transformAliases = getList(TRANSFORMS_CONFIG);
 
-        final List<Transformation<R>> transformations = new 
ArrayList<>(transformAliases.size());
+        final List<TransformationStage<R>> transformations = new 
ArrayList<>(transformAliases.size());
         for (String alias : transformAliases) {
             final String prefix = TRANSFORMS_CONFIG + "." + alias + ".";
 
             try {
                 @SuppressWarnings("unchecked")
                 final Transformation<R> transformation = 
Utils.newInstance(getClass(prefix + "type"), Transformation.class);
                 Map<String, Object> configs = originalsWithPrefix(prefix);
-                Object predicateAlias = 
configs.remove(PredicatedTransformation.PREDICATE_CONFIG);
-                Object negate = 
configs.remove(PredicatedTransformation.NEGATE_CONFIG);
+                Object predicateAlias = 
configs.remove(TransformationStage.PREDICATE_CONFIG);
+                Object negate = 
configs.remove(TransformationStage.NEGATE_CONFIG);
                 transformation.configure(configs);
                 if (predicateAlias != null) {

Review Comment:
   Yeah not related but it seems like a tiny change that we could include.
   If someone explicitly provided predicate = `""`, the behavior would be:
   1. this check passes
   2. the predicatePrefix would be `predicates..`
   3. It would look for `predicates..type` containing a classname
   4. It would configure the predicate with `predicates..*` prefixed configs.
   
   I think _technically_ an empty predicate name is functional, and could exist 
out there in the wild.
   It would be very silly, however.
   
   I think this means that it's more correct to change the default to `null`? 
It won't have a behavior change, but will prevent a bug if we ever used the 
parsed configs here.
   I'll make the change.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to