Howdy,

Given the jolt spec which I arrived at with the help I received in the
previous issue (flattening record schemas):

[
  {
    "operation": "shift",
    "spec": { "*": "record.&" }
  },
  {
    "operation": "shift",
    "spec": {
      "record": {
        "*": {
          "$": "TValue[#2].name",
          "@": "TValue[#2].value"
        }
      }
    }
  },
  {
    "operation": "default",
    "spec": { "TValue[]": { "*": { "class": "unclass" } } }
  }
]

and some input json that looks like this:

{
  "datetime": "2023-08-24 17:07:03.334170+00:00",
  "ShipId": 367375970,
  "Latitude": 44.09750833333333,
  "Longitude": -68.98625999999999,
  "Course": 275.1,
  "Speed": 11,
  "name": "",
  "draft": "",
  "dimensions": {
    "A": 192,
    "B": 32,
    "C": 13,
    "D": 19
  },
  "destination": "",
  "StatID": "",
  "Eta": {
    "Day": 15,
    "Hour": 6,
    "Minute": 0,
    "Month": 8
  }
}

I note that while the JOLT Demo page (
https://jolt-demo.appspot.com/#hashDefault) happily completes the
transform, JOLTTransformRecord process is not so happy, and gives errors
for either of the fields that have "records" as the value:

Cannot convert value [MapRecord[{A: 192,B: 32,C: 13,D: 19}]] of
CHOICE[STRING,RECORD] to Map for field dimensions because type is not
supported.

(n.b. if I blank out the value of the dimensions value [make it a null
string], I get a similar error message for the Eta field.)

Is the JOLT processor deliberately not handling something?
Is the JOLT demo absurdly generous about something?
Is there a way 'round?

thx,

mew

Reply via email to