The split-by argument defines the column based on which Sqoop splits work units.
Use the following syntax:
You can configure the split-by argument to improve the performance. If the primary key does not have an even distribution of values between the minimum and maximum range, you can configure the split-by argument to specify another column that has a balanced distribution of data to split the work units.
If you do not define the split-by column, Sqoop splits work units based on the following criteria:
If the data object contains a single primary key, Sqoop uses the primary key as the split-by column.
If the data object contains a composite primary key, Sqoop defaults to the behavior of handling composite primary keys without the split-by argument. See the Sqoop documentation for more information.
If the data object does not contain a primary key, the value of the m argument and num-mappers argument default to 1.
Rules and Guidelines for the split-by Argument
Consider the following restrictions when you configure the split-by argument:
If you configure the split-by argument and the split-by column contains NULL values, Sqoop does not import the rows that contain NULL values. However, the mapping runs successfully and no error is written in the YARN log.
If you configure the split-by argument and the split-by column contains special characters, the Sqoop import process fails.
The split-by argument is required in the following scenarios:
You use the Cloudera Connector Powered by Teradata or Hortonworks Connector for Teradata, and the Teradata table does not contain a primary key.
You create a custom query to override the default query when you import data from a Sqoop source.