Mamun Mamun - 6 months ago 8
SQL Question

Hive will not recognize column name in the 2nd condition in the qury

I ran the following and query and got the following error. Please see that error message mentions the column name (platform) that it thinks is not there. weird.

ks01:/home/rashm010# hive -S -e

'select * from devices.device_app_action where ds= '20160511' AND platform= 'ios' limit 3;'


FAILED: SemanticException [Error 10004]: Line 1:73 Invalid table alias or column reference 'ios': (possible column names are: duid, id, dt, app, platform, app_level, tier1, tier2, tier3, tier4, tier5, tier6, first_geo, first_v, first_lang, total_events, min_ats, max_ats, ds)
ks01:/home/rashm010#

Its telling me the column platform does not exist and its there in the list.

Thanks

Answer

could be you have to enclose the query in proper quotes

'select * from devices.device_app_action where ds= "20160511" AND platform= "ios" limit 3;'
Comments