spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dilipbiswal <...@git.apache.org>
Subject [GitHub] spark pull request #21240: [SPARK-21274][SQL] Add a new generator function r...
Date Sun, 06 May 2018 06:32:10 GMT
Github user dilipbiswal commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21240#discussion_r186279795
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala
---
    @@ -222,6 +222,51 @@ case class Stack(children: Seq[Expression]) extends Generator {
       }
     }
     
    +/**
    + * Replicate the row N times. N is specified as the first argument to the function.
    + * {{{
    + *   SELECT replicate_rows(2, "val1", "val2") ->
    + *   2  val1  val2
    + *   2  val1  val2
    + *  }}}
    + */
    +@ExpressionDescription(
    +usage = "_FUNC_(n, expr1, ..., exprk) - Replicates `n`, `expr1`, ..., `exprk` into `n`
rows.",
    +examples = """
    +    Examples:
    +      > SELECT _FUNC_(2, "val1", "val2");
    +       2  val1  val2
    +       2  val1  val2
    +  """)
    +case class ReplicateRows(children: Seq[Expression]) extends Generator with CodegenFallback
{
    --- End diff --
    
    @viirya If you don't mind, i would like to do it in a follow-up. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message