New Contributor
Posts: 4
Registered: ‎07-18-2017

What is the format for a sqoop-export password-file?

I'm trying to use sqoop-export to retrieve data from a cluster.  Using either --password or -P to specify the password, the export is working and the table successfully loaded to the Postgres database.


If I use --password-file, either the file isn't being read at all, or the contents are different from what's expected - the end result is I get an LDAP authentication error for an invalid password.  


This is the same --password-file parameter and file that I've used successfully to sqoop-import data into the cluster originally.  My initial read on this, is that sqoop-export isn't using the --password-file the same way that sqoop-import is using it, and in that difference is also a bug.



I get the same error if I intentionally mistype the password or provide no password.



sqoop-export --connect jdbc:postgresql://dbserver:port/mydb --username user --password umaypass --table mytable --hcatalog-table mytable



sqoop-export --connect jdbc:postgresql://dbserver:port/mydb --username user --password-file file:///home/user/.passfile --table mytable --hcatalog-table mytable


.passfile contains:



I've also tried it with contents of:




File is located in my local file system at /home/user.  I've tried putting the file in HDFS with the same resulting error.



I know there is at least partial support for password-file in sqoop-export - if I specify both the password-file AND --password or -P, then I get an error that it will take only one of those three parameters.


Is anybody using --password-file successfully with sqoop-export?

New Contributor
Posts: 4
Registered: ‎07-18-2017

Re: What is the format for a sqoop-export password-file?

I've 'solved' my problem by using -P.  I'll need to manually type my password for each table as I export them, but this is a mostly one-time operation, so the pain is minor.

New solutions