Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/21620#discussion_r197611266
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
---
@@ -536,6 +536,11 @@ object TypeCoercion {
case None => c
}
+ case ArrayJoin(arr, d, nr) if
!ArrayType(StringType).acceptsType(arr.dataType) &&
+ ArrayType.acceptsType(arr.dataType) =>
+ val containsNull =
arr.dataType.asInstanceOf[ArrayType].containsNull
+ ArrayJoin(Cast(arr, ArrayType(StringType, containsNull)), d, nr)
--- End diff --
not every type can be casted to `StringType`. What about using
`ImplicitTypeCasts.implicitCast` in order to check if we can cast it?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]