none
Error loading a Json file in Data Lake Analytics

    Question

  • I am loading a Json file into Azure Data Lake Analytics generates this error:
    Intente cambiar el tipo de Extractores y no funciona

    @log = EXTRACT entry string
    FROM "/iislogs/DailyForecast.Csv"
    USING Extractors.Csv();
    OUTPUT @log
    TO "/output/log.Csv"
    USING Outputters.Csv();

    Use

    // A. CREATE ASSEMBLY: Register assemblies (if they do not already exist).
    CREATE ASSEMBLY IF NOT EXISTS [Newtonsoft.Json] FROM @"adl://climaadls.azuredatalakestore.net/Newtonsoft.Json.dll";
    CREATE ASSEMBLY IF NOT EXISTS [Microsoft.Analytics.Samples.Formats] FROM @"adl://climaadls.azuredatalakestore.net/Microsoft.Analytics.Samples.Formats.dll";
    // B. REFERENCE ASSEMBLY: Load assemblies for compile time and execution.
    REFERENCE ASSEMBLY [Newtonsoft.Json];
    REFERENCE ASSEMBLY [Microsoft.Analytics.Samples.Formats];
    // C. USING: Specifiy namespace to shorten function names (e.g. Microsoft.Analytics.Samples.Formats.Json.JsonExtractor)
    USING Microsoft.Analytics.Samples.Formats.Json;
    // 1. Initialise variables for Input (e.g. JSON) and Output (e.g. CSV).
    DECLARE @InputFile string = @"adl://climaadls.azuredatalakestore.net/exercise01.json";
    DECLARE @OutputFile string = @"adl://climaadls.azuredatalakestore.net/exercise01.csv";
    // 2. Extract string content from JSON document (i.e. schema on read).
    @json =
    EXTRACT
    title string,
    rating string,
    genre string,
    year string
    FROM
    @InputFile
    USING new JsonExtractor();
    // 3. Write values to CSV
    OUTPUT @json
    TO @OutputFile
    USING Outputters.Csv(outputHeader:true,quoting:true);


    REFERENCE ASSEMBLY [Newtonsoft.Json];
    REFERENCE ASSEMBLY [Microsoft.Analytics.Samples.Formats];
    And it generates an error:

     E_CSC_USER_CANNOTREADASSEMBLY: Assembly file 'adl://climaadls.azuredatalakestore.net/Newtonsoft.Json.dll' could not be read.
    Line 2
    <label aria-atomic="true" aria-live="polite" class="fxs-hide-accessible-label" data-bind="text: $ctl._ariaLive" style="font-weight:inherit;width:0px;height:0px;"></label>
    Component
    CSC
    Message
    Assembly file 'adl://climaadls.azuredatalakestore.net/Newtonsoft.Json.dll' could not be read.
    Resolution
    Make sure that the file denotes an existing cluster file and the file is accessible.
    Description
    The assembly file must already exist in the cluster and be accessible.
    Details
    at token '@"adl://climaadls.azuredatalakestore.net/Newtonsoft.Json.dll"', line 2 near the ###: ************** // A. CREATE ASSEMBLY: Register assemblies (if they do not already exist). CREATE ASSEMBLY IF NOT EXISTS [Newtonsoft.Json] FROM ### @"adl://climaadls.azuredatalakestore.net/Newtonsoft.Json.dll"; CREATE ASSEMBLY IF NOT EXISTS [Microsoft.Analytics.Samples.Formats] FROM @"adl://climaadls.azured

    Friday, August 24, 2018 4:39 PM

Answers

  • Hi karito, 

         Try removing @before file name and try it. Like below:

    CREATE ASSEMBLY IF NOT EXISTS [Newtonsoft.Json] FROM "adl://climaadls.azuredatalakestore.net/Newtonsoft.Json.dll";

    @ is only given to variables declared before.

    Friday, August 24, 2018 10:00 PM
    Moderator

All replies