I've created the table like this:
我创建了这样的表:
CREATE EXTERNAL TABLE IF NOT EXISTS my_table (
`id` string COMMENT '',
`source` string COMMENT '',
`os` string COMMENT '')
PARTITIONED BY (
`date` string COMMENT '')
STORED AS PARQUET
LOCATION 's3://.....';
But I have to tap LOAD PARTITION
every time working this table. Is it possible to auto load partition for this table?
但每次操作该表时,我都必须点击LOAD PARTITION。是否可以自动加载此表的分区?
更多回答
优秀答案推荐
You can use Partition Projection in Athena table which automatically handles partition.
您可以在Athena表中使用分区投影,它会自动处理分区。
You have to use tblproperties while creating the table.
在创建表时,您必须使用tblProperties。
Suppose , you have partitions from 2020-01-01 then extend this query in your create table statement.
假设您有来自2020-01-01的分区,然后在CREATE TABLE语句中扩展该查询。
TBLPROPERTIES
(
"projection.enabled" = "true",
"projection.date.type" = "date",
"projection.date.format"="yyyy-DD-mm",
"projection.date.range"="2010-01-01,NOW"
)
You can follow this link to know more--
你可以点击这个链接来了解更多--
Partition Projection in Athena
雅典娜中的分区投影
更多回答
我是一名优秀的程序员,十分优秀!