-- 作者：tianyu.chu
-- 日期：2026-07-15
-- 工单：(无)
-- 目的：一次性中转表——回填拼团 2026 数据的落地区，供 ODS 重分桶后即 DROP
-- 状态：[待执行]
-- 生命周期：建表 → DataX 灌 dt=20260716（COALESCE≥2026-01-01 拼团 2026 活跃单当前态）
--           → ODS 读 WHERE dt='20260716' 动态分区重分桶 → DROP TABLE（内部表连数据一起清）
-- 备注：内部表（managed），DROP 自动清 HDFS；数据可从 PG 重抽，无兜底诉求。
--       115 字段全 STRING，对齐 raw_trd_card_group_info_inc_d。

DROP TABLE IF EXISTS raw.tmp_trd_card_group_info;

CREATE TABLE IF NOT EXISTS raw.tmp_trd_card_group_info (
    id STRING, merchant_id STRING, appid STRING, name STRING, code STRING,
    status STRING, specs STRING, type STRING, random_type STRING, total_price STRING,
    copies STRING, unit_price STRING, sold_copies STRING, release_time STRING, cycle STRING,
    show_applet STRING, title STRING, msg STRING, remark STRING, create_time STRING,
    update_by STRING, update_time STRING, order_quota_min STRING, order_quota_max STRING, user_quota_max STRING,
    start_time STRING, marketing_info STRING, reviewmsg STRING, lock STRING, commission_rate STRING,
    year STRING, sport STRING, manufacturer STRING, sets STRING, act STRING,
    config STRING, info_config STRING, total_num STRING, banner_end_time STRING, add_banner STRING,
    finished_time STRING, display_name STRING, group_sets_no STRING, close_payment_time STRING, confirm_send_time STRING,
    close_payment_status STRING, open_card STRING, close_payment_record STRING, group_full_time STRING, live_create_time STRING,
    live_start_time STRING, live_end_time STRING, report_start_time STRING, report_end_time STRING, report_review_num STRING,
    report_review_first_time STRING, report_review_end_time STRING, review_hold_time STRING, review_approval_time STRING, review_num STRING,
    config_json STRING, free_flag STRING, mer_name STRING, change_type STRING, act_price STRING,
    act_config_json STRING, real_sold_num STRING, weight STRING, hot_type STRING, team_first STRING,
    prop1 STRING, prop2 STRING, prop3 STRING, point_rate STRING, point_max STRING,
    point_min STRING, list_id STRING, list_code STRING, mix_copies STRING, sub_type STRING,
    act_point_type STRING, payment_method STRING, payment_total_price STRING, payment_commission STRING, payment_finished_price STRING,
    payment_remain_price STRING, payment_online_price STRING, exclusive STRING, has_bg STRING, merchant_sort STRING,
    del_flg STRING, del_time STRING, review_account STRING, act_id STRING, sold_end_time STRING,
    panini_list_id STRING, hot_type_config STRING, goods_type STRING, report_flag STRING, use_coupon STRING,
    user_level STRING, custom STRING, gift_card_id STRING, group_show_name STRING, min_card_num STRING,
    act_type STRING, waring_type STRING, compensation_status STRING, point_type STRING, first_act_config STRING,
    gift_config STRING, version STRING, extra_prop STRING, use_member_discount STRING, merchant_open STRING
)
COMMENT '拼团 5/18 后回填一次性中转表，ODS 消费后 DROP'
PARTITIONED BY (dt STRING)
STORED AS ORC;
