none
Local Debug Error Message: "An output statement must have at least one local run step"

    Question

  • I'm using ADL Tools v2.2.2000.0

    I get the following error when I try to debug any script with code behind (the script works properly when I execute it in non debug mode):

    Severity    Code    Description    Project    File    Line    Suppression State
    Error        Microsoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.ScopeDebugException: An output statement must have at least one local run step! output=C:\Users\xxxxxx\AppData\Local\USQLDataRoot
       at Microsoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.PerStatementDebugExeGeneratorBase.FindLocalRunsteps(CompileResult debugScriptCompileResult)
       at Microsoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.PerStatementDebugExeGeneratorBase.GenerateDebugNode(CompileResult result)
       at Microsoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.ExeGeneratorBase.GenerateExe(String assemblyName, String targetDirectory, CompileResult result)
       at Microsoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.USqlPerStatementDebugExeGenerator.GenerateExe()
       at Microsoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.LocalRunManager.GetLocalDebugAssembly(List`1 breakPointInfoList, Boolean tolerateNoDebugInfo)
       at Microsoft.VisualStudio.Project.BuildableProjectConfig.GenerateExeIfExpired(IScopeProjectStateSnapshot state)
       at Microsoft.VisualStudio.Project.BuildableProjectConfig.<>c__DisplayClass17_0.<Build>b__1()
       at System.Threading.Tasks.Task.InnerInvoke()
       at System.Threading.Tasks.Task.Execute()        CustomExtractor.usql    1    

    Here is the U-SQL Script:

    USE DATABASE Samples;
    
    USING USQL_JSON2CSV;
    
    @data =
        EXTRACT user string,
                timestamp DateTime,
                heart int
        FROM "/samples/quantified-{user}.tsv"
        USING new CustomExtractor();
    
    OUTPUT @data
    TO "/samples/extractor.csv"
    USING Outputters.Csv();
    

    Here is the code-behind:

    using Microsoft.Analytics.Types.Sql;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Globalization;
    
    namespace USQL_JSON2CSV
    {
    	[SqlUserDefinedExtractor]
    	public class CustomExtractor : IExtractor
    	{
    		public override IEnumerable<IRow> Extract(IUnstructuredReader input, IUpdatableRow output)
    		{
    			using (var reader = new StreamReader(input.BaseStream))
    			{
    				string line;
    				while ((line = reader.ReadLine()) != null)
    				{
    					var parts = line.Split('\t');
    					output.Set("timestamp", DateTime.ParseExact(parts[0], "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None));
    					output.Set("heart", Convert.ToInt32(parts[1]));
    
    					yield return output.AsReadOnly();
    				}
    			}
    		}
    	}
    }
    

    Thank you for your help.


    Michel CARADEC

    Thursday, October 13, 2016 10:38 AM

Answers

  • Another temporary alternative, change your code as below.   There's a bug handling USING statement in code behind debug situation:

    USE DATABASE Samples;

    // USINGUSQL_JSON2CSV;

    @data = EXTRACT user string, timestamp DateTime, heart int FROM "/samples/quantified-{user}.tsv" USING new USQL_JSON2CSV.CustomExtractor();

    OUTPUT @data TO "/samples/extractor.csv" USING Outputters.Csv();

    Thanks a lot,

    Yu Dong

    • Marked as answer by MichelCaradec Tuesday, October 18, 2016 9:55 AM
    Tuesday, October 18, 2016 9:49 AM
  • Michel,

    Thanks a lot for the bug report.  I confirm this is a bug introduced recently.  We will include a fix in the next release.   To temporarily unblock you, you'd better roll back to previous version.   I'm sorry for the inconveniences.

    Sincerely,

    Yu Dong

    • Marked as answer by MichelCaradec Tuesday, October 18, 2016 9:12 AM
    Tuesday, October 18, 2016 9:07 AM

All replies

  • Michel,

    Thanks a lot for the bug report.  I confirm this is a bug introduced recently.  We will include a fix in the next release.   To temporarily unblock you, you'd better roll back to previous version.   I'm sorry for the inconveniences.

    Sincerely,

    Yu Dong

    • Marked as answer by MichelCaradec Tuesday, October 18, 2016 9:12 AM
    Tuesday, October 18, 2016 9:07 AM
  • Thank you for your answer,

    Unfortunatlly, I'm not able to roll back to previous version, as it already introduced a regression.

    So I will wait for the next release...


    Michel CARADEC

    Tuesday, October 18, 2016 9:15 AM
  • Another temporary alternative, change your code as below.   There's a bug handling USING statement in code behind debug situation:

    USE DATABASE Samples;

    // USINGUSQL_JSON2CSV;

    @data = EXTRACT user string, timestamp DateTime, heart int FROM "/samples/quantified-{user}.tsv" USING new USQL_JSON2CSV.CustomExtractor();

    OUTPUT @data TO "/samples/extractor.csv" USING Outputters.Csv();

    Thanks a lot,

    Yu Dong

    • Marked as answer by MichelCaradec Tuesday, October 18, 2016 9:55 AM
    Tuesday, October 18, 2016 9:49 AM
  • It works!

    Thank you very much for your help. :-)


    Michel CARADEC

    Tuesday, October 18, 2016 9:55 AM
  • I am getting this error event after changing the USING statmenet as mentioned below. Any other pointers here. 

            USING new TelemetryStore.ProcessingTypes.KustoExtractors.KustoFeatureUsageEvent();

    Tuesday, December 6, 2016 4:52 AM