atcol opened a new issue #3129:
URL: https://github.com/apache/camel-k/issues/3129


   With this Kotlin Route:
   
   ```
   import java.io.File
   import java.io.BufferedReader
   
   from("timer://example?fixedRate=true&delay=0&period=30000")
     .process { ex -> 
       val out = ex.getOut()
       out.setBody("""
         
{"updated":1647700323000,"columns":["a","b","c","d","e"],"items":[[24,77,326,136284,47520]]}
         """)
     }
     
.to("jsonata:file:/etc/camel/resources/transform.spec?inputType=JsonString&outputType=JsonString")
     .log("result \${body}")
   ```
   
   and this Jsonata spec (mounted as `transform.spec`):
   
   ```jsonata
   items.{
       "a": $[0],
       "b": $[1],
       "c": $[2],
       "d": $[3],
       "e": $[4],
       "f": $[2] - $[1]
   }
   ```
   
   I would expect this output (confirmed at 
[https://try.jsonata.org/BBnjH5TcA](https://try.jsonata.org/BBnjH5TcA)): 
   
   ```json
   [
     {
       "a": 24,
       "b": 77,
       "c": 326,
       "d": 136284,
       "e": 47520,
       "f": 249
     }
   ]
   ```
   
   but instead I get:
   
   ```json
   [{"a":24}]
   ```
   
   i.e. only one field ("a") is produced in the result array.
   
   I run this with:
   
   ```bash
   $ ./kamel run --dev --resource file:transform.spec example.kts
   ```
   
   My versions are:
   
   Camel-k: 
   ```bash
   ./kamel version
   Camel K Client 1.8.2
   ```
   
   Camel-k Operator:
   ```bash
   ❯ k logs camel-k-operator-7ddc44d878-kvh8t | head
   {"level":"info","ts":1647702396.0014236,"logger":"cmd","msg":"maxprocs: 
Leaving GOMAXPROCS=[8]: CPU quota undefined"}
   {"level":"info","ts":1647702396.0014446,"logger":"cmd","msg":"Go Version: 
go1.16"}
   {"level":"info","ts":1647702396.0014472,"logger":"cmd","msg":"Go OS/Arch: 
linux/amd64"}
   {"level":"info","ts":1647702396.0014489,"logger":"cmd","msg":"Buildah 
Version: 1.14.0"}
   {"level":"info","ts":1647702396.0014505,"logger":"cmd","msg":"Kaniko 
Version: 0.17.1"}
   {"level":"info","ts":1647702396.0014522,"logger":"cmd","msg":"Camel K 
Operator Version: 1.8.2"}
   {"level":"info","ts":1647702396.001454,"logger":"cmd","msg":"Camel K Default 
Runtime Version: 1.12.0"}
   {"level":"info","ts":1647702396.0014558,"logger":"cmd","msg":"Camel K Git 
Commit: c81d73f91eaf400907427e661373ab061ff26ba1"}
   ```
   
   


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