Skip to content

Commit 2fdf903

Browse files
committed
Better error message when coalesce can't be resolved.
1 parent f9fa6cf commit 2fdf903

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullFunctions.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ case class Coalesce(children: Seq[Expression]) extends Expression {
3737
def dataType = if (resolved) {
3838
children.head.dataType
3939
} else {
40-
throw new UnresolvedException(this, "Coalesce cannot have children of different types.")
40+
val childTypes = children.map(c => s"$c: ${c.dataType}").mkString(", ")
41+
throw new UnresolvedException(
42+
this, "Coalesce cannot have children of different types. $childTypes")
4143
}
4244

4345
override def eval(input: Row): Any = {

0 commit comments

Comments
 (0)