Cyanty commented on issue #9936:
URL: https://github.com/apache/seatunnel/issues/9936#issuecomment-3400175496

   I've located the root cause. SeaTunnel's shaded config module 
(seatunnel-config-shade) has custom parsing logic. When a HOCON file defines a 
field named `source`, `ConfigParser.ParseContext#parseObjectForSeaTunnel` 
method resolves it as `ConfigList` instead of `ConfigObject`. This leads to an 
NPE in the downstream field mapping.
   Recommendation: Avoid using reserved keywords (source, transform, sink) as 
field names in the `schema` to prevent this parsing, the exception can be 
resolved by renaming the `source`, for example:
   ```
       c_source = {
         name = "string"
         link = "string"
       }
   ```
   Or, add `JsonPath` transformation after the original configuration, for 
example:
   ```
   source {
     ...
        fields = {   
          organization_id = "string" 
          source = "string"
        }
     ...
   }
   
   transform {
     JsonPath {
       plugin_input = "kafka_table"
       plugin_output = "trans_json_path"
       columns = [
         {
           src_field = "source"
           path = ["$.name", "$.link"]
           dest_field = ["source_name", "source_link"]
           dest_type = ["string", "string"]
         }
       ]
     }
     Sql {
       plugin_input = "trans_json_path"
       plugin_output = "trans_table"
       query = "select organization_id, source_name, source_link from dual"
     }
   }
   ```


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