Get started
Load & manage data
Work with data
Administration
Reference & resources
CLUSTER BY
mask
ROW FILTER
Updated Dec 17, 2024
Send us feedback
to_csv
Applies to: Databricks SQL Databricks Runtime
Returns a CSV string with the specified struct value.
to_csv(expr [, options] )
expr: A STRUCT expression.
expr
options: An optional MAP literal expression with keys and values being STRING.
options
A STRING.
See from_csv function for details on possible options.
> SELECT to_csv(named_struct('a', 1, 'b', 2)); 1,2 > SELECT to_csv(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy')); 26/08/2015
from_csv function
schema_of_csv function
to_json function
to_xml function
from_json function