以下是我试图执行的spark脚本。它在DAS(3.0.1)批处理分析控制台上成功运行。但在批处理分析中保存为脚本时无法执行。
insert overwrite table CLASS_COUNT select ((timestamp / 120000) * 120000) as time , vin , username , classType,
sum(acceleCount) as acceleCount , sum(decceleCount) as decceleCount
from ACCELE_COUNTS
group by ((timestamp / 120000) * 120000) ,classType, vin, username;
错误:ERROR: [1.199] failure: ``limit'' expected but identifier ACCELE_COUNTSgroup found insert overwrite table X1234_CLASS_COUNT select ((timestamp / 120000) * 120000) as time , vin , username , classType, sum(acceleCount) as acceleCount , sum(decceleCount) as decceleCountfrom ACCELE_COUNTSgroup by ((timestamp / 120000) * 120000) ,classType, vin, username ^
在此之前,我执行以下没有任何问题。
CREATE TEMPORARY TABLE ACCELE_COUNTS
USING CarbonAnalytics
OPTIONS (tableName "KAMPANA_RECKLESS_COUNT_STREAM",
schema "timestamp LONG , vin STRING, username STRING, classType STRING, acceleCount INT,decceleCount INT");
CREATE TEMPORARY TABLE CLASS_COUNT
USING org.wso2.carbon.analytics.spark.event.EventStreamProvider
OPTIONS (receiverURL "tcp://localhost:7611",
username "admin",
password "admin",
streamName "DAS_RECKELSS_COUNT_STREAM",
version "1.0.0",
description "Events are published when product quantity goes beyond a certain level",
nickName "product alerts",
payload "time LONG,vin STRING,username STRING, classType STRING, acceleCount INT, decceleCount INT"
);
这是因为
之间没有空格1) decceleCount
和from
2) ACCELE_COUNTS
和group by
所以,确保单词之间有空格,即使第二个单词在新行中