vitaliili-db commented on code in PR #37483:
URL: https://github.com/apache/spark/pull/37483#discussion_r959086655


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala:
##########
@@ -2488,59 +2539,117 @@ case class Encode(value: Expression, charset: 
Expression)
   """,
   since = "3.3.0",
   group = "string_funcs")
-// scalastyle:on line.size.limit
-case class ToBinary(
-    expr: Expression,
-    format: Option[Expression],
-    nullOnInvalidFormat: Boolean = false) extends RuntimeReplaceable
-  with ImplicitCastInputTypes {
-
-  override lazy val replacement: Expression = format.map { f =>
-    assert(f.foldable && (f.dataType == StringType || f.dataType == NullType))

Review Comment:
   @cloud-fan Here is my attempt to revert to `RuntimeReplaceable`. It works 
for the most part except for errors. I am not sure if it is serialization to 
executors or something else but `QueryContext` is pretty much empty (not 
`None`, just all fields are not populated). <- @MaxGekk is there a way to fix 
this? 
   
   Another alternative way to enforce `format` being foldable/literal is to 
check it in `checkInputDataTypes`. This will revert my last commit but error 
messages will be cleaner, what do you think?



-- 
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]

Reply via email to