Github user chenghao-intel commented on a diff in the pull request: https://github.com/apache/spark/pull/6775#discussion_r32379201 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala --- @@ -914,6 +914,42 @@ object functions { def ceil(columnName: String): Column = ceil(Column(columnName)) /** + * Computes the concat of the given values. + * + * @group normal_funcs + * @since 1.5.0 + */ + @scala.annotation.varargs + def concat(exprs: Column*): Column = Concat(exprs.map(_.expr): _*) + + /** + * Computes the concat of the given column names. + * + * @group normal_funcs + * @since 1.5.0 + */ + @scala.annotation.varargs + def concat(columnName: String, columnNames: String*): Column = + concat((columnName +: columnNames).map(Column.apply): _*) + + /** + * Computes the concat_ws of the given columns with given separator. + * + * @group normal_funcs + * @since 1.5.0 + */ + @scala.annotation.varargs + def concat_ws(sep: Column, exprs: Column*): Column = concat_ws(sep, array(exprs: _*)) + + /** + * Computes the concat_ws of the given columns with given separator. + * + * @group normal_funcs + * @since 1.5.0 + */ + def concat_ws(sep: Column, exprs: Column): Column = ConcatWS(sep.expr, exprs.expr) --- End diff -- I just checked that in Hive ```sql select concat_ws("a", array("b","c"), "d"); -- outputs "bacad" select concat_ws("a", "b"); -- output "b" select concat_ws("a", "b", "c"); -- output "bac" select concat_ws("a"); -- semantic error select concat_ws(); -- semantic error ```
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org