This is an automated email from the ASF dual-hosted git repository. gurwls223 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new 3ddc26d [MINOR][DOCS] Add a clarifying note to str_to_map documentation 3ddc26d is described below commit 3ddc26ddd8bfd706204c5b20dbfb7749ab55a6ca Author: Michael Chirico <michaelchiri...@gmail.com> AuthorDate: Tue Jun 4 16:58:25 2019 +0900 [MINOR][DOCS] Add a clarifying note to str_to_map documentation I was quite surprised by the following behavior: `SELECT str_to_map('1:2|3:4', '|')` vs `SELECT str_to_map(replace('1:2|3:4', '|', ','))` The documentation does not make clear at all what's going on here, but a [dive into the source code shows](https://github.com/apache/spark/blob/fa0d4bf69929c5acd676d602e758a969713d19d8/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala#L461-L466) that `split` is being used and in turn the interpretation of `split`'s arguments as RegEx is clearly documented. ## What changes were proposed in this pull request? Documentation clarification ## How was this patch tested? N/A Closes #23888 from MichaelChirico/patch-2. Authored-by: Michael Chirico <michaelchiri...@gmail.com> Signed-off-by: HyukjinKwon <gurwls...@apache.org> --- .../org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala index 8d3a641..319a7fc 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala @@ -418,7 +418,7 @@ case class CreateNamedStructUnsafe(children: Seq[Expression]) extends CreateName */ // scalastyle:off line.size.limit @ExpressionDescription( - usage = "_FUNC_(text[, pairDelim[, keyValueDelim]]) - Creates a map after splitting the text into key/value pairs using delimiters. Default delimiters are ',' for `pairDelim` and ':' for `keyValueDelim`.", + usage = "_FUNC_(text[, pairDelim[, keyValueDelim]]) - Creates a map after splitting the text into key/value pairs using delimiters. Default delimiters are ',' for `pairDelim` and ':' for `keyValueDelim`. Both `pairDelim` and `keyValueDelim` are treated as regular expressions.", examples = """ Examples: > SELECT _FUNC_('a:1,b:2,c:3', ',', ':'); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org