Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/21193#discussion_r185794699
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/javaCode.scala
---
@@ -120,13 +216,15 @@ object JavaCode {
trait ExprValue extends JavaCode {
def javaType: Class[_]
def isPrimitive: Boolean = javaType.isPrimitive
+
+ // This will be called during string interpolation.
+ override def toString: String = ExprValue.exprValueToString(this)
}
object ExprValue {
- implicit def exprValueToString(exprValue: ExprValue): String =
exprValue.toString
+ implicit def exprValueToString(exprValue: ExprValue): String =
exprValue.code
--- End diff --
Because `toString` will call `exprValueToString`. We should have only one
place to convert an `ExprValue` to string.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]