Get started
Load & manage data
Work with data
一個dministration
Reference & resources
Updated Feb 09, 2023
Send us feedback
concat_ws
一個pplies to:Databricks SQLDatabricks Runtime
Returns the concatenation strings separated bysep.
sep
concat_ws(sep[,expr1[,...]])
sep: An STRING expression.
exprN: EachexprNcan be either a STRING or an ARRAY of STRING.
exprN
The result type is STRING.
Ifsepis NULL the result is NULL.exprNthat are NULL are ignored. If only the separator is provided, or allexprNare NULL, an empty string.
>SELECTconcat_ws(' ','Spark','SQL');SparkSQL>SELECTconcat_ws('s');''>SELECTconcat_ws(',','Spark',array('S','Q',NULL,'L'),NULL);Spark,S,Q,L
|| (pipe pipe sign) operator
concat function
array_join function