I am trying to run a job that runs successfully from within Visual Studio. I'd like to run this in my ADF pipeline but the job fails with a syntax error.
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";
EDIT:I tried it both with USE DATABASE statement and I commented it out like shown above;### appears in the exact same location in either cases. EDIT2: Added consecutive lines of code per request from @michael-rys Later in the script the parameter @outSlice is used in an output statement like
OUTPUT @dataset
TO @outSlice
USING Outputters.Csv();
The parameter is determined within a pipeline activity. Snippet below:
"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)"
}