Posts tagged with: control character

Sqoop Teradata password file extra control character

Sqoop is a great tool to get SQL from/to Hadoop.
Using it with Teradata, you have the possibility to use a password file instead of a plaintext password :
You may end with error
3737 [main] ERROR org.apache.sqoop.teradata.TeradataSqoopExportHelper  - Exception running Teradata export job
com.teradata.connector.common.exception.ConnectorException: java.sql.SQLException: [Teradata Database] [TeraJDBC] [Error 8017] [SQLState 28000] The UserId, Password or Account is invalid.
But you’re 100% sure of the password ? If you set your “Password” password with vi you’ll end with a line feed control character
To find if there’s a LF ending the password file :
[root@localhost ~]# od -c teradata.password
0000000    P   a   s   s   w   o   r   d  \n
So you’ll have to delete your newline control character using tr :
[root@localhost ~]# tr -d '\n' < teradata.password >
[root@localhost ~]# od -c
0000000    P   a   s   s   w   o   r   d