You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "hipotures (Jira)" <ji...@apache.org> on 2020/12/07 17:09:00 UTC

[jira] [Updated] (NIFI-8076) ConvertRecord - Can't redefine

     [ https://issues.apache.org/jira/browse/NIFI-8076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

hipotures updated NIFI-8076:
----------------------------
    Description: 
{color:#172b4d}ConvertRecord processor with settings{color}
 {color:#172b4d}  Record Reader: JsonTreeReader (with Infer Schema){color}
 {color:#172b4d}  Record Writer: AvroRecordSetWriter (with Embed Avro Schema){color}
 Problem with two fields with name *attributes*.
{noformat}
ConvertRecord[id=dc0f47e8-0175-1000-9f2c-184ff602c868] Failed to process StandardFlowFileRecord[uuid=5d1699a9-cde5-472b-a78b-79a155f3c4b2,claim=StandardContentClaim 
 [resourceClaim=StandardResourceClaim[id=1607356761339-4176, container=default, section=80], offset=454572, length=7824],offset=4958,name=e4a67bb4-68b5-4ca7-8967-6f68f94e9874,size=865]; 
 will route to failure: Can't redefine: org.apache.nifi.attributesType{noformat}
Example below (paths *$.agreement.attributes* and *$.plans[0].attributes*)

Input JSON
{code:java}
{
   "agreement":{
      "id":"6e07e04d-d644-bf76-f30f-ce648da478e0",
      "type":"agreement",
      "attributes":{
         "code":"16-00-04332-20-01",
         "origin_code":"07-19-305",
         "service_type":"07",
         "service_name":"Leczenie stomatologiczne",
         "amount":112500.0,
         "updated_at":"2019-12-13T08:39:20",
         "provider_code":"160004332",
         "provider_name":"ISP STOMATOLOGICZNA JANUSZ KUBRAK",
         "provider_place":"SZCZECIN",
         "year":2020,
         "branch":"16"
      },
      "links":null
   },
   "plans":[
      {
         "id":"e040eca0-ab80-5823-8ab7-0333d2063159",
         "type":"agreement-plan",
         "attributes":{
            "product_code":"07.0000.214.02",
            "product_name":"ŚWIADCZENIA PROTETYKI STOMATOLOGICZNEJ",
            "order":1,
            "unit_count":90000.0,
            "price":112500.0,
            "avg_price":1.25
         },
         "links":{
            "related":"https://api.nfz.gov.pl/app-umw-api/plans/e040eca0-ab80-5823-8ab7-0333d2063159?format=json"
         }
      }
   ],
   "orthopedic_supplies":[
      
   ]
}{code}
Workaround: JoltTransformationJSON shift:
{code:java}
{
   "agreement":{
      "attributes":"agreement.attr",
      "*":"agreement.&"
   },
   "*":"&"
}{code}
 

  was:
{color:#172b4d}ConvertRecord processor with settings{color}
{color:#172b4d}  Record Reader: JsonTreeReader (with Infer Schema){color}
{color:#172b4d}  Record Writer: AvroRecordSetWriter (with Embed Avro Schema){color}
Problem with two fields with name *attributes*.
{noformat}
ConvertRecord[id=dc0f47e8-0175-1000-9f2c-184ff602c868] Failed to process StandardFlowFileRecord[uuid=5d1699a9-cde5-472b-a78b-79a155f3c4b2,claim=StandardContentClaim 
 [resourceClaim=StandardResourceClaim[id=1607356761339-4176, container=default, section=80], offset=454572, length=7824],offset=4958,name=e4a67bb4-68b5-4ca7-8967-6f68f94e9874,size=865]; 
 will route to failure: Can't redefine: org.apache.nifi.attributesType{noformat}

Example below (paths *$.agreement.attributes* and *$.plans[0].attributes*)

Input JSON
{code:java}
{
 "agreement" : {
 "id" : "6e07e04d-d644-bf76-f30f-ce648da478e0",
 "type" : "agreement",
 "attributes" : {
 "code" : "16-00-04332-20-01",
 "origin_code" : "07-19-305",
 "service_type" : "07",
 "service_name" : "Leczenie stomatologiczne",
 "amount" : 112500.0,
 "updated_at" : "2019-12-13T08:39:20",
 "provider_code" : "160004332",
 "provider_name" : "ISP STOMATOLOGICZNA JANUSZ KUBRAK",
 "provider_place" : "SZCZECIN",
 "year" : 2020,
 "branch" : "16"
 },
 "links" : null
 },
 "plans" : [ {
 "id" : "e040eca0-ab80-5823-8ab7-0333d2063159",
 "type" : "agreement-plan",
 "attributes" : {
 "product_code" : "07.0000.214.02",
 "product_name" : "ŚWIADCZENIA PROTETYKI STOMATOLOGICZNEJ",
 "order" : 1,
 "unit_count" : 90000.0,
 "price" : 112500.0,
 "avg_price" : 1.25
 },
 "links" : {
 "related" : "https://api.nfz.gov.pl/app-umw-api/plans/e040eca0-ab80-5823-8ab7-0333d2063159?format=json"
 }
 } ],
 "orthopedic_supplies" : [ ]
}{code}


Workaround: JoltTransformationJSON shift:
{code:java}
{
 "agreement": {
 "attributes": "agreement.attr",
 "*": "agreement.&"
 },
 "*": "&"
}{code}
 


> ConvertRecord - Can't redefine
> ------------------------------
>
>                 Key: NIFI-8076
>                 URL: https://issues.apache.org/jira/browse/NIFI-8076
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.12.1
>         Environment: 18.04.1-Ubuntu
>            Reporter: hipotures
>            Priority: Major
>
> {color:#172b4d}ConvertRecord processor with settings{color}
>  {color:#172b4d}  Record Reader: JsonTreeReader (with Infer Schema){color}
>  {color:#172b4d}  Record Writer: AvroRecordSetWriter (with Embed Avro Schema){color}
>  Problem with two fields with name *attributes*.
> {noformat}
> ConvertRecord[id=dc0f47e8-0175-1000-9f2c-184ff602c868] Failed to process StandardFlowFileRecord[uuid=5d1699a9-cde5-472b-a78b-79a155f3c4b2,claim=StandardContentClaim 
>  [resourceClaim=StandardResourceClaim[id=1607356761339-4176, container=default, section=80], offset=454572, length=7824],offset=4958,name=e4a67bb4-68b5-4ca7-8967-6f68f94e9874,size=865]; 
>  will route to failure: Can't redefine: org.apache.nifi.attributesType{noformat}
> Example below (paths *$.agreement.attributes* and *$.plans[0].attributes*)
> Input JSON
> {code:java}
> {
>    "agreement":{
>       "id":"6e07e04d-d644-bf76-f30f-ce648da478e0",
>       "type":"agreement",
>       "attributes":{
>          "code":"16-00-04332-20-01",
>          "origin_code":"07-19-305",
>          "service_type":"07",
>          "service_name":"Leczenie stomatologiczne",
>          "amount":112500.0,
>          "updated_at":"2019-12-13T08:39:20",
>          "provider_code":"160004332",
>          "provider_name":"ISP STOMATOLOGICZNA JANUSZ KUBRAK",
>          "provider_place":"SZCZECIN",
>          "year":2020,
>          "branch":"16"
>       },
>       "links":null
>    },
>    "plans":[
>       {
>          "id":"e040eca0-ab80-5823-8ab7-0333d2063159",
>          "type":"agreement-plan",
>          "attributes":{
>             "product_code":"07.0000.214.02",
>             "product_name":"ŚWIADCZENIA PROTETYKI STOMATOLOGICZNEJ",
>             "order":1,
>             "unit_count":90000.0,
>             "price":112500.0,
>             "avg_price":1.25
>          },
>          "links":{
>             "related":"https://api.nfz.gov.pl/app-umw-api/plans/e040eca0-ab80-5823-8ab7-0333d2063159?format=json"
>          }
>       }
>    ],
>    "orthopedic_supplies":[
>       
>    ]
> }{code}
> Workaround: JoltTransformationJSON shift:
> {code:java}
> {
>    "agreement":{
>       "attributes":"agreement.attr",
>       "*":"agreement.&"
>    },
>    "*":"&"
> }{code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)