Providing the Hive password through a prompt

Use the -promptHivePassword argument in the Sqoop import command to prompt users to enter the Hive password manually in the command-line for Sqoop-Hive import processes when LDAP authentication is enabled.

  1. Specify the -promptHivePassword 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.PostgresqlManager \
      --connect "jdbc:postgresql://db.foo.com:5432/employees" \
      --username [***USERNAME***] \
      --password [***PASSWORD***] \
      --table employees \
      --warehouse-dir \
      /user/hrt_qa/test-sqoop \
      --hive-import \
      --delete-target-dir \
      --hive-overwrite \
      --external-table-dir hdfs:///warehouse/tablespace/external/hive/employees \
      --hs2-url "jdbc:hive2://[***HOST***]:[***PORT***];serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;transportMode=http;httpPath=cliservice;ssl=true;sslTrustStore=[***TRUSTSTORE PATH***];trustStorePassword=[***TRUSTSTORE PASSWORD***]" \
      --hive-user guest \
      -promptHivePassword \
      -m 1
  2. Enter the Hive password in the command-line when you are prompted with the "Enter Hive password:" message.