07-30-2015 10:24 PM
I have installed the Impala using the CM, but I'm unable to access the impala-shell , instead its throwing me a syntax error like this
File "/opt/cloudera/parcels/CDH-5.3.2-1.cdh5.3.2.p0.10/bin/../lib/impala-shell/impala_shell.py", line 176
print '\tNo options available.'
SyntaxError: Missing parentheses in call to 'print'
I have verified the file in the described location and looks fine because i have compare it with other file from different cluster with same vesrion of CDH.
01-02-2018 06:19 AM
The problem is that impala-shell/impala_shell.py is written for Python 2.7.
The print statement without parameters was deprecated in Python 3.
For Cloudera to fix the problem, they just need to change the line to read
print('\tNo options available.')
You can either hack-up their source code, and fix it;
you can change your conda environment to be 2.7; or,
you can call impala_shell.py directly using /usr/bin/python2
01-19-2018 06:45 AM
Found a nice workaround for this, the "env -i" command creates a new shell without inheriting the environment of your current shell.
env -i impala-shell -k --ssl -i <serverURL> -q 'invalidate metadata;'