From a815d4e45f71617a0a906c5b52b43c1a9fcc5f46 Mon Sep 17 00:00:00 2001 From: Mike Rys Date: Wed, 2 Nov 2016 14:19:35 -0700 Subject: [PATCH] Fix some comment typos and errors 1. added missing null guard in 3-Extract-Output-ComplexTypes.usql 2. fixed wrong column name reference in 3-Extract-Output-ComplexTypes.usql 3. added no option output to 4-Output-Options.usql for comparison 4. Fixed comment typos in 6-Extract-withHeaders.usql --- .../Builtin-UDOs/3-Extract-Output-ComplexTypes.usql | 5 +++-- Examples/Builtin-UDOs/Builtin-UDOs/4-Output-Options.usql | 4 ++++ .../Builtin-UDOs/Builtin-UDOs/6-Extract-withHeaders.usql | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Examples/Builtin-UDOs/Builtin-UDOs/3-Extract-Output-ComplexTypes.usql b/Examples/Builtin-UDOs/Builtin-UDOs/3-Extract-Output-ComplexTypes.usql index c33591f..cf7382a 100644 --- a/Examples/Builtin-UDOs/Builtin-UDOs/3-Extract-Output-ComplexTypes.usql +++ b/Examples/Builtin-UDOs/Builtin-UDOs/3-Extract-Output-ComplexTypes.usql @@ -34,7 +34,8 @@ FROM @Drivers; // Serialize SQL.MAP into string (or byte[]) for serialization @OutDrivers = SELECT driver_id, name, street, city, region, zipcode, country - , String.Join(",", phone_numbers.Select(p => String.Format("{0}:{1}", p.Key, p.Value))) AS phone_numbers + , phone_numbers == null ? null : + String.Join(",", phone_numbers.Select(p => String.Format("{0}:{1}", p.Key, p.Value))) AS phone_numbers FROM @Drivers; OUTPUT @OutDrivers TO "/output/builtinUDO/Drivers.csv" USING Outputters.Csv(); @@ -60,7 +61,7 @@ FROM @Trips; // Serialize SQL.ARRAY into string (or byte[]) for serialization @OutTrips = SELECT date, driver_id, vehicle_id - , String.Join(",", trips) AS trips + , String.Join(",", trip_ids) AS trips FROM @Trips; diff --git a/Examples/Builtin-UDOs/Builtin-UDOs/4-Output-Options.usql b/Examples/Builtin-UDOs/Builtin-UDOs/4-Output-Options.usql index 7ddb71e..e9ddc6a 100644 --- a/Examples/Builtin-UDOs/Builtin-UDOs/4-Output-Options.usql +++ b/Examples/Builtin-UDOs/Builtin-UDOs/4-Output-Options.usql @@ -10,6 +10,10 @@ FROM (VALUES , ("This row contains CR LF \r\n", (double?) 2342, DateTime.Parse("2016-04-05T12:12:12.918")) ) AS T(s_col, d_col, dt_col); +OUTPUT @SampleRows +TO "/output/builtinUDO/nooptions.csv" +USING Outputters.Csv(); + OUTPUT @SampleRows TO "/output/builtinUDO/QuotedOptions.csv" USING Outputters.Text(delimiter:'&', quoting: true, escapeCharacter: '$', nullEscape: "\\N"); diff --git a/Examples/Builtin-UDOs/Builtin-UDOs/6-Extract-withHeaders.usql b/Examples/Builtin-UDOs/Builtin-UDOs/6-Extract-withHeaders.usql index f6e2eb2..8dcee3a 100644 --- a/Examples/Builtin-UDOs/Builtin-UDOs/6-Extract-withHeaders.usql +++ b/Examples/Builtin-UDOs/Builtin-UDOs/6-Extract-withHeaders.usql @@ -69,7 +69,7 @@ USING Outputters.Csv(); /// -// silent:true will skip incorrect number of rows or replaces invalid invalid casts to nullable types. It will not skip encoding errors, allow invalid casts to not-nullable types, or skip a row where a cast error occurs. +// silent:true will skip incorrect number of columns or replaces invalid casts to nullable types. It will not skip encoding errors, allow invalid casts to not-nullable types, or skip a row where a cast error occurs. @silent_r = EXTRACT id long?, name string,