concat_wsfunction

一個pplies to:check marked yesDatabricks SQLcheck marked yesDatabricks Runtime

Returns the concatenation strings separated bysep.

Syntax

concat_ws(sep[,expr1[,...]])

一個rguments

  • sep: An STRING expression.

  • exprN: EachexprNcan be either a STRING or an ARRAY of STRING.

Returns

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.

Examples

>SELECTconcat_ws(' ','Spark','SQL');SparkSQL>SELECTconcat_ws('s');''>SELECTconcat_ws(',','Spark',array('S','Q',NULL,'L'),NULL);Spark,S,Q,L