When executing a CASLIB statement to connect to Hadoop (often via Hive), the process stops and returns the following error messages in the log:
ERROR: The connection to the data source driver failed.
ERROR: General error java.util.concurrent.TimeoutException
ERROR: Function failed.
ERROR: The action stopped due to errors.
This issue typically occurs when using an explicit connection string that includes the uri= option, as in the example below:
/* Code provoquant l'erreur */
caslib hdlib datasource=(
srctype="hadoop",
dataTransferMode="serial",
username="{votre_user}",
password="{votre_mdp}",
/* L'option URI ci-dessous est souvent la cause du conflit */
uri="jdbc:hive2://{host}:2181...;serviceDiscoveryMode=zooKeeper;...",
hadoopjarpath="/sas_mirror/hadoopfiles/lib",
hadoopconfigdir="/sas_mirror/hadoopfiles/conf",
schema="default"
);
1
/* Code provoquant l'erreur */
2
caslib hdlib datasource=(
3
srctype="hadoop",
4
dataTransferMode="serial",
5
username="{votre_user}",
6
password="{votre_mdp}",
7
/* L'option URI ci-dessous est souvent la cause du conflit */
If, after applying the fix above, you still encounter timeout errors (especially on heavily loaded clusters), it is possible that the default timeout is too short.
The default connection timeout for Hadoop is typically 30 seconds. You can increase this value by adding the login_timeout option:
caslib hdlib datasource=(
...
login_timeout=60 /* Augmentation du délai à 60 secondes */
...
);
1
caslib hdlib datasource=(
2
...
3
login_timeout=60/* Augmentation du délai à 60 secondes */
4
...
5
);
Important Disclaimer
The codes and examples provided on WeAreCAS.eu are for educational purposes. It is imperative not to blindly copy-paste them into your production environments. The best approach is to understand the logic before applying it. We strongly recommend testing these scripts in a test environment (Sandbox/Dev). WeAreCAS accepts no responsibility for any impact or data loss on your systems.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.