I have a JSON like:
{
"id": 1
"create_time" : 1692617669
}
How can i convert this to yyyy-MM-dd HH:mm:ss
with GMT+3 timezone with UpdateRecord
?
I tried with ${field.value:multiply(1000):format("yyyy-MM-dd HH:mm:ss", "GMT+3")}
Bot got an error:
java.lang.NumberFormatException: For input string: "2023-07-20 16:28:28"
So i need to change data type to string - for this i should create new field. I tried with Record Path Value as Replacement Value Strategy
But got an error + invalid date:
Error:
java.lang.NumberFormatException: For input string: "1970-01-20 13:24:19"
How to deal with it?
I tried to replicate the same flow on my end
${field.value:multiply(1000):formatInstant("yyyy/MM/dd HH:mm:ss", "GMT+3")}
If you really need the file to be in Avro format then the following properties needs to be set.
{
"type": "record",
"name": "CustomRecord",
"fields": [
{
"name": "id",
"type": "int"
},
{
"name": "create_time",
"type": {
"type": "string",
"logicalType": "timestamp-millis"
}
}
]
}
The issue seems to be with the AvroRecordSetWriter probally with the Schema Inheritance.