I tried executing the query below
"INSERT INTO " + schema + "." + fileName+" '(' id,name ')' VALUES (3,'abc')")
I am not sure whether Calcite supports UPSERT or not.
But I referred to the reference which shows different queries.
If it's not possible using Apache Calcite, then please let me know what other libraries I can use to perform UPSERT into a CSV file.