csv

Options

-d,--delimiter <arg>                                  specifies the
                                                      delimiter
-t,--type <default | excel | rfc4180 | mysql | tdf>   sets the csv type.

Note

  • Binary types are converted to hexadecimal format.

  • NULL values are convert to empty strings.

  • Array and Struct types are converted to string simply using toString() functions of the object.

    • For Teradata, PERIOD data types, which are transmitted as Struct types, are converted into formats that matches their BTEQ output formats.

Example

.format csv
-- 8/8 - 0 ----------------------------------------------------------------
SELECT * FROM MyTable ORDER BY a;
-- success --
a,b,c
1,abc,def
2,john,doe
3,"a""b","c""d"
4,"a,b","c,d"
5,a'b,c'd
6,"a'"",b","c'"",d"
7,a     b,"c,d"
-- activity count = 7
-- 9/8 - 0 ----------------------------------------------------------------
.format csv -type default -d |
-- 9/9 - 0 ----------------------------------------------------------------
SELECT * FROM MyTable ORDER BY a;
-- success --
a|b|c
1|abc|def
2|john|doe
3|"a""b"|"c""d"
4|a,b|c,d
5|a'b|c'd
6|"a'"",b"|"c'"",d"
7|a     b|c,d
-- activity count = 7