我正在尝试运行从Visual Studio中成功运行的作业。我想在我的ADF管道中运行它,但作业失败并出现语法错误。
ERRORID: E_CSC_USER_SYNTAXERROR
SEVERITY: Error
COMPONENT: CSC
SOURCE: USER
MESSAGE:
syntax error. Expected one of: '[' end-of-file ALTER COMBINE CREATE DEPLOY DROP EXTRACT IF INSERT OUTPUT PROCESS REDUCE REFERENCE RESOURCE SELECT TABLE TRUNCATE UPDATE USE USING VIEW identifier quoted-identifier variable ';' '('
DETAILS:
at token [], line 2
near the ###:
**************
DECLARE @outSlice string = "somepath.csv";
### USE DATABASE myDB;
//LOCAL
//DECLARE @root string = @"some local path";
//CLOUD
//DECLARE @root string = "adl://storeuri";
DECLARE @root string = "wasb://container@account/";
//RUN MODE 0
//DECLARE @var2 int = 1;
//DECLARE @var1 int = 1;
DECLARE @path1 string = @root + @"path1/xyz.csv";
编辑:我用USE DATABASE语句尝试了它,我如上所示对它进行了评论; ###出现在两种情况下的完全相同的位置。 EDIT2:从@ michael-rys的每个请求添加了连续的代码行 稍后在脚本中,参数@outSlice用于输出语句,如
OUTPUT @dataset
TO @outSlice
USING Outputters.Csv();
参数在管道活动中确定。下面的代码段:
"type": "DataLakeAnalyticsU-SQL",
"typeProperties": {
"scriptPath": "script.usql",
"scriptLinkedService": "storageXYX",
"degreeOfParallelism": 2,
"priority": 0,
"parameters": {
"outSlice": "$$Text.Format('/Output/{0:yyyy}/{0:MM}/{0:dd}/{0:HH}/somefile.csv',SliceStart)"
}
答案 0 :(得分:2)
与Michael进行离线对话时,我从脚本文件中删除了BOM,并且ADF作业成功运行。如果您使用的是Visual Studio,请转到文件 - >高级保存选项。在我的情况下,我必须选择没有签名的UTF-8来删除BOM。再次感谢@ michael-rys!