[ 
https://issues.apache.org/jira/browse/NIFI-13828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17898628#comment-17898628
 ] 

Pierre Villard commented on NIFI-13828:
---------------------------------------

I tried to reproduce this issue and could not.

I assumed that you're using a JSON Writer. I'm selecting Name and CreatedDate 
for the Account object.

If not specifying a schema, I'll have the two fields as Strings.
{code:java}
[ {
  "Name" : "Edge Communications",
  "CreatedDate" : "2024-11-06T10:38:57.000+0000"
}, { ... {code}
If specifying a schema in the JSON Writer:
{code:java}
{
     "type": "record",
     "namespace": "account",
     "name": "account",
     "fields": [
       { "name": "Name", "type": "string", "doc": "First Name of Customer" },
       { "name": "CreatedDate", "type": { "type": "long", "logicalType": 
"timestamp-millis" } }
     ]
} {code}
I have the expected output:
{code:java}
[ {
  "Name" : "Edge Communications",
  "CreatedDate" : 1730889537000
}, { ... {code}
I'll close this JIRA for now. Please re-open with more details to reproduce the 
issue.

> QuerySalesforceObject failed to convert into a Record object with the given 
> schema
> ----------------------------------------------------------------------------------
>
>                 Key: NIFI-13828
>                 URL: https://issues.apache.org/jira/browse/NIFI-13828
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M2, 2.0.0-M3, 2.0.0-M4
>            Reporter: A G
>            Priority: Major
>
> For *Property Based Query* this error:
> 15:05:01 CEST  *ERROR* 
> QuerySalesforceObject[id=056a8969-0192-1000-c48e-a44646b4b985] Couldn't read 
> records from input: java.lang.RuntimeException: 
> org.apache.nifi.serialization.MalformedRecordException: Successfully parsed a 
> JSON object from input but failed to convert into a Record object with the 
> given schema - Caused by: 
> org.apache.nifi.serialization.MalformedRecordException: Successfully parsed a 
> JSON object from input but failed to convert into a Record object with the 
> given schema - Caused by: 
> org.apache.nifi.serialization.record.field.FieldConversionException: 
> Conversion failed for [2020-10-14T08:58:46.000+0000] named [CreatedDate] to 
> [java.time.LocalDateTime] [java.time.format.DateTimeParseException] Text 
> '2020-10-14T08:58:46.000+0000' could not be parsed at index 23



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to