Created on 06-07-2017 11:00 PM - edited 09-16-2022 04:43 AM
When we execute impala-shell command at a directory contains user defined python script, and the script name conflicts with python module imported by impala-shell, we will encounter an Import Error.
How to reproduce:
$ touch abc.py
$ impala-shell 'import site' failed; use -v for traceback Traceback (most recent call last): File "/usr/lib/impala-shell/impala_shell.py", line 24, in <module> import getpass File "/usr/lib64/python2.6/getpass.py", line 18, in <module> import os, sys, warnings File "/usr/lib64/python2.6/os.py", line 398, in <module> import UserDict File "/usr/lib64/python2.6/UserDict.py", line 82, in <module> import _abcoll File "/usr/lib64/python2.6/_abcoll.py", line 11, in <module> from abc import ABCMeta, abstractmethod ImportError: cannot import name ABCMeta
Created 06-12-2017 10:20 AM
Created 06-08-2017 07:43 PM
Created 06-08-2017 07:44 PM
Created on 06-08-2017 08:56 PM - edited 06-08-2017 08:57 PM
Not putting python script under /usr/bin, but my working directory.
For example, If someone else I don't known who write a python script under home directory:
[~]$ cat abc.py #!/usr/bin/python
print "test script"
Now I cannot execute impala-shell anymore due to Import Error:
[~]$ impala-shell test script 'import site' failed; use -v for traceback Traceback (most recent call last): File "/usr/lib/impala-shell/impala_shell.py", line 24, in <module> import getpass File "/usr/lib64/python2.6/getpass.py", line 18, in <module> import os, sys, warnings File "/usr/lib64/python2.6/os.py", line 398, in <module> import UserDict File "/usr/lib64/python2.6/UserDict.py", line 82, in <module> import _abcoll File "/usr/lib64/python2.6/_abcoll.py", line 11, in <module> from abc import ABCMeta, abstractmethod ImportError: cannot import name ABCMeta
I think impala-shell shall not include current directory in PYTHONPATH to avoid such error.
Created 06-12-2017 10:20 AM