Hi,
What is the right way to deal with dates in the following context.
I'm using the updaterecord processor to add a datestamp field to a record
(derived from a filename attribute inserted by the getfile processor).
/Visit_DateTime.
${filename:substringBeforeLast('.'):substringAfterLast('_'):toDate('yyyyMMdd'):format('yyyy-MM-dd'T'HH:mm:ss'Z'")
Inside the groovy script I'm attempting to convert to date as follows:
VisitTimeValue = new Date(currRecord.get(Visit_DateTime as String))
However I always get messages about "could not find matching constructor
for java.util.Date(org.apackge.avro.util.Utf8)"
I have a previously working version, from a slightly different context
which did a cast to long: Date((long)currRecord.get....). In that case the
record was created by a database query.
The eventual use of VisitTimeValue is to dump it into a flowfile attribute.
It seems to me that the type of the date field is not being correctly
inferred by the avro reader/writers after I create it with the expression
language. Alternatively, perhaps I should be using different date handling
tools inside groovy.
All advice welcome.
Thanks