none
MultiLevelJsonExtractor could not be found - error

    Question

  • Hi,

    I want to read multi level JSON files and flatten them out to csv format using USQL within VS 2015 CE. 

    My script is as follows...

    REFERENCE ASSEMBLY master.[Newtonsoft.Json];
    REFERENCE ASSEMBLY master.[Microsoft.Analytics.Samples.Formats];
    USING Microsoft.Analytics.Samples.Formats;

    DECLARE @infile string=@"/path/to/{*}.json";

    @Json1 =
    EXTRACT id string
    , name string
    , owner string
    FROM @infile
    USING new MultiLevelJsonExtractor("data", false, "id", name", "owner"); 

    OUTPUT @Json1
    TO @"/path/to\output.csv"
    USING Outputters.Csv();


    Initially I faced "application is busy" error. As per the suggestion provided in the MSDN forum here (https://social.msdn.microsoft.com/Forums/azure/en-US/8ce20fb2-9a34-41c7-9f36-bd41e01d0da1/exception-from-hresult-
    0x8001010a-rpceservercallretrylater?forum=AzureDataLake), I downloaded the latest Microsoft Azure Data Lake and Stream Analytics Tools for Visual Studio 2015 from here (https://www.microsoft.com/en-us/download/details.aspx?id=49504) and installed it.

    I also downloaded the latest code from https://github.com/Azure/usql and built the dlls (Newtonsoft.Json and Microsoft.Analytics.Samples.Formats).

    When I execute the above script, it is throwing the following error.

    E_CSC_USER_INVALIDCSHARP: C# error CS0246: The type or namespace name 'MultiLevelJsonExtractor' could not be found (are you missing a using directive or an assembly reference?)Description:C# compiler reported that this expression is not valid C#.Resolution:Make sure that a valid C# expression is specified.

    Anyone has faced this issue? Any suggestions to overcome this error will be helpful.

    BTW, this code is working fine in the portal.

    with regards,

    Parthiban

    Monday, November 20, 2017 12:24 PM