KONEONE opened a new issue, #9973:
URL: https://github.com/apache/seatunnel/issues/9973

   ### Search before asking
   
   - [x] I had searched in the 
[feature](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22)
 and found no similar feature requirement.
   
   
   ### Description
   
   在kafka中,解析json字符串,比如:
   ```shell
   {“personInfo”:{"name":"kk","age":12}, "other":12}
   { "other":12}
   ```
   可以看出第1行有personInfo这个字段,第2行没有。但是在kafka的source的schema定义如下:
   ```shell
   personInfo = {
     name = string,
     age = int
   }
   other = int
   ```
   上面的定义没有什么问题。但是在transform的Sql转换的时候第二行却会出现问题, 比如query为
   ```shell 
   transform {
       Sql {
               plugin_input = "kafka_table"
               plugin_output = "out_table"
               query = """
                 select personInfo.name as personInfo_name from kafka_table
               """
           }
   }
   ```
   上面的代码会抛出异常。异常如下:
   ```shell 
   Caused by: 
org.apache.seatunnel.engine.common.exception.SeaTunnelEngineException: 
org.apache.seatunnel.transform.exception.TransformException: 
ErrorCode:[TRANSFORM_COMMON-06], ErrorDescription:[The expression 
'personInfo.name' of SQL transform execute failed]
           at 
org.apache.seatunnel.transform.exception.TransformCommonError.sqlExpressionError(TransformCommonError.java:79)
   ```
   具体的原因是第二行数据中,personInfo 是 null, 
在这个场景中,其实不应该抛出异常,而应该使用null进行填充即可。希望seatunnel能够加上这个嵌套解析的功能。
   
   ### Usage Scenario
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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