无法覆盖配置单元表中的分区

qc6wkl3g  于 2021-06-24  发布在  Hive
关注(0)|答案(1)|浏览(411)

我正试图覆盖表的某个分区。我的查询非常大,但我设法找到了一个最小的代码来再现错误。当我尝试运行此命令时:

INSERT OVERWRITE TABLE sbx.calls_out PARTITION (date_call) 
SELECT
    z.corp,
    z.time_call,
    z.comp,
    z.serv
    z.date_call
FROM (
    SELECT
        'a' as corp,
        1 as time_call,
        'b' as comp,
        '20190625' as date_call,
        'c' as serv
) AS z;

这将返回以下错误:

Failed to recognize predicate '.'. Failed rule: 'regularBody' in statement

但是,如果我运行完全相同的代码,但使用另一个表,它可以正常工作。这背后的原因是什么?

yqlxgs2m

yqlxgs2m1#

你失踪了 , 之前 z.date_call 列,添加 , 然后再次运行语句。

INSERT OVERWRITE TABLE sbx.calls_out PARTITION (date_call) 
SELECT
    z.corp,
    z.time_call,
    z.comp,
    z.serv,
    z.date_call
FROM (
    SELECT
        'a' as corp,
        1 as time_call,
        'b' as comp,
        '20190625' as date_call,
        'c' as serv
) AS z;

相关问题