Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/23045#discussion_r234494542
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
---
@@ -521,13 +521,18 @@ case class MapEntries(child: Expression) extends
UnaryExpression with ExpectsInp
case class MapConcat(children: Seq[Expression]) extends
ComplexTypeMergingExpression {
override def checkInputDataTypes(): TypeCheckResult = {
- var funcName = s"function $prettyName"
+ val funcName = s"function $prettyName"
if (children.exists(!_.dataType.isInstanceOf[MapType])) {
TypeCheckResult.TypeCheckFailure(
s"input to $funcName should all be of type map, but it's " +
children.map(_.dataType.catalogString).mkString("[", ", ", "]"))
} else {
- TypeUtils.checkForSameTypeInputExpr(children.map(_.dataType),
funcName)
+ val sameTypeCheck =
TypeUtils.checkForSameTypeInputExpr(children.map(_.dataType), funcName)
+ if (sameTypeCheck.isFailure) {
+ sameTypeCheck
+ } else {
+ TypeUtils.checkForMapKeyType(dataType.keyType)
--- End diff --
see
https://github.com/apache/spark/pull/23045/files#diff-3f19ec3d15dcd8cd42bb25dde1c5c1a9R20
. The child may be read from parquet files, so map of map is still possible.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]