EnricoMi commented on code in PR #37407:
URL: https://github.com/apache/spark/pull/37407#discussion_r988686782
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -101,16 +101,45 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
"pivotType" -> pivotCol.dataType.catalogString))
}
+ def unpivotRequiresAttributes(given: String,
+ empty: String,
+ expressions: Seq[NamedExpression]): Throwable
= {
+ val types = expressions.groupBy(_.getClass.getSimpleName)
+ .mapValues(exprs => exprs.map(expr => expr.toString.replaceAll("#\\d+",
"")).sorted)
+ .mapValues(exprs => if (exprs.length > 3) exprs.take(3) :+ "..." else
exprs)
+ .toList.sortBy(_._1)
+ .map { case (className, exprs) => s"$className (${exprs.mkString(",
")})" }
Review Comment:
Done in 2c8f53df though `.map(toSQLExpr)` gives better results
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]