INSERT语句中使用CTE后无法正确抛出报错信息

Viewed 15

版本:2.1.6
当insert语句中使用CTE后,原table not found、partition不存在的NPE错误等都变成了同一个报错,指向的位置为CTE的with关键字后,不利于问题的定位。
image.png

1 Answers

CTE 使用语法有问题,报的语法错误

参考这种

INSERT INTO tbl1 WITH LABEL label1
WITH cte1 AS (SELECT * FROM tbl1), cte2 AS (SELECT * FROM tbl2)
SELECT k1 FROM cte1 JOIN cte2 WHERE cte1.k1 = 1;