You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/03/20 08:59:49 UTC

[GitHub] [camel-k] atcol opened a new issue #3129: Jsonata does not evaluate correctly

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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-k] atcol commented on issue #3129: Jsonata does not evaluate correctly

Posted by GitBox <gi...@apache.org>.
atcol commented on issue #3129:
URL: https://github.com/apache/camel-k/issues/3129#issuecomment-1076070452


   I have raised this issue on the JSONata library's Github [here](https://github.com/IBM/JSONata4Java/issues/189). 


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-k] squakez commented on issue #3129: Jsonata does not evaluate correctly

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #3129:
URL: https://github.com/apache/camel-k/issues/3129#issuecomment-1073824706


   It looks to me some possible problem with the Camel Jsonata component. I think you can get better support trying to reproduce the problem in plain Camel and check with [Camel support](https://camel.apache.org/community/support/).


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-k] atcol closed issue #3129: Jsonata does not evaluate correctly

Posted by GitBox <gi...@apache.org>.
atcol closed issue #3129:
URL: https://github.com/apache/camel-k/issues/3129


   


-- 
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: commits-unsubscribe@camel.apache.org

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