When I run the following hive command
hive -e 'select msg, count(*) as cnt from table where msg like “%abcd%” group by msg order by cnt desc ;' | sed 's/[\t]/,/g' > table.csv
I get the following error.
FAILED: ParseException line 1:89 cannot recognize input near 'like' '%' 'password' in expression specification
I am aware that there is a problem with specifying the string “%abcd%”. The command works fine in a hive environemnt, but here i was trying to save the result to a csv file. How do i rectify this error?
like '%abcd%'and use double quotes for bash string - serge_khive -e 'select msg, count(*) as cnt from table where msg like '%password%' group by msg order by cnt desc ;' | sed 's/[\t]/,/g' > table.csv. But getting the same error. - prashanthhive -e "select msg, count(*) as cnt from table where msg like '%password%' group by msg order by cnt desc ;" | sed "s/[\t]/,/g" > table.csv- prashanth