Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
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 🙂