Asking a question, there is a problem while sending e-commerce information to BigQuery in a csv file. In csv, the value of the ORDER_DATE column should go into the yyyy-MM-dd HH:mm:ss format in the DATETIME type column in the BigQuery, tried to find some references on Google.
Environment
- Apache NiFi 1.14.0 on Docker
Attempt1
Replacement Value Strategy was selected to Literal Value, and/ORDER_DATE was added as a new field. The value is as follows:
${field.value:toDate('yyyyMMddhhmmss','GMT'):format('yyyy-MM-dd hh:mm:ss', 'GMT')}
Attempt2
Found a new reference, that the NiFi expression was wrong, so I did another way:
${field.value:equals('0'):ifElse('', ${field.value:replace(${field.value},${field.value:toDate('yyyyMMddHHmmss'):format('yyyy-MM-dd HH:mm:ss'):toString()})})}
Someone asked me to open the log, checked and it's as follows:
java.lang.NumberFormatException: For input string: "2022-01-08 15:22:17"
Any ideas? Thank you :)





