Github user mn-mikke commented on a diff in the pull request:
https://github.com/apache/spark/pull/21208#discussion_r185532437
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
---
@@ -1229,3 +1229,98 @@ case class Flatten(child: Expression) extends
UnaryExpression {
override def prettyName: String = "flatten"
}
+
+/**
+ * Returns the array containing the given input value (left) count (right)
times.
+ */
+@ExpressionDescription(
+ usage = "_FUNC_(element, count) - Returns the array containing element
count times.",
+ examples = """
+ Examples:
+ > SELECT _FUNC_('123', 2);
+ ['123', '123']
+ """)
+case class ArrayRepeat(left: Expression, right: Expression)
+ extends BinaryExpression {
--- End diff --
What about simplifying the type checking with the below snippet?
```
with ExpectsInputTypes {
override def inputTypes: Seq[AbstractDataType] = Seq(AnyDataType,
IntegerType)
...
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]