gpt4 book ai didi

python - 创建按日期范围分区的暂存表

转载 作者:太空宇宙 更新时间:2023-11-03 11:59:49 24 4
gpt4 key购买 nike

我正在尝试使用以下查询创建临时表,我正在尝试修改它以创建按日期分区的表

create table scratch.myTable
as (
select
concat(eid,'_',group) as eid_group,
name,
test
from
test_logs
where
regexp_like(eid, '[A-Z0-9]{22}') and
(regexp_like(group, '[a-z0-9]{8}') OR group = '') and
line_type = 'test' and
date between '2018-09-27' and '2018-09-30' and
eid NOT IN ('123456789','ABCDEFF')
) WITH (partitioned_by sequence('2018-09-27','2018-09-30'))

此查询在 s3 上创建一个暂存表并将所有内容转储为 orc 文件。我正在尝试按日期范围分区此表

有人可以帮我查询吗?

最佳答案

你试过用“over”代替“with”吗?

create table scratch.myTable
as (
select
concat(eid,'_',group) as eid_group,
name,
test
from
test_logs
where
regexp_like(eid, '[A-Z0-9]{22}') and
(regexp_like(group, '[a-z0-9]{8}') OR group = '') and
line_type = 'test' and
date between '2018-09-27' and '2018-09-30' and
eid NOT IN ('123456789','ABCDEFF')
) over(partition by date)

关于python - 创建按日期范围分区的暂存表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52636685/

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