Hello,

I am running a hive query given below and I am getting this
 Exception:
FAILED: SemanticException [Error 10004]: Line 2:74 Invalid table alias or 
column reference 'result_data': (possible column names are: resultid, 
publishdatetime)



select resdata.resultid, resdata.clinical.publishdatetime from result_test 
LATERAL VIEW EXPLODE (result_test) exploded_table as resdata where 
key.consumer_id=' ' and key.person= ' '
and resdata.clinical.publishdatetime=' ' order by resdata.resultid 
DESC,resdata.clinicaldatacommon.publishdatetime DESC;





But the following query works fine if I change the column type.

select distinct resdata.resultid  as ResultID,resdata.clinical.publishdatetime 
as Pubdatetime from result_test LATERAL VIEW EXPLODE (result_test) 
exploded_table as resdata where key.consumer_id=' ' and key.person=' ' ORDER BY 
Pubdatetime ASC,ResultID DESC;


Can any body help me  what was the problem with the first query. If we use 
order by in hive, do we have to reference the column name which I did in second 
query.


Thank you


CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Cerner's corporate offices in Kansas 
City, Missouri, U.S.A at (+1) (816)221-1024.

Reply via email to