gpt4 book ai didi

Create table in Athena with auto load partitions(在Athena中创建具有自动加载分区的表)

转载 作者:bug小助手 更新时间:2023-10-24 17:55:13 29 4
gpt4 key购买 nike



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

雅典娜中的分区投影


更多回答

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com