I'm trying to execute the SQL command "Truncate Table". All the post I've seen recommand using PutSQL for that.
I've the error message :
ERROR
PutSQL[id=a154204d-016e-1000-d9c9-d0d79519e70e] Failed to update database for
[StandardFlowFileRecord[uuid=6c92c3bc-a219-4017-9641-dc4d21ab061a,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1574662524581-1, container=default, section=1], offset=3900, length=35],offset=0,name=6c92c3bc-a219-4017-9641-dc4d21ab061a,size=35]]
due to Query must be like 'INSERT INTO [db.]table [(c1, c2, c3)] VALUES (?, ?, ?)'.
Got: truncate table SBST.geographicalcat;
routing to failure: java.sql.SQLSyntaxErrorException: Query must be like 'INSERT INTO [db.]table [(c1, c2, c3)] VALUES (?, ?, ?)'.
Got: truncate table SBST.geographicalcat
I use all default parameters from NiFi 1.10 processor. I've try with the truncate query as constant in the SQL Statement parameter or this one empty and the SQL comming from the incoming flow file.
The database is Clickhouse, using last JDBC. The truncate command work when in the Pre-SQL of the ExecuteSQL processor. So NiFi and the JDBC should be able to run it.
The NiFi doc explain that PutSQL is only for INSERT or UPDATE. It look like PutSQL is not allowing anything else than Insert / Update, or is there a parameter that I should change ? Any other solution ?
