我想知道是否可以创建按TIMESTAMP列的YEAR和MONTH分区的表?例如,类似于以下命令:
USE database;
CREATE TABLE credit_transactions(
processdate TIMESTAMP,
requestprocess STRING,
cardno_hash STRING,
)
PARTITIONED BY (YEAR(processdate) INT, MONTH(processdate), INT)
CLUSTERED BY (cardno_hash) into 50 buckets stored as orc
TBLPROPERTIES("transactional"="true");
然后,是否可以简单地从csv文件添加数据并Hive自动对数据进行分区?例如:
LOAD DATA LOCAL INPATH '/root/usr/transact.csv'
OVERWRITE INTO TABLE credit_transact