Sqoop : Truncate SQL Server table before exporting data from Hadoop

hadoop, sql-server, sqoop

Solution

Sqoop is not a general query tool, the "eval" functionality is provided only for evaluation purpose and should not be used in production mode. You can always put together simple java code that will do that in a way that is best for your use case.

Problem

We are using Sqoop to export data from the hive to SQL Server. The new data is always appended to the existing data in SQL Server. Is it possible to truncate the SQL Server table via Sqoop before starting the export?

Original source