Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

UpdateRecord won't update nested fields


UpdateRecord won't update nested fields

New Contributor

I have this XML file:

        <firstName>Some</firstName> <!-- required -->
        <lastName>Guy</lastName> <!-- required -->
        <email></email> <!-- required if phone not included -->
        <phone></phone> <!-- required if email not included -->

Using this schema

    "namespace": "com.organization.somethingspecific",
    "name": "request",
    "type": "record",
    "fields": [
      {"name": "requestType", "type": ["string","null"], "default": null},
      {"name": "requestDomainType", "type": ["string","null"], "default": null},
      {"name": "systemName", "type": ["string","null"], "default": null},
      {"name": "location", "type": ["string","null"], "default": null},
      {"name": "userInformation", "type": ["null", {
        "name": "userInformation", "type": "array", "items": {
          "name": "userInformation", "type": "record", "fields": [
            {"name": "userId", "type": ["string","null"], "default": null},
            {"name": "firstName", "type": ["string","null"], "default": null},
            {"name": "lastName", "type": ["string","null"], "default": null},
            {"name": "email", "type": ["string","null"], "default": null},
            {"name": "phone", "type": ["string","null"], "default": null}
      }], "default": null},
      {"name": "requestObject", "type": ["null",{
        "name": "requestObject", "type": "array", "items": {
          "name": "requestObject", "type": "record", "fields": [
            {"name": "startDate", "type": ["string","null"], "default": null},
            {"name": "endDate", "type": ["string","null"], "default": null},
            {"name": "type", "type": ["string","null"], "default": null}
      }], "default": null}

I am confident that the schema is correct because I am able to convert from XML to JSON no problem.

However UpdateRecord is not able to alter nested fields no matter how I reference them. I have the following UpdateRecord processor:


At the very least I would expect //startDate to work since that is SUPPOSED to ignore hierarchy, but I can only update top level fields such as /requestType which is the only one that actually updates of the 4 in my configuration.

I am following the documentation exactly, what else could be wrong? Any help appreciated.


Re: UpdateRecord won't update nested fields

New Contributor

Was able to solve this by removing my usage of arrays from my schema

Re: UpdateRecord won't update nested fields

Rising Star

Hi @Andrew Riffle it looks like I'm facing the same problem.

I dont't understand your remark concering your solution.

You deleted the "array"-line from your schema and then it worked OR you don't work with an array anymore?

Could you please make this clear? Thanks!