Configuring custom Beeline arguments

Learn how to configure Sqoop to enable users to include additional Beeline arguments while importing data into Hive using Sqoop.

You can configure the required property either through Cloudera Manager or by using the --beeline-args argument in your Sqoop import command.
Order of precedence
The configuration set through the Sqoop argument in the command line takes precedence over the configuration specified through Cloudera Manager. If custom Beeline arguments are specified through both the command line and Cloudera Manager, the command line Sqoop argument overwrites the Cloudera Manager configuration.
You must be aware of certain Beeline arguments that cannot be specified. This limitation ensures the integrity and proper functioning of Sqoop's core processes. The following Beeline arguments are not supported:
  • -e
  • -f
  • -n
  • -p
  • -w
  • --password-file
  • -a (if the HADOOP_TOKEN_FILE_LOCATION is not specified)
  1. If you are specifying the custom Beeline arguments through Cloudera Manager, perform the following steps:
    1. In Cloudera Manager, click Clusters and then select the SQOOP_CLIENT-1 service.
    2. From the Sqoop service, go to the Configuration tab and search for sqoop.beeline-args.
    3. Click and specify the custom Beeline argument and its value.

      Configuring custom Beeline arguments for Sqoop Hive import
    4. Click Save Changes.
  2. If you are specifying the custom Beeline arguments through the Sqoop argument, specify the required argument using the --beeline-args argument while constructing the Sqoop import command.
    /opt/cloudera/parcels/CDH/bin/sqoop import \
      -Dsqoop.beeline.env.preserve=KRB5CCNAME \
      --connection-manager org.apache.sqoop.manager.MySQLManager \
      --connect jdbc:mysql:// \
      --username [***USERNAME***] \
      --password [***PASSWORD***] \
      --table employees \
      --warehouse-dir /user/hrt_qa/test-sqoop \
      --hive-import \
      --delete-target-dir \
      --hive-overwrite \
      --beeline-args -i init_file2.txt --hivevar tablename=mytable2 -r