You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Vertica添加新列后投影列复用旧列别名导致执行报错求助

Vertica添加新列后投影列出现异常别名问题

在Vertica数据库中,执行添加新列的ALTER TABLE语句(如alter table DMA.test_migrations add column my_column int)后,发现自动生成的投影列出现异常别名——新列被错误赋予旧列的名称作为别名。

异常相关DDL示例

CREATE TABLE DMA.test_migrations
(
    launch_id int NOT NULL,
    datamart varchar(128),
    actual_date date,
    time_sla interval,
    kek int,
    lol int,
    lolkek int,
    my_column int,
    my_column2 int,
    my_column3 int,
    my_column4 int,
    my_column5 int,
    my_column6 int,
    my_column7 int
);


CREATE PROJECTION DMA.test_migrations_super /*+basename(test_migrations),createtype(P)*/ 
(
 launch_id,
 datamart,
 actual_date,
 time_sla,
 kek,
 lol,
 lolkek,
 my_column,
 my_column2,
 my_column3,
 my_column4,
 my_column5,
 my_column6,
 my_column7
)
AS
 SELECT test_migrations.launch_id,
        test_migrations.datamart,
        test_migrations.actual_date,
        test_migrations.time_sla,
        test_migrations.kek,
        test_migrations.lol,
        test_migrations.lolkek,
        test_migrations.my_column AS launch_id,
        test_migrations.my_column2 AS datamart,
        test_migrations.my_column3 AS actual_date,
        test_migrations.my_column4 AS time_sla,
        test_migrations.my_column5 AS kek,
        test_migrations.my_column6 AS lol,
        test_migrations.my_column7 AS lolkek
 FROM DMA.test_migrations
 ORDER BY test_migrations.datamart,
          test_migrations.actual_date
UNSEGMENTED ALL NODES;


SELECT MARK_DESIGN_KSAFE(1);

该异常会导致执行select analyze_histogram('DMA.test_migrations')时触发DDL statement interfered with this statement错误。

完整操作序列

create table if not exists dma.test_migrations
(
    launch_id int not null,
    datamart varchar(128),
    actual_date date,
    time_sla interval
)
order by datamart, actual_date
unsegmented all nodes;

ALTER TABLE dma.test_migrations ADD COLUMN kek int ;
ALTER TABLE dma.test_migrations ADD COLUMN lol int ;
alter table dma.test_migrations drop column lol;
ALTER TABLE dma.test_migrations ADD COLUMN lol int ;
ALTER TABLE dma.test_migrations ADD COLUMN lolkek int ;
ALTER TABLE dma.test_migrations ADD COLUMN my_column int ;
ALTER TABLE dma.test_migrations ADD COLUMN my_column2 int ;
ALTER TABLE dma.test_migrations ADD COLUMN my_column3 int ;
ALTER TABLE dma.test_migrations ADD COLUMN my_column4 int ;
ALTER TABLE dma.test_migrations ADD COLUMN my_column5 int ;
ALTER TABLE dma.test_migrations ADD COLUMN my_column6 int ;
ALTER TABLE dma.test_migrations ADD COLUMN my_column7 int ;

目前尚未定位到问题成因,请问有没有同行遇到过此类问题?

内容的提问来源于stack exchange,提问作者Anastasiia

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 09:52:50