none
Column name with space

    Question

  • Hi,

    I need to process multiple JSON documents in a single using U-SQL. Below is my U-SQL.

    @RawExtract = 
        EXTRACT 
            [RawString] string
        FROM
            @"path/to/input/json"
        USING 
            Extractors.Text(delimiter:'\b', quoting : false);
    
    @ParsedJSONLines =
        SELECT Microsoft.Analytics.Samples.Formats.Json.JsonFunctions.JsonTuple([RawString]) AS JSONLine
        FROM @RawExtract;
    
    @StagedData =
        SELECT 
            JSONLine["ID"] AS ID,
            JSONLine["Begin Date"] AS BeginDate,
            JSONLine["Reading"] AS Reading
        FROM 
            @ParsedJSONLines;
    
    OUTPUT @StagedData
    TO @"path/to/output/csv" 
    USING Outputters.Csv();
    


    In the output CSV file, the 'Begin Date' column has no value. When analyzed, it because of the space in its name. If I have the column without space like 'BeginDate' in the JSON documents, it outputs value for that column.

    How to handle columns which has space in their name?

    with regards,
    Parthiban

    Friday, September 22, 2017 6:52 PM