This is an automated email from the ASF dual-hosted git repository. dongjoon pushed a commit to branch branch-2.3 in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-2.3 by this push: new 0d5533c [SPARK-27673][SQL] Add `since` info to random, regex, null expressions 0d5533c is described below commit 0d5533c3543cb2c75fce9248dfd55590497a271b Author: HyukjinKwon <gurwls...@apache.org> AuthorDate: Fri May 10 09:24:04 2019 -0700 [SPARK-27673][SQL] Add `since` info to random, regex, null expressions We should add since info to all expressions. SPARK-7886 Rand / Randn https://github.com/apache/spark/commit/af3746ce0d724dc624658a2187bde188ab26d084 RLike, Like (I manually checked that it exists from 1.0.0) SPARK-8262 Split SPARK-8256 RegExpReplace SPARK-8255 RegExpExtract https://github.com/apache/spark/commit/9aadcffabd226557174f3ff566927f873c71672e Coalesce / IsNull / IsNotNull (I manually checked that it exists from 1.0.0) SPARK-14541 IfNull / NullIf / Nvl / Nvl2 SPARK-9080 IsNaN SPARK-9168 NaNvl N/A Closes #24579 from HyukjinKwon/SPARK-27673. Authored-by: HyukjinKwon <gurwls...@apache.org> Signed-off-by: Dongjoon Hyun <dh...@apple.com> (cherry picked from commit c71f217de1e0b2265f585369aa556ed26db98589) Signed-off-by: Dongjoon Hyun <dh...@apple.com> --- .../sql/catalyst/expressions/nullExpressions.scala | 27 ++++++++++++++-------- .../catalyst/expressions/randomExpressions.scala | 6 +++-- .../catalyst/expressions/regexpExpressions.scala | 15 ++++++++---- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullExpressions.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullExpressions.scala index 470d5da..e04935a 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullExpressions.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullExpressions.scala @@ -41,7 +41,8 @@ import org.apache.spark.sql.types._ Examples: > SELECT _FUNC_(NULL, 1, NULL); 1 - """) + """, + since = "1.0.0") // scalastyle:on line.size.limit case class Coalesce(children: Seq[Expression]) extends Expression { @@ -128,7 +129,8 @@ case class Coalesce(children: Seq[Expression]) extends Expression { Examples: > SELECT _FUNC_(NULL, array('2')); ["2"] - """) + """, + since = "2.0.0") case class IfNull(left: Expression, right: Expression, child: Expression) extends RuntimeReplaceable { @@ -147,7 +149,8 @@ case class IfNull(left: Expression, right: Expression, child: Expression) Examples: > SELECT _FUNC_(2, 2); NULL - """) + """, + since = "2.0.0") case class NullIf(left: Expression, right: Expression, child: Expression) extends RuntimeReplaceable { @@ -166,7 +169,8 @@ case class NullIf(left: Expression, right: Expression, child: Expression) Examples: > SELECT _FUNC_(NULL, array('2')); ["2"] - """) + """, + since = "2.0.0") case class Nvl(left: Expression, right: Expression, child: Expression) extends RuntimeReplaceable { def this(left: Expression, right: Expression) = { @@ -185,7 +189,8 @@ case class Nvl(left: Expression, right: Expression, child: Expression) extends R Examples: > SELECT _FUNC_(NULL, 2, 1); 1 - """) + """, + since = "2.0.0") // scalastyle:on line.size.limit case class Nvl2(expr1: Expression, expr2: Expression, expr3: Expression, child: Expression) extends RuntimeReplaceable { @@ -208,7 +213,8 @@ case class Nvl2(expr1: Expression, expr2: Expression, expr3: Expression, child: Examples: > SELECT _FUNC_(cast('NaN' as double)); true - """) + """, + since = "1.5.0") case class IsNaN(child: Expression) extends UnaryExpression with Predicate with ImplicitCastInputTypes { @@ -250,7 +256,8 @@ case class IsNaN(child: Expression) extends UnaryExpression Examples: > SELECT _FUNC_(cast('NaN' as double), 123); 123.0 - """) + """, + since = "1.5.0") case class NaNvl(left: Expression, right: Expression) extends BinaryExpression with ImplicitCastInputTypes { @@ -310,7 +317,8 @@ case class NaNvl(left: Expression, right: Expression) Examples: > SELECT _FUNC_(1); false - """) + """, + since = "1.0.0") case class IsNull(child: Expression) extends UnaryExpression with Predicate { override def nullable: Boolean = false @@ -336,7 +344,8 @@ case class IsNull(child: Expression) extends UnaryExpression with Predicate { Examples: > SELECT _FUNC_(1); true - """) + """, + since = "1.0.0") case class IsNotNull(child: Expression) extends UnaryExpression with Predicate { override def nullable: Boolean = false diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/randomExpressions.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/randomExpressions.scala index 8bc936f..ad01d06 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/randomExpressions.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/randomExpressions.scala @@ -68,7 +68,8 @@ abstract class RDG extends UnaryExpression with ExpectsInputTypes with Nondeterm 0.8446490682263027 > SELECT _FUNC_(null); 0.8446490682263027 - """) + """, + since = "1.5.0") // scalastyle:on line.size.limit case class Rand(child: Expression) extends RDG { @@ -102,7 +103,8 @@ object Rand { 1.1164209726833079 > SELECT _FUNC_(null); 1.1164209726833079 - """) + """, + since = "1.5.0") // scalastyle:on line.size.limit case class Randn(child: Expression) extends RDG { diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala index f3e8f6d..7d7a2b2 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala @@ -100,7 +100,8 @@ abstract class StringRegexExpression extends BinaryExpression """, note = """ Use RLIKE to match with standard regular expressions. - """) + """, + since = "1.0.0") case class Like(left: Expression, right: Expression) extends StringRegexExpression { override def escape(v: String): String = StringUtils.escapeLikeRegex(v) @@ -178,7 +179,8 @@ case class Like(left: Expression, right: Expression) extends StringRegexExpressi """, note = """ Use LIKE to match with simple string pattern. - """) + """, + since = "1.0.0") case class RLike(left: Expression, right: Expression) extends StringRegexExpression { override def escape(v: String): String = v @@ -236,7 +238,8 @@ case class RLike(left: Expression, right: Expression) extends StringRegexExpress Examples: > SELECT _FUNC_('oneAtwoBthreeC', '[ABC]'); ["one","two","three",""] - """) + """, + since = "1.5.0") case class StringSplit(str: Expression, pattern: Expression) extends BinaryExpression with ImplicitCastInputTypes { @@ -273,7 +276,8 @@ case class StringSplit(str: Expression, pattern: Expression) Examples: > SELECT _FUNC_('100-200', '(\d+)', 'num'); num-num - """) + """, + since = "1.5.0") // scalastyle:on line.size.limit case class RegExpReplace(subject: Expression, regexp: Expression, rep: Expression) extends TernaryExpression with ImplicitCastInputTypes { @@ -372,7 +376,8 @@ case class RegExpReplace(subject: Expression, regexp: Expression, rep: Expressio Examples: > SELECT _FUNC_('100-200', '(\d+)-(\d+)', 1); 100 - """) + """, + since = "1.5.0") case class RegExpExtract(subject: Expression, regexp: Expression, idx: Expression) extends TernaryExpression with ImplicitCastInputTypes { def this(s: Expression, r: Expression) = this(s, r, Literal(1)) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org