ying-hua opened a new issue, #10962:
URL: https://github.com/apache/inlong/issues/10962

   ### Description
   
   Currently, SQL statements of Json SourceData in Inlong transform only 
support selecting data from key-value pair structures such as 
   ```
   {
     "sid":"value1", 
     "msgs":[
       {"msg":"1001"},
       {"msg":"1002"}
     ]
   }
   ```
   However, it lacks the capability to select data from simple array structures 
like {"arr":[1,2,3]}.
   
   ### Use case
   
   ### case 1
   transformSql = "select $root.matrix(0)(1) from source"
   jsonString:
   ```
   {
     "matrix":[
       [1,2,3],
       [4,5,6],
       [7,8,9]
     ]
   }
   ```
   result: $root.matrix(0)(1)="2"
   
   ### case 2
   transformSql = "select $root.fruit(0) from source"
   jsonString:
   ```
   {
     "fruit":["apple", "banana"]
   }
   ```
   result: $root.fruit(0)="apple"
   
   ### case 3
   transformSql = "select $root.arr(1).id, $root.arr(2)(1) from source"
   jsonString:
   ```
   {
     "arr":[
       "value1",
       {"id":"1001"},
       [12,-3,25]
     ]
   }
   ```
   result: $root.arr(1).id = "1001", $root.arr(2)(1) = "-3"
   
   ### Are you willing to submit PR?
   
   - [X] 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