You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Bruce Robbins (Jira)" <ji...@apache.org> on 2022/11/23 17:13:00 UTC

[jira] [Resolved] (SPARK-41205) Bad error message when try_to_binary called with non-foldable format

     [ https://issues.apache.org/jira/browse/SPARK-41205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bruce Robbins resolved SPARK-41205.
-----------------------------------
    Resolution: Duplicate

> Bad error message when try_to_binary called with non-foldable format
> --------------------------------------------------------------------
>
>                 Key: SPARK-41205
>                 URL: https://issues.apache.org/jira/browse/SPARK-41205
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.4.0, 3.3.1
>            Reporter: Bruce Robbins
>            Priority: Minor
>
> For example:
> {noformat}
> spark-sql> SELECT try_to_binary(col1, col2) from values ('abc', 'utf-8') as data(col1, col2);
> [INTERNAL_ERROR] The Spark SQL phase analysis failed with an internal error. You hit a bug in Spark or the Spark plugins you use. Please, report this bug to the corresponding communities or vendors, and provide the full stack trace.
> org.apache.spark.SparkException: [INTERNAL_ERROR] The Spark SQL phase analysis failed with an internal error. You hit a bug in Spark or the Spark plugins you use. Please, report this bug to the corresponding communities or vendors, and provide the full stack trace.
> 	at org.apache.spark.SparkException$.internalError(SparkException.scala:88)
> ...
> Caused by: java.lang.AssertionError: assertion failed
> 	at scala.Predef$.assert(Predef.scala:208)
> 	at org.apache.spark.sql.catalyst.expressions.ToBinary.$anonfun$replacement$1(stringExpressions.scala:2597)
> 	at scala.Option.map(Option.scala:230)
> 	at org.apache.spark.sql.catalyst.expressions.ToBinary.replacement$lzycompute(stringExpressions.scala:2596)
> 	at org.apache.spark.sql.catalyst.expressions.ToBinary.replacement(stringExpressions.scala:2596)
> 	at org.apache.spark.sql.catalyst.expressions.RuntimeReplaceable.dataType(Expression.scala:354)
> {noformat}
> Compare to {{to_binary}}:
> {noformat}
> spark-sql> SELECT to_binary(col1, col2) from values ('abc', 'utf-8') as data(col1, col2);
> The 'format' parameter of function 'to_binary' needs to be a string literal.; line 1 pos 7
> spark-sql> 
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org