Github user dilipbiswal commented on a diff in the pull request:
https://github.com/apache/spark/pull/21240#discussion_r186277062
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
---
@@ -702,6 +703,20 @@ object TypeCoercion {
}
}
+ /**
+ * Coerces first argument in ReplicateRows expression and introduces a
cast to Long
+ * if necessary.
+ */
+ object ReplicateRowsCoercion extends TypeCoercionRule {
+ private val acceptedTypes = Seq(IntegerType, ShortType, ByteType)
+ override def coerceTypes(plan: LogicalPlan): LogicalPlan = plan
transformAllExpressions {
+ case s @ ReplicateRows(children) if s.childrenResolved &&
+ s.children.head.dataType != LongType &&
acceptedTypes.contains(s.children.head.dataType) =>
--- End diff --
ok
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]