插入时出错:输入'with'时没有可行的替代方案

时间:2018-04-11 15:35:39

标签: sql amazon-web-services hive amazon-emr

我收到了错误

  

org.apache.spark.sql.catalyst.parser.ParseException:在输入'with'处没有可行的替代方法来插入表格。

执行以下插入查询时

INSERT INTO users partition(date)
WITH existentes AS (SELECT COUNT(1) AS name FROM users WHERE date=20160303)

我将不胜感激。

1 个答案:

答案 0 :(得分:0)

尝试更改顺序:

WITH existentes AS (SELECT COUNT(1) AS name FROM users WHERE date=20160303)
INSERT INTO users partition(date)