Error while running U-SQL Activity in Pipeline in Azure Data Factory

前端 未结 3 568
囚心锁ツ
囚心锁ツ 2020-12-18 13:33

I am getting following error while running a USQL Activity in the pipeline in ADF:

Error in Activity:

{\"error         


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-18 14:10

    I had a similary issue, where Azure Data Factory would not recognize my script files. A way to avoid the whole issue, while not having to paste a lot of code, is to register a stored procedure. You can do it like this:

    DROP PROCEDURE IF EXISTS master.dbo.sp_test;
    CREATE PROCEDURE master.dbo.sp_test() 
    AS  
    BEGIN 
    
    @searchlog =
    EXTRACT UserId          int,
            Start           DateTime,
            Region          string,
            Query           string,
            Duration        int?,
            Urls            string,
            ClickedUrls     string
    FROM @in
    USING Extractors.Text(delimiter:'|');
    
    @rs1 =
        SELECT Start, Region, Duration
        FROM @searchlog
    WHERE Region == "kota";
    
    
    OUTPUT @rs1   
        TO @out
          USING Outputters.Text(delimiter:'|');
    END;
    

    After running this, you can use

    "script": "master.dbo.sp_test()"
    

    in your JSON pipeline definition. Whenever you update the U-SQL script, simply re-run the definition of the procedure. Then there will be no need to copy script files to Blob Storage.

提交回复
热议问题