Linhong Liu created SPARK-36148:
-----------------------------------

             Summary: Missing validation of regexp_replace inputs
                 Key: SPARK-36148
                 URL: https://issues.apache.org/jira/browse/SPARK-36148
             Project: Spark
          Issue Type: Task
          Components: SQL
    Affects Versions: 3.3.0
            Reporter: Linhong Liu


sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala
 overrides checkInputDataTypes, but it doesn't call super.checkInputDataTypes, 
so basic type checking is disabled.

 
{code:java}
scala> spark.sql("""select regexp_replace(collect_list(1), "1", 
"2")""").collect()
221/07/14 20:58:38 ERROR CodeGenerator: failed to compile: 
org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 72, 
Column 1: Assignment conversion not possible from type 
"org.apache.spark.sql.catalyst.util.ArrayData" to type 
"org.apache.spark.unsafe.types.UTF8String"
3org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 
72, Column 1: Assignment conversion not possible from type 
"org.apache.spark.sql.catalyst.util.ArrayData" to type 
"org.apache.spark.unsafe.types.UTF8String"
4       at 
org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:12021)
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to