<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Cannot convert value [true] of type class java.lang.String to Object Array for field in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Cannot-convert-value-true-of-type-class-java-lang-String-to/m-p/384209#M245272</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It depends on how you are setting the UpdateRecord processor. If you can provide screenshot it will help us figure out the issue. It seems you are trying to overwrite the field SPRINT_LIST and its complaining that you cannot convert Array to String because its already an array in the first record. May I suggest a different approach because the UpdateRecord you have to worry about setting the Record Writer\Reader and also you have to define the avro schema accordingly if you are planning to add new fields. Instead you can just use the Json Jolt Transformation processor with the following spec:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "SPRINT_LIST": {
          "0": {
            "#true": "[&amp;amp;3].is_sprint_array"
          },
          "@": "[&amp;amp;2].SPRINT_LIST"
        },
        "*": "[&amp;amp;1].&amp;amp;"
      }
    }
  },
  {
    "operation": "default",
    "spec": {
      "*": {
        "is_sprint_array": "false"
      }
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;No need to set record reader\writer as long you know the input is always its valid json and has same schema. This will give you the following output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[ {
  "INTEGRATION_ID" : "1",
  "ISSUE_STATUS_CAT" : "Done",
  "SPRINT_LIST" : [ "24-w1-2", "24-w1-3", "24-w1-4" ],
  "is_sprint_array" : "true"
}, {
  "INTEGRATION_ID" : "2",
  "ISSUE_STATUS_CAT" : "Done",
  "SPRINT_LIST" : "24-w1-2",
  "is_sprint_array" : "false"
} ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that helps please &lt;STRONG&gt;accept&lt;/STRONG&gt; solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2024 19:10:50 GMT</pubDate>
    <dc:creator>SAMSAL</dc:creator>
    <dc:date>2024-02-28T19:10:50Z</dc:date>
    <item>
      <title>Cannot convert value [true] of type class java.lang.String to Object Array for field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Cannot-convert-value-true-of-type-class-java-lang-String-to/m-p/384205#M245268</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;I have JSON like following&lt;/P&gt;&lt;P&gt;[&lt;BR /&gt;{&lt;BR /&gt;"INTEGRATION_ID": "1",&lt;BR /&gt;"ISSUE_STATUS_CAT": "Done",&lt;BR /&gt;"SPRINT_LIST": [&lt;BR /&gt;"24-w1-2",&lt;BR /&gt;"24-w1-3",&lt;BR /&gt;"24-w1-4"&lt;BR /&gt;]&lt;BR /&gt;},{&lt;/P&gt;&lt;P&gt;"INTEGRATION_ID": "2",&lt;BR /&gt;"ISSUE_STATUS_CAT": "Done",&lt;BR /&gt;"SPRINT_LIST": "24-w1-2"&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;]&lt;/P&gt;&lt;P&gt;My requirement is to check whether SPRINT_LIST is array or not. so I am using &lt;STRONG&gt;UpdateRecord&lt;/STRONG&gt; processor with following formula&amp;nbsp;&lt;/P&gt;&lt;P&gt;${field.value:startsWith(" [ ")}&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I was getting the correct output earlier, where it returned 'True' when the value was a list and 'False' when it was null or not a list. However, after making some changes and then reverting back to the original settings, I started encountering issues. &lt;STRONG&gt;"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;Cannot convert value [true] of type class java.lang.String to Object Array for field error"&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 17:30:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Cannot-convert-value-true-of-type-class-java-lang-String-to/m-p/384205#M245268</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-02-28T17:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot convert value [true] of type class java.lang.String to Object Array for field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Cannot-convert-value-true-of-type-class-java-lang-String-to/m-p/384209#M245272</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It depends on how you are setting the UpdateRecord processor. If you can provide screenshot it will help us figure out the issue. It seems you are trying to overwrite the field SPRINT_LIST and its complaining that you cannot convert Array to String because its already an array in the first record. May I suggest a different approach because the UpdateRecord you have to worry about setting the Record Writer\Reader and also you have to define the avro schema accordingly if you are planning to add new fields. Instead you can just use the Json Jolt Transformation processor with the following spec:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "SPRINT_LIST": {
          "0": {
            "#true": "[&amp;amp;3].is_sprint_array"
          },
          "@": "[&amp;amp;2].SPRINT_LIST"
        },
        "*": "[&amp;amp;1].&amp;amp;"
      }
    }
  },
  {
    "operation": "default",
    "spec": {
      "*": {
        "is_sprint_array": "false"
      }
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;No need to set record reader\writer as long you know the input is always its valid json and has same schema. This will give you the following output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[ {
  "INTEGRATION_ID" : "1",
  "ISSUE_STATUS_CAT" : "Done",
  "SPRINT_LIST" : [ "24-w1-2", "24-w1-3", "24-w1-4" ],
  "is_sprint_array" : "true"
}, {
  "INTEGRATION_ID" : "2",
  "ISSUE_STATUS_CAT" : "Done",
  "SPRINT_LIST" : "24-w1-2",
  "is_sprint_array" : "false"
} ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that helps please &lt;STRONG&gt;accept&lt;/STRONG&gt; solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 19:10:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Cannot-convert-value-true-of-type-class-java-lang-String-to/m-p/384209#M245272</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-02-28T19:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot convert value [true] of type class java.lang.String to Object Array for field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Cannot-convert-value-true-of-type-class-java-lang-String-to/m-p/384227#M245279</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;, &lt;SPAN&gt;I tried using JOLT, but when it didn't work, I resorted to using the UpdateRecords process. However, this is ultimately what I need.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 08:58:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Cannot-convert-value-true-of-type-class-java-lang-String-to/m-p/384227#M245279</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-02-29T08:58:04Z</dc:date>
    </item>
  </channel>
</rss>

