我有一個包含時間戳列的日誌文件。時間戳採用unix紀元時間格式。如何在配置單元中將unix時元日期字符串轉換爲
我想根據分區年,月,日的時間戳創建分區。
到目前爲止,我已經做了這個,但它是拋出一個錯誤。
PARSE ERROR cannot recognize input '(' in column type
這是我的代碼。
from (
from raw_data
MAP ${PREFIX}raw_data.line
USING 's3://scripts/clean.py'
AS (timestamp STRING, name STRING)
) map_out
INSERT OVERWRITE TABLE date_base_data_temp PARTITION(year(timestamp), month(timestamp)), day(timestamp)))
select map_out.name;
謝謝!節省了我很多時間。這正是我所期待的! –
確保'timestamp_value'(這裏'unix_timestamp')在幾秒鐘內,否則使用'from_unixtime(timestamp_value DIV 1000)' – narush
我只有時間到秒,但我也想ms。我怎麼做 ? – Avinash