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
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.
© 2022 - 2024 — McMap. All rights reserved.
trunc(ts_col, 'D')
– ArabellaCAST(tscol AS DATE)
– Arabella