forked from Azure/usql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Builtin-UDO samples with new options
outputHeader and charFormat
- Loading branch information
Showing
5 changed files
with
84 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
Examples/Builtin-UDOs/Builtin-UDOs/7-Output-withHeaders.usql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@data = | ||
SELECT "Jane" AS [first name], "Doe" AS [name,last], 42 AS [数量] | ||
FROM( | ||
VALUES | ||
( | ||
1 | ||
)) AS T(dummy); | ||
|
||
OUTPUT @data | ||
TO "/output/builtinUDO/output_header.csv" | ||
USING Outputters.Csv(outputHeader : true); | ||
|
||
OUTPUT @data | ||
TO "/output/builtinUDO/output_header_noquotes.csv" | ||
USING Outputters.Csv(outputHeader : true, quoting:false); | ||
|
||
OUTPUT @data | ||
TO "/output/builtinUDO/output_header_noquotes_esc.csv" | ||
USING Outputters.Csv(outputHeader : true, quoting : false, escapeCharacter: '#'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@data = | ||
SELECT 42 AS n_int | ||
, "\xFFFE" AS c_u | ||
, '\xFFFD' AS c_u2 | ||
, '数' AS c_ch | ||
, ',' AS c_c | ||
, '4' AS c_int | ||
, '\n' AS c_nl | ||
, (char?) null AS c_null | ||
FROM (VALUES(1)) AS T(dummy); | ||
|
||
OUTPUT @data TO "/output/builtinUDO/char_as_int1.csv" USING Outputters.Csv(); | ||
|
||
OUTPUT @data TO "/output/builtinUDO/char_as_int2.csv" USING Outputters.Csv(charFormat:"uint16"); | ||
|
||
OUTPUT @data TO "/output/builtinUDO/char_as_string.csv" USING Outputters.Csv(charFormat:"string"); | ||
|
||
OUTPUT @data TO "/output/builtinUDO/char_as_string_utf16.csv" USING Outputters.Csv(charFormat:"string", encoding:Encoding.Unicode); | ||
|
||
OUTPUT @data TO "/output/builtinUDO/char_as_string2.csv" USING Outputters.Csv(charFormat:null); | ||
|
||
OUTPUT @data TO "/output/builtinUDO/char_as_int_null.csv" USING Outputters.Csv(nullEscape:"NULL",escapeCharacter:'#'); | ||
|
||
OUTPUT @data TO "/output/builtinUDO/char_as_string_null.csv" USING Outputters.Csv(charFormat:"string", nullEscape:"NULL",escapeCharacter:'#'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Requires outputs of 8-Output-Char.usql | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters