How can I extract the date from a timestamp value variable in Impala?
eg time = 2018-04-11 16:05:19 should be 2018-04-11
try this:
from_timestamp('2018-04-11 16:05:19','yyyy-MM-dd') as date_value
from_timestamp(datetime timestamp, pattern string): Converts a TIMESTAMP value into a string representing the same value. Please see documentation here
to_date (t1.local_time), as date_value
to_date: Returns a string representation of the date field from a timestamp value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With