bazaarvoice / jolt

JSON to JSON transformation library written in Java.
Apache License 2.0
1.54k stars 328 forks source link

How to add single quote in concat function #1209

Open Gyanaranjan1993 opened 1 year ago

Gyanaranjan1993 commented 1 year ago

How do I be able to add a single quote in the middle of string through concat function?

Sample Input

 [ 
 {
       "PhysicalId": "220000110147"
  }
 ]

Expected O/P :

    {
        "carrierId_lookup" : "select id from carrier where physicalId = '220000110147' "
   }

Spec:

[
 "operation": "modify-default-beta"
 "spec": {
        "*": {
            "carrierId_lookup": "=concat('SELECT c.id FROM Carrier c WHERE c.physicalId=', @(1,physicalId)) "
          }
     }
]

Actual O/P:

    {
        "carrierId_lookup" : "select id from carrier where physicalId =220000110147"
   }