I am getting this error while importing a file from other module?Can anyone tell me what could be the reason.It is running fine in console but when I run it as a oozie job,command is failing.
Folder structure:
oozie/common/file.py
oozie/common/__init__.py
oozie/__init__py
my location from where i am trying to import:
oozie/mylocation/pjt.py
oozie/common/__init__.py
Command:
import oozie.common.file as file
Your python code will be moved from HDFS, where it is stored, into the local filesystem of a datanode where is executed. Be sure you set all the files required into the oozie jobs, otherwise some of them will no downloaded into the selected datanode.
Remember that:
1) All the python system library must be installed on each datanode
2) Local libraries work if you set the PYTHON LIBPATH.
So you first line in your python script, should be something which set library path.
In my opinion to keep all classes into the same file the python ( if you can ) is the painless solution when you start them on oozie.
If you can start using Java.