Created on 11-24-2016 05:49 AM - edited 09-16-2022 03:49 AM
I am facing an error while trying to write a CTE query in hive. Even though a column is defined with "Date", system is takin the input as "string".
Created 12-01-2016 03:41 PM
Could you please re-upload the error screenshot? I cannot open it in your post.
I am also confused by your question. You mentioned that column d_rel_issd is defined as Date type, but what I can see here is that this column is just an alias of the case expression. The else clause of your case expression returns a string value. Could you please try to cast it to data and see whether it helps?
cast('9999-12-31' as date)
Created 12-01-2016 03:41 PM
Could you please re-upload the error screenshot? I cannot open it in your post.
I am also confused by your question. You mentioned that column d_rel_issd is defined as Date type, but what I can see here is that this column is just an alias of the case expression. The else clause of your case expression returns a string value. Could you please try to cast it to data and see whether it helps?
cast('9999-12-31' as date)
Created 12-01-2016 11:53 PM
Thnx @yshi . Your solution worked 🙂